[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix compilation with -Wl,--as-needed
From: |
Thomas de Grenier de Latour |
Subject: |
Fix compilation with -Wl,--as-needed |
Date: |
Sun, 14 May 2006 15:13:14 +0200 |
Parted doesn't compile with LDFLAGS="-Wl,--as-needed", because
libparted.so is not linked to libdl, and thus has unresolved symbols.
mkdir .libs
gcc -D_REENTRANT -D_FILE_OFFSET_BITS=64
-DLOCALEDIR=\"/usr/local/share/locale\"
-DLOCALEDIR=\"/usr/local/share/locale\" -W -Wall -Wno-unused
-Wno-switch -Wno-format -Werror -Wl,--as-needed -o .libs/partprobe
partprobe.o ../libparted/.libs/libparted.so -luuid -lreadline -ldl
-lncurses ../libparted/.libs/libparted.so: undefined reference to
`dlerror' ../libparted/.libs/libparted.so: undefined reference to
`dlclose' ../libparted/.libs/libparted.so: undefined reference to
`dlopen' ../libparted/.libs/libparted.so: undefined reference to
`dlsym'
collect2: ld returned 1 exit status
make[2]: *** [partprobe] Erreur 1
make[2]: quittant le répertoire « /tmp/parted/partprobe »
This also breaks compilation of other tools (qparted/gparted) with this
linker flag. See this Gentoo bug report:
https://bugs.gentoo.org/show_bug.cgi?id=131841
The attached patch (for today trunk) fixes that by adding the -ldl to
libparted_LIBADD.
--
TGL.
parted-as-needed.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Fix compilation with -Wl,--as-needed,
Thomas de Grenier de Latour <=