{"id":435,"date":"2022-08-30T15:01:18","date_gmt":"2022-08-30T15:01:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/__libc_csu_fini-and-__libc_csu_init-undefined-while-following-instructions-for-build-webos-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:01:18","modified_gmt":"2022-08-30T15:01:18","slug":"__libc_csu_fini-and-__libc_csu_init-undefined-while-following-instructions-for-build-webos-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/__libc_csu_fini-and-__libc_csu_init-undefined-while-following-instructions-for-build-webos-collection-of-common-programming-errors\/","title":{"rendered":"__libc_csu_fini and __libc_csu_init undefined while following instructions for build-webos-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to build OpenWebOS and just following the plan laid out in the build-webos GitHub README. I&#8217;m using a fresh 32-bit Ubuntu 12.10 installation. Things have been a bit bumpy.<\/p>\n<p>However, with a tweak here and there I managed to get up to step 350 out of 2500 or (or whatever) before it errors out. The problem is the dependency of building glibc, and it&#8217;s complaining about<\/p>\n<pre><code>(...)\/sysdeps\/i386\/start.S:107: undefined reference to `__libc_csu_fini'\n(...)\/sysdeps\/i386\/start.S:108: undefined reference to `__libc_csu_init'\n<\/code><\/pre>\n<p>Searching the web reveals various cases of people having this happen to them when not building glibc itself:<\/p>\n<p>ld complains: in function &#8220;_start&#8221;, undefined reference to &#8220;__libc_csu_fini&#8221; &amp; &#8220;__libc_csu_init&#8221;<\/p>\n<p>Can&#8217;t link a C program<\/p>\n<p>But this is during the build of a custom <em>Embedded LIBC: eglibc<\/em>. So it&#8217;s a little different, and the closest case I can find is this 2009 thread on an OpenEmbedded list. I&#8217;m not sure how to put their patch into action in the confusing &#8220;bakefile&#8221;-laden universe of the WebOS build structure, which is dizzyingly weird.<\/p>\n<p>The monster of a command line which is failing I will &#8220;simplify&#8221; down a little to the following:<\/p>\n<blockquote>\n<p>gcc -m32 -march=i586 &#8211;sysroot=\/home\/webos\/build-webos\/BUILD-qemux86\/sysroots\/qemux86-tcbootstrap -nostdlib -nostartfiles -o iconv\/iconvconfig -Wl,-dynamic-linker=\/lib\/ld-linux.so.2 -Wl,-z,combreloc -Wl,-z,relro -Wl,&#8211;hash-style=both csu\/crt1.o csu\/crti.o `gcc -m32 -march=i586 &#8211;sysroot=\/home\/hostilefork\/Projects\/webos\/build-webos\/BUILD-qemux86\/sysroots\/qemux86-tcbootstrap &#8211;print-file-name=crtbegin.o` iconv\/iconvconfig.o iconv\/strtab.o iconv\/xmalloc.o iconv\/hash-string.o -Wl,-rpath-link=\/home\/webos\/build-webos\/BUILD-qemux86\/work\/i586-webos-linux\/eglibc-2.16-r15+svnr20393\/build-i586-webos-linux:math:elf:dlfcn:nss:nis:rt:resolv:crypt:nptl libc.so.6 libc_nonshared.a -Wl,&#8211;as-needed elf\/ld.so -Wl,&#8211;no-as-needed -lgcc `gcc -m32 -march=i586 &#8211;sysroot=\/home\/webos\/build-webos\/BUILD-qemux86\/sysroots\/qemux86-tcbootstrap &#8211;print-file-name=crtend.o` csu\/crtn.o<\/p>\n<\/blockquote>\n<p>I&#8217;ve got a <strong>libc.a<\/strong> and a <strong>libc_nonshared.a<\/strong> file in the directory. There&#8217;s no mention of <code>__libc_csu_init<\/code> or <code>__libc_csu_fini<\/code> in the nonshared version, but they&#8217;re in the ordinary libc.a. This seems backward from what people seem to act as if should be true, although&#8230; when I look in the <code>\/usr\/lib\/i386-linux-gnu<\/code> for what came with Ubuntu, both the shared and nonshared versions mention it. Hmmm.<\/p>\n<p>If anyone reads this and goes &#8220;hey, bet I know what&#8217;s going on!&#8221; that would be nifty. \ud83d\ude42<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:42:28. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to build OpenWebOS and just following the plan laid out in the build-webos GitHub README. I&#8217;m using a fresh 32-bit Ubuntu 12.10 installation. Things have been a bit bumpy. However, with a tweak here and there I managed to get up to step 350 out of 2500 or (or whatever) before it errors [&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-435","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/435","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=435"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/435\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}