From: alexandre schenberg <ale.schenberg@yandex.com>
To: libc-help@sourceware.org
Subject: undefined references to `__libc_csu_fini/init when copying glibc files to /usr/lib32
Date: Sun, 28 May 2023 21:25:02 -0300 [thread overview]
Message-ID: <1361191685319902@gavdw3jrkjwbxdg3.myt.yp-c.yandex.net> (raw)
Hi. I installed Glibc using the prefix=/usr and DESTDIR=/media/34GB/Arquivos-de-Programas-Linux-32bit/Glibc-2.17/.
Then I proceeded to create symbolic links to some of its files in /usr/lib32. They are:
crt1.o, crti.o, crtn.o, ld-linux.so.2, libc.a, libc.so, libm.a and libc.so.
After that, I tried to cross compile a simple test program with:
g++ -m32 -o test-32bit test-32bit.cpp
that returned:
/usr/lib/../lib32/crt1.o: In function `_start':
/media/34GB/Arquivos-de-Programas-Linux-32bit/glibc-2.17/csu/../sysdeps/i386/start.S:107: undefined reference to `__libc_csu_fini'
/media/34GB/Arquivos-de-Programas-Linux-32bit/glibc-2.17/csu/../sysdeps/i386/start.S:108: undefined reference to `__libc_csu_init'
collect2: error: ld returned 1 exit status
I then created another symbolic link in /usr/lib32 to libc_nonshared.a
However, it didn't solve the problem.
I then did a test, tried to compile the test program passing the dir where libc_nonshared.a is located with:
g++ -m32 -o test-32bit test-32bit.cpp -L/media/34GB/Arquivos-de-Programas-Linux-32bit/Glibc-2.17/usr/lib/
and it returned:
/usr/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/usr/bin/ld: cannot find /lib/libc.so.6
collect2: error: ld returned 1 exit status
I found very weird that it is looking for libc.so.6 in a directory different than the ones mentioned in prefix and DESTDIR.
Anyway, I am not sure if this is related to the __libc_csu_fini/init error messages and I am open to suggestions about how to make these symbols to be located during compilation.
next reply other threads:[~2023-05-29 0:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 0:25 alexandre schenberg [this message]
2023-05-30 6:38 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361191685319902@gavdw3jrkjwbxdg3.myt.yp-c.yandex.net \
--to=ale.schenberg@yandex.com \
--cc=libc-help@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).