{"id":5262,"date":"2014-03-30T20:03:51","date_gmt":"2014-03-30T20:03:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/why-is-building-a-cross-compiler-harder-than-building-a-regular-compiler-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:03:51","modified_gmt":"2014-03-30T20:03:51","slug":"why-is-building-a-cross-compiler-harder-than-building-a-regular-compiler-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/why-is-building-a-cross-compiler-harder-than-building-a-regular-compiler-collection-of-common-programming-errors\/","title":{"rendered":"Why is building a cross-compiler harder than building a regular compiler?-Collection of common programming errors"},"content":{"rendered":"<p>This doesn&#8217;t have to be harder, but it can be depending on the compiler architecture.<\/p>\n<p>A compiler is not only translating source code into asm and system calls. It&#8217;s also integrating pre-existing <em>helper code<\/em> into the generated files. This is code includes startup code, functions preamble, part of the C api that can be inlined, etc.<\/p>\n<p>In a normal compiler C1 for platform A built on platform A, the original compiler C0 can build C1 and its <em>helper code<\/em> (for A, since C0 targets A) directly.<\/p>\n<p>In a cross compiler C2 for platform B built on platform A, the original compiler C0 must first build a special version of C2 which doesn&#8217;t need the <em>helper code<\/em> (because the <em>helper code<\/em> is for B, while C0 targets A), then it must run C2 to generate the <em>helper code<\/em>. Depending on the compiler, it may then have to generate a second version of C2 that includes the <em>helper code<\/em>.<\/p>\n<p>The act of building the limited version of C2, without <em>helper code<\/em> is the bootstrapping.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This doesn&#8217;t have to be harder, but it can be depending on the compiler architecture. A compiler is not only translating source code into asm and system calls. It&#8217;s also integrating pre-existing helper code into the generated files. This is code includes startup code, functions preamble, part of the C api that can be inlined, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5262","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5262"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5262\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}