{"id":155,"date":"2014-09-16T13:51:06","date_gmt":"2014-09-16T20:51:06","guid":{"rendered":"http:\/\/www.migration.andersknelson.com\/blog\/?p=155"},"modified":"2023-11-01T00:49:43","modified_gmt":"2023-11-01T04:49:43","slug":"debian-on-beaglebone-black-eclipse-on-osx-cross-compiling","status":"publish","type":"post","link":"https:\/\/www.andersknelson.com\/blog\/?p=155","title":{"rendered":"Debian on BeagleBone Black, Eclipse on OSX &#8211; Cross compiling"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">&#8211; I never got this working fully but maybe there are some bits here you can use &#8211;<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">The story<\/h3>\n\n\n\n<p>I got a BBB and started with <a href=\"http:\/\/youtu.be\/vFv_-ykLppo?list=PLF4A1A7E09E5E260A\">Derek Malloy&#8217;s awesome tutorial<\/a>&nbsp;so I could finally put my <a title=\"Protest Sign\" href=\"http:\/\/www.migration.andersknelson.com\/blog\/?p=41\">awesome blinkery<\/a> to work as an enormous wall-mounted, internet-synchronized&nbsp;clock.<\/p>\n\n\n\n<p><a href=\"http:\/\/www.adafruit.com\">Adafruit<\/a> decided after customer feedback that it would ship the BBB with Debian installed. This is all fine and good (I actually have no idea) but <strong>the version of Debian that it runs requires that projects be compiled with hardware FPU (Floating Point Unit) support. <\/strong>When I compiled my program and executed it on the BBB I got an error:<\/p>\n\n\n\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/11471722\/libstdc-so-6-cannot-open-shared-object-file-no-such-file-or-directory\">http:\/\/stackoverflow.com\/questions\/11471722\/libstdc-so-6-cannot-open-shared-object-file-no-such-file-or-directory<\/a><\/p>\n\n\n\n<p>If you download a popular ARM-linux toolchain like <a href=\"www.carlson-minot.com\/available-arm-gnu-linux-g-lite-builds-for-mac-os-x\">Carlson-Minot&#8217;s <\/a><span style=\"font-weight: bold;\">arm-none-gnueabi<\/span>, your program will build beautifully but <strong>not run at all<\/strong>&nbsp;on a BBB running Debian. It&#8217;s not Carlson-Minot&#8217;s fault, it&#8217;s that the BBB build of Debian requires a hardware FPU enabled toolchain.<\/p>\n\n\n\n<p>If you use a Linux or Windows environment to create your BBB programs using the <span style=\"font-weight: bold;\">arm-none-gnueabihf<\/span>&nbsp;toolchain, then everything&#8217;s hunky-dory. If you use OSX however, things are not so easy.<\/p>\n\n\n\n<p>I found an <strong>arm-none-gnueabihf<\/strong> toolchain built for use on OSX here:<\/p>\n\n\n\n<p><a href=\"http:\/\/will-tm.com\/cross-compiling-mac-os-x-mavericks\/\">http:\/\/will-tm.com\/cross-compiling-mac-os-x-mavericks\/<\/a><\/p>\n\n\n\n<p>When I dragged the toolchain over to my local disk, the copy routine decided to quit when it ran into a file that had a matching version expressed in CAPITAL LETTERS&nbsp;because&nbsp;I have a case-insensitive filesystem on my Macbook.&nbsp;To get around this (ignoring errors during the copy) I used Ditto from the terminal:<\/p>\n\n\n\n<p><a href=\"https:\/\/discussions.apple.com\/thread\/1462340?tstart=0\">https:\/\/discussions.apple.com\/thread\/1462340?tstart=0<\/a><\/p>\n\n\n\n<p>NOTE: With the above I think it skipped &#8220;xt_connmark.h&#8221;. It looks to have content to it so I copied that over manually. The version of the same file expressed in capital letters did not seem to have any useful content.<\/p>\n\n\n\n<p>If Eclipse shows nasty icons where C++ library calls are present, even though the project&nbsp;builds\/runs successfully:<\/p>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/10803685\/eclipse-cdt-symbol-cout-could-not-be-resolved?answertab=votes#tab-top\">https:\/\/stackoverflow.com\/questions\/10803685\/eclipse-cdt-symbol-cout-could-not-be-resolved?answertab=votes#tab-top<\/a><\/p>\n\n\n\n<p>If Eclipse cant&#8217; find GDB,&nbsp;you&#8217;re probably using the GDB built for the host system (x86). You need to point&nbsp;Eclipse&nbsp;to the GDB that comes with the target toolchain. In my case:<\/p>\n\n\n\n<p>\/usr\/local\/willtm\/bin\/arm-willtm-linux-gnueabi-gdb<\/p>\n\n\n\n<p>You also must select the shared library for the target under &#8220;Shared Libraries&#8221; in Eclipse debugging settings. In my case:<\/p>\n\n\n\n<p>\/usr\/local\/willtm\/arm-willtm-linux-gnueabi\/sysroot\/lib<\/p>\n\n\n\n<p>Otherwise you&#8217;ll get some crap:<\/p>\n\n\n\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/13678923\/eclipse-failed-to-execute-mi-command\">http:\/\/stackoverflow.com\/questions\/13678923\/eclipse-failed-to-execute-mi-command<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other maybe useful info<\/h3>\n\n\n\n<p>Building an arm-none-gnueabihf<span style=\"font-weight: bold;\">&nbsp;<\/span>toolchain for OSX:<\/p>\n\n\n\n<p><a href=\"http:\/\/www.benmont.com\/tech\/crosscompiler.html\">http:\/\/www.benmont.com\/tech\/crosscompiler.html<\/a><\/p>\n\n\n\n<p>A more detailed account of building an OSX toolchain:<\/p>\n\n\n\n<p><a href=\"http:\/\/tblog.rool.at\/?p=57\">http:\/\/tblog.rool.at\/?p=57<\/a><\/p>\n\n\n\n<p>Will\u2122&#8217;s cross-tool ng configuration:<\/p>\n\n\n\n<p><a href=\"https:\/\/gist.github.com\/Will-tm\/8f31886c7c25a1aba7b0\">https:\/\/gist.github.com\/Will-tm\/8f31886c7c25a1aba7b0<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/derekmolloy.ie\/beaglebone\/setting-up-eclipse-on-the-beaglebone-for-c-development\/\">http:\/\/derekmolloy.ie\/beaglebone\/setting-up-eclipse-on-the-beaglebone-for-c-development\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.migration.andersknelson.com\/blog\/wp-content\/uploads\/2014\/09\/Screen-Shot-2014-09-16-at-1.22.36-PM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1286\" height=\"682\" src=\"http:\/\/www.migration.andersknelson.com\/blog\/wp-content\/uploads\/2014\/09\/Screen-Shot-2014-09-16-at-1.22.36-PM.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/www.andersknelson.com\/blog\/wp-content\/uploads\/2014\/09\/Screen-Shot-2014-09-16-at-1.22.36-PM.png 1286w, https:\/\/www.andersknelson.com\/blog\/wp-content\/uploads\/2014\/09\/Screen-Shot-2014-09-16-at-1.22.36-PM-300x159.png 300w, https:\/\/www.andersknelson.com\/blog\/wp-content\/uploads\/2014\/09\/Screen-Shot-2014-09-16-at-1.22.36-PM-1024x543.png 1024w\" sizes=\"auto, (max-width: 1286px) 100vw, 1286px\" \/><\/a><\/figure>\n\n\n\n<p>Linaro, a company that hosts lots of toolchain builds for different OSes. I asked them to provide an OSX build, we&#8217;ll see how they respond!:<\/p>\n\n\n\n<p><a href=\"http:\/\/www.linaro.org\/downloads\/\">http:\/\/www.linaro.org\/downloads\/<\/a><\/p>\n\n\n\n<p>Lots of BBB Debian info:<\/p>\n\n\n\n<p><a href=\"http:\/\/elinux.org\/Beagleboard:BeagleBoneBlack_Debian\">http:\/\/elinux.org\/Beagleboard:BeagleBoneBlack_Debian<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; I never got this working fully but maybe there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":175,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[15,11,12,10,14,13,21,22,20,18,19,16,24,23,17],"class_list":["post-155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","tag-arm","tag-bbb","tag-beagle","tag-beaglebone","tag-black","tag-bone","tag-debian","tag-eclipse","tag-float","tag-gnueabihf","tag-hard","tag-linux","tag-mac","tag-osx","tag-toolchain"],"_links":{"self":[{"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155"}],"version-history":[{"count":22,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":1125,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions\/1125"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/175"}],"wp:attachment":[{"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.andersknelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}