Building tests from multiple object files

Florian Weimer fweimer@redhat.com
Tue Apr 12 11:41:00 GMT 2016


I'm still working on upstreaming our libresolv and NSS tests.  During 
that, I noticed the following.

The glibc makefiles do not provide a simple way to assemble a test 
binary from multiple object files.  One way to see this is to apply the 
attached harmless patch and then run

   make subdirs=elf check

(or whatever you do to run the test suite).  Linking the test fails with:

/home/fweimer/src/gnu/glibc/build/elf/tst-tlsalign-vars.o: In function 
`use_errno':
/home/fweimer/src/gnu/glibc/git/elf/tst-tlsalign-vars.c:36: undefined 
reference to `__libc_errno'
collect2: error: ld returned 1 exit status
../Rules:154: recipe for target 
'/home/fweimer/src/gnu/glibc/build/elf/tst-tlsalign-extern' failed

The apparent cause is that the second object file for the test was built 
against internal glibc headers.

The incorrect make rule for the elf/tst-tlsalign-vars.o target is 
created by o-iterator.mk.  I have not been able to figure out which of 
the inclusions triggered this.

Is there a quick fix for this?

Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-errno-from-test.diff
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160412/0f699f1f/attachment.bin>


More information about the Libc-alpha mailing list