{"id":465,"date":"2018-01-05T17:53:43","date_gmt":"2018-01-05T16:53:43","guid":{"rendered":"http:\/\/paguilar.org\/?p=465"},"modified":"2018-01-05T17:53:43","modified_gmt":"2018-01-05T16:53:43","slug":"skipping-incompatible-lib-libpthread-so-0-when-searching-for-lib-libpthread-so-0","status":"publish","type":"post","link":"https:\/\/paguilar.org\/?p=465","title":{"rendered":"Skipping incompatible \/lib\/libpthread.so.0 when searching for \/lib\/libpthread.so.0"},"content":{"rendered":"<p>This normally happens when compiling for an arch, say ARM, and try to execute the binary in an x86_64 arch.<br \/>\nBut in this case, it was not this problem, I was sure that I was compiling and executing for the right places for the right archs.<\/p>\n<p>The error was the following:<\/p>\n<pre lang=bash>\r\n\/opt\/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf\/bin\/..\/lib\/gcc\/arm-linux-gnueabihf\/4.9.3\/..\/..\/..\/..\/arm-linux-gnueabihf\/bin\/ld: skipping incompatible \/lib\/libpthread.so.0 when searching for \/lib\/libpthread.so.0\r\n\/opt\/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf\/bin\/..\/lib\/gcc\/arm-linux-gnueabihf\/4.9.3\/..\/..\/..\/..\/arm-linux-gnueabihf\/bin\/ld: cannot find \/lib\/libpthread.so.0\r\n<\/pre>\n<p>Then I discovered that the same issue appears with libc.so.6.<br \/>\nFor some reason this happened after a Fedora upgrade, something got missing during the upgrade.<\/p>\n<p>In order to fix it, change to the directory where your sysroot resides, in my case is \/opt\/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf\/sysroot<\/p>\n<p>Edit the file <em>usr\/lib\/libpthread.so.<\/em><br \/>\nChange the GROUP line that is where the linker searches for libpthread:<\/p>\n<pre lang=bash>\r\n\/*GROUP ( \/lib\/libpthread.so.0 \/usr\/lib\/libpthread_nonshared.a )*\/\r\nGROUP ( libpthread.so.0 libpthread_nonshared.a )\r\n<\/pre>\n<p>Edit also the file <em>usr\/lib\/libc.so<\/em>:<\/p>\n<pre lang=bash>\r\n\/*GROUP ( \/lib\/libc.so.6 \/usr\/lib\/libc_nonshared.a  AS_NEEDED ( \/lib\/ld-linux-armhf.so.3 ) )*\/\r\nGROUP ( libc.so.6 libc_nonshared.a  AS_NEEDED ( ld-linux-armhf.so.3 ) )\r\n<\/pre>\n<p>After this, I was able again to execute the binaries as before.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This normally happens when compiling for an arch, say ARM, and try to execute the binary in an x86_64 arch. But in this case, it was not this problem, I was sure that I was compiling and executing for the right places for the right archs. The error was the following: \/opt\/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf\/bin\/..\/lib\/gcc\/arm-linux-gnueabihf\/4.9.3\/..\/..\/..\/..\/arm-linux-gnueabihf\/bin\/ld: skipping incompatible \/lib\/libpthread.so.0\u2026 <span class=\"read-more\"><a href=\"https:\/\/paguilar.org\/?p=465\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,45],"tags":[],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-compiling","category-linux"],"_links":{"self":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=465"}],"version-history":[{"count":3,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions"}],"predecessor-version":[{"id":517,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions\/517"}],"wp:attachment":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}