Hi Alex, Alex Potapenko wrote,
Hi Waldemar!
On Sat, May 21, 2016 at 10:35 AM, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
I think it is on topic. I have cross-compiled gcc and the resulting gcc with prefix /usr can build hello.c.
Have you tried to add --with-sysroot/--with-build-sysroot while configuring gcc? I normally use it on the host to build a relocatable cross-compiler, but I think it might be a solution for non-standard location, too.
I just tried it, it doesn't help:
root@unknown:/tmp/home/root# gcc hello.c -I/opt/include /tmp/cc2Z3b02.o: In function `main': hello.c:(.text+0x44): undefined reference to `atexit' collect2: error: ld returned 1 exit status
(after setting --with-sysroot option, gcc requires '-I/opt/include' flag)
For further debugging you could strace -f -e open -o log to see if still something in /lib is opened while linking.
It doesn't seem to use anything beyond '/opt/...' (used the sed expression to get rid of those '/../'): see log.txt.
Anything else I can try?
Indeed I have an idea. I remember now the dirty details. Can you show me your libc.so file? How does it look like?
It shouldn't be a simple symlink, libc.so is special and needs to be a linker file!
I think your existing linker file points to the wrong uClibc-ng files.
best regards Waldemar