tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ld wrapper and -(no-)whole-archive



Hello,
the newly-commited xentools48 doens't builds after updating pkgsrc, while
it did build fine inside a pkgsrc-2016Q4 tree. It looks like an issue with
the ld wrapper reordering options.
ld is called from the Makefile as:
[*] /home/bouyer/pkgsrc/sysutils/xentools48/work/.wrapper/bin/ld /home/bouyer/pkgsrc/sysutils/xentools48/work/.wrapper/bin/ld -r -d -nostdlib -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/cross-root-x86_64/x86_64-xen-elf/lib -Wl,-melf_x86_64 "-(" /home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/grub-x86_64/main.a -T app.lds "-)" -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/toollog -whole-archive -lxentoollog -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/evtchn -whole-archive -lxenevtchn -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/gnttab -whole-archive -lxengnttab -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/call -whole-archive -lxencall -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/foreignmemory -whole-archive -lxenforeignmemory -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libxc-x86_64 -whole-archive -lxenguest -lxenctrl -no-whole-archive -lpci -lz -lm --undefined main -o /home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/mini-os-x86_64-grub/mini-os_app.o

and the wrapper calls the true ld as:
<.> /usr/bin/ld -r -d -nostdlib -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/cross-root-x86_64/x86_64-xen-elf/lib -melf_x86_64 "-(" /home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/grub-x86_64/main.a -T app.lds "-)" -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/toollog -whole-archive -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/evtchn -whole-archive -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/gnttab -whole-archive -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/call -whole-archive -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libs-x86_64/foreignmemory -whole-archive -no-whole-archive -L/home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/../stubdom/libxc-x86_64 -whole-archive -no-whole-archive --undefined main -o /home/bouyer/pkgsrc/sysutils/xentools48/work/xen-4.8.0/stubdom/mini-os-x86_64-grub/mini-os_app.o -L/home/bouyer/pkgsrc/sysutils/xentools48/work/.buildlink/lib  -lxentoollog -lxenevtchn -lxengnttab -lxencall -lxenforeignmemory -lxenguest -lxenctrl -lpci -lz -lm

as you can see, the wrapper moved all -l<foo> to the end but without
moving the surrounding -whole-archive / -no-whole-archive.
The result is that symbols that should be inclued in this object are not,
and later the final link fails with undefined symbols.

How can we fix this ? Is there a way to disable cwrappers for a package ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index