{"id":474,"date":"2019-01-17T17:03:25","date_gmt":"2019-01-17T17:03:25","guid":{"rendered":"http:\/\/www.redfelineninja.org.uk\/daniel\/?p=474"},"modified":"2019-01-18T14:22:50","modified_gmt":"2019-01-18T14:22:50","slug":"why-i-spent-my-christmas-day-building-native-arm-compilers","status":"publish","type":"post","link":"http:\/\/www.redfelineninja.org.uk\/daniel\/2019\/01\/why-i-spent-my-christmas-day-building-native-arm-compilers\/","title":{"rendered":"Why I spent my Christmas Day building native Arm compilers"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My day job involves, among a fairly wide variety of other things, rebuilding compilers. So why did I find myself doing the same thing on my day off?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What I did in my holidays<br><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>By Daniel Thompson, aged 40<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I had been looking forward to Christmas more then usual this year. In November we bought some drawers with frosted glass fronts and I had been designing a custom lighting system for them in my mind during long hours washing up through most of the pre-Christmas period.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Christmas day I finally got the chance to hook up my strings of WS2812 LEDs and start hacking. With many LEDs carefully wrapped around and paper clipped a bog roll and with probes dangling off everywhere I decided it was far too fragile to hook up my laptop so I grabbed a spare <a href=\"https:\/\/www.96boards.org\/product\/dragonboard410c\/\">Dragonboard 410C<\/a> before carefully balancing everything and connecting it up to my longstanding <a href=\"https:\/\/www.google.com\/search?q=blue+pill+stm32f103\">Cortex-M3 based microcontroller board of choice<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was only when I tried to do the initial flashing that I realised there was no arm-none-eabi-gdb in Debian Buster\/arm64. There&#8217;s a cross-compiler but no debugger. Without a second thought I rocked over to download the <a href=\"https:\/\/developer.arm.com\/open-source\/gnu-toolchain\/gnu-rm\">Arm embedded toolchain<\/a> from the Arm website but found the cupboard was bare, or as least there were no AArch64 compiler binaries I could use.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After a brief detour of downloading the source code on the DB410C before deciding that building a complex multilib toolchain on a four-core A53 system (with a tiny 8G eMMC) was insane. Shortly afterwards I went upstairs and woke my Developerbox from it&#8217;s Christmas afternoon nap (actually it had been napping since I stopped work a few days earlier).\u200b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After wrangling LXC to create the Ubuntu 14.04 container needed for the build I set about trying to recompile the toolchain. Arm&#8217;s instructions were awesome and even mentioned how to prevent any attempt to build using mingw32 (which would have been doomed to fail when building on AArch64).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that there was just enough time for a nice game of Good News, Bad News to complete the&nbsp;holiday&nbsp;period.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good news: Arm&#8217;s instructions worked perfectly and a brand new toolchain emerged from the other end of the sausage grinder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Bad news: It took my Developerbox over 8 hours to grind through all the builds and as a result I didn&#8217;t get to play with my new toys until Boxing Day.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Good news: (Some of) my software worked first time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Bad news: Except for some apparent toolchain bugs that I haven&#8217;t yet had the chance to check (during working hours) to find out if they are AArch64 specific ;-).<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>Just another day in the life of an Arm-on-Arm developer!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/ssl.gstatic.com\/ui\/v1\/icons\/mail\/images\/cleardot.gif\" alt=\"\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>My day job involves, among a fairly wide variety of other things, rebuilding compilers. So why did I find myself doing the same thing on my day off? What I did in my holidays By Daniel Thompson, aged 40 I had been looking forward to Christmas more then usual this year. In November we bought &hellip; <a href=\"http:\/\/www.redfelineninja.org.uk\/daniel\/2019\/01\/why-i-spent-my-christmas-day-building-native-arm-compilers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Why I spent my Christmas Day building native Arm compilers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,5],"tags":[],"class_list":["post-474","post","type-post","status-publish","format-standard","hentry","category-linaro","category-software"],"_links":{"self":[{"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":3,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":479,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/posts\/474\/revisions\/479"}],"wp:attachment":[{"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.redfelineninja.org.uk\/daniel\/wp-json\/wp\/v2\/tags?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}