Created attachment 405952 [details] build.log for sys-boot/efibootmgr-0.12 built against our current sys-libs/efivar-0.20 This new efivar version's libefivar is not usable by consumers like efibootmgr since it doesn't link in libdl. Upstream bug has some more info and a fix. I tested by simply injecting -ldl into LDFLAGS on command-line and it seems to build a usable libefivar, enough for efibootmgr to build against it. The bug is in efivar but I've attached a build.log from efibootmgr which shows the problem. Upstream bug has more info & a patch. Thanks!
I had no issues building it.
Is your libefivar.so.0 linked to libdl.so.2? Mine isn't, until I apply the LDFLAGS fix. default/broken sys-libs/efivar build, makes efibootmgr build fail: # ldd /usr/lib64/libefivar.so.0 linux-vdso.so.1 (0x00007ffe74570000) libc.so.6 => /lib64/libc.so.6 (0x00007ff83f9e9000) /lib64/ld-linux-x86-64.so.2 (0x0000557b5c920000) # with -ldl fix, this one does allow efibootmgr to build: # ldd /usr/lib64/libefivar.so.0 linux-vdso.so.1 (0x00007ffeccb9c000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f753237e000) libc.so.6 => /lib64/libc.so.6 (0x00007f7531fe1000) /lib64/ld-linux-x86-64.so.2 (0x0000555d2a00e000) #
(In reply to Ben Kohler from comment #2) > Is your libefivar.so.0 linked to libdl.so.2? Mine isn't, until I apply the > LDFLAGS fix. libefivar.so.0 is not linked against libdl.so.2. However efibootmgr still successfully builds/runs. It's probably some difference in my toolchain that isn't catching the underlinking. binutils-2.25-r1 gcc-5.0.0-alpha20150616 glibc-2.20-r2 I also note that my linker command contains -lefivar twice (once for efivar.pc, once for efiboot.pc), whereas yours only lists it once. x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -frecord-gcc-switches -DEFIBOOTMGR_VERSION=\"0.12\" -Wsign-compare -Wall -g -D_FILE_OFFSET_BITS=64 -I/usr/include/efivar -Isrc/lib -Isrc/include -Wl,-O1 -Wl,--as-needed src/efibootmgr/efibootmgr.c src/lib/efi.o src/lib/unparse_path.o -ldl -lefivar -ldl -lefivar -lefiboot -o src/efibootmgr/efibootmgr
Actually, can you provide the output of pkg-config --libs efivar efiboot ? I suspect that's the difference between our systems. -ldl -lefivar -ldl -lefivar -lefiboot
Created attachment 405958 [details] emerge --info # pkg-config --libs efivar -ldl -lefivar #
I don't pretend to understand these toolchain subtleties, but upstream's bug report links to this ubuntu doc relating to direct linking, it seems relevant: https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition Your setup seems to be OK with the indirect linking, mine does not.
I can reproduce the build failure after switching to dev-util/pkgconf. With dev-util/pkgconfig: pkg-config --libs efivar efiboot -ldl -lefivar -ldl -lefivar -lefiboot With dev-util/pkgconf: pkg-config --libs efivar efiboot -ldl -lefivar -lefiboot Building with dev-util/pkgconfig succeeds because -ldl appears after -lefivar on the linker command. pkgconf is de-duping the linker flags, which breaks the efibootmgr build. I think the patch provided in the efivar upstream bug is still correct, but at least this explains the odd behavior we are seeing.
Working on a proper fix upstream for this. https://github.com/rhinstaller/efivar/pull/26
I also reported the pkgconf behavior. https://github.com/pkgconf/pkgconf/issues/78
Fixed in efivar-0.21.