Re: Building on Gentoo/creating a DT_TEXTREL in shared object

Andy Ross

I'm guessing that these relocations are there everywhere and that yours just happens to be a binutils recent enough to warn about it.  Have you tried just removing the "-Wl,--fatal-warnings" bit from sanitycheck manually?  I bet the test would succeed.

As for why the (pretty dubious) relocation is there at all, I don't have a clue except to say that it's going to be specific to native_posix as nothing else we build uses PIC, AFAIK.

The native_posix rig works with the host compiler, so it's subject to this kind of version skew.  One that bites me (with gcc 8.1.1 on Fedora 28) at the moment is a static warning about strncpy()'ing a string literal longer than the output buffer, in a test designed to check the truncation behavior of strncpy()!


From: David Brown <david.brown@...>
Sent: Wednesday, May 23, 2018 9:48AM
To: Devel
Subject: [Zephyr-devel] Building on Gentoo/creating a DT_TEXTREL in shared object
I'm trying to figure out how to get Zephyr's sanity tests to build on
my Gentoo-based development machine.  The tests all pass if I build in
a docker image based on Ubuntu.

But, when I build directly on Gentoo, the native_posix tests fail with
a link error:

/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../libapp.a(posix_clock.c.obj): warning: relocation in readonly section `.text.test_main'
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in a shared object.
collect2: error: ld returned 1 exit status

I'm guessing this is something configured differently about the linker
in Gentoo than on Ubuntu, but I'm not yet sure what to look for.

Does anyone have any thoughts or idea?


Join to automatically receive all group messages.