{"id":106,"date":"2014-10-14T17:53:56","date_gmt":"2014-10-14T17:53:56","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=106"},"modified":"2016-08-21T09:44:06","modified_gmt":"2016-08-21T07:44:06","slug":"c-programming-on-linux","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/c-programming-on-linux\/","title":{"rendered":"C++ programming on linux"},"content":{"rendered":"<h5>Info despre configuratia de la build gcc<\/h5>\n<pre class=\"brush:bash shell\">gcc -v<\/pre>\n<h5>Paths<\/h5>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Rpath\">http:\/\/en.wikipedia.org\/wiki\/Rpath<\/a><br \/>\n<a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/ld.so.8.html\">http:\/\/man7.org\/linux\/man-pages\/man8\/ld.so.8.html<\/a><\/p>\n<h5>A sure-fire way to determine the name of the dynamic linker is to inspect a random binary from the host system by running:<\/h5>\n<pre class=\"brush:bash shell\">readelf -l \/ffp\/bin\/find | grep interpreter\r\n\tRequesting program interpreter: \/ffp\/lib\/ld-uClibc.so.0\r\nreadelf -l \/bin\/find | grep interpreter \r\n\tRequesting program interpreter: \/lib\/ld-linux.so.3\r\n\r\n\/ffp\/bin\/ld --verbose | grep SEARCH\r\n\tSEARCH_DIR(\"\/ffp\/armv5tel-unknown-linux-uclibceabi\/lib\"); SEARCH_DIR(\"\/ffp\/lib\"); SEARCH_DIR(\"\/usr\/local\/lib\"); SEARCH_DIR(\"\/lib\"); SEARCH_DIR(\"\/usr\/lib\");\r\n\/ffp\/tmp\/ffp_arm-ffp-linux-uclibcgnueabixxx\/bin\/ld --verbose | grep SEARCH\r\n\tSEARCH_DIR(\"=\/usr\/local\/lib\"); SEARCH_DIR(\"=\/lib\"); SEARCH_DIR(\"=\/usr\/lib\");\r\n\r\ngcc -print-libgcc-file-name:\r\n\t\/usr\/local\/zy-pkgs\/ffproot\/ffp\/bin\/..\/lib\/gcc\/arm-ffp-linux-uclibcgnueabi\/4.6.2\/libgcc.a\r\ngcc tlstest.c -pthread -Wl,--verbose 2&gt;&amp;1 | grep succeeded:\r\n\tshow all the files successfully opened during the linking\r\ngcc -print-prog-name=ld:\r\n\tfinds out which standard linker gcc will use; returns only the word:\r\n\tld\r\n<\/pre>\n<h5>pthread<\/h5>\n<pre class=\"brush:bash shell\">gcc -pthread<\/pre>\n<p>Adds support for multithreading with the pthreads library.<br \/>\nThis option sets flags for both the preprocessor and linker.<\/p>\n<h5>FPU (floting point unit)<\/h5>\n<p><a href=\"https:\/\/wiki.debian.org\/ArmHardFloatPort#VFP\">https:\/\/wiki.debian.org\/ArmHardFloatPort#VFP<\/a><br \/>\n<a href=\"https:\/\/wiki.debian.org\/ArmHardFloatPort\/VfpComparison#Details_on_GCC_floating-point_options\">https:\/\/wiki.debian.org\/ArmHardFloatPort\/VfpComparison#Details_on_GCC_floating-point_options<\/a><br \/>\n<a href=\"http:\/\/www.keil.com\/support\/man\/docs\/armccref\/armccref_CIHCJIFE.htm\">http:\/\/www.keil.com\/support\/man\/docs\/armccref\/armccref_CIHCJIFE.htm<\/a><\/p>\n<h5>gcc compiler options<\/h5>\n<p><a title=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/ARM-Options.html#ARM-Options\" href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/ARM-Options.html#ARM-Options\" target=\"_blank\">https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/ARM-Options.html#ARM-Options<\/a><br \/>\nIf you specify -L more than once, the directories are searched in the order specified.<br \/>\ngcc -l links with a library file. -> see <a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc-4.9.0\/gcc\/Link-Options.html\" title=\"Link Options\" target=\"_blank\">Link Options<\/a><br \/>\ngcc -L looks in directory for library files.<\/p>\n<h5>See also<\/h5>\n<p><a href=\"http:\/\/linux.die.net\/man\/1\/ld\" target=\"_blank\">http:\/\/linux.die.net\/man\/1\/ld<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Info despre configuratia de la build gcc gcc -v Paths http:\/\/en.wikipedia.org\/wiki\/Rpath http:\/\/man7.org\/linux\/man-pages\/man8\/ld.so.8.html A sure-fire way to determine the name of the dynamic linker is to inspect a random binary from the host system by running: readelf -l \/ffp\/bin\/find | grep [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/c-programming-on-linux\/#more-106\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">C++ programming on linux<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,10],"tags":[39],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-linux","category-programming","tag-cpp"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}