build of capisuite-0.4.5-r4 fails when "-Wl,--as-needed" is set in LDFLAGS with following error: i686-pc-linux-gnu-g++ -march=athlon-xp -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,now -L/usr/lib/python2.4/config -Xlinker -export-dynamic -o capisuite main.o application/libccapplication.a modules/libccmodules.a backend/libccbackend.a -lpthread -lcapi20 -lpthread -ldl -lutil -lm -lpython2.4 /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_tmpnam': (.text+0x93e): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp' /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_tempnam': (.text+0xa2a): warning: the use of `tempnam' is dangerous, better use `mkstemp' /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc': (.text+0x136): undefined reference to `dlsym' /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc': (.text+0x1a6): undefined reference to `dlopen' /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc': (.text+0x1d4): undefined reference to `dlsym' /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc': (.text+0x248): undefined reference to `dlerror' /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_forkpty': (.text+0x3439): undefined reference to `forkpty' /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_openpty': (.text+0x34c8): undefined reference to `openpty' collect2: ld gab 1 als Ende-Status zurück make[3]: *** [capisuite] Fehler 1 make[3]: Leaving directory `/home/videos/portage/net-dialup/capisuite-0.4.5-r4/work/capisuite-0.4.5/src' make[2]: *** [all-recursive] Fehler 1 make[2]: Leaving directory `/home/videos/portage/net-dialup/capisuite-0.4.5-r4/work/capisuite-0.4.5/src' make[1]: *** [all-recursive] Fehler 1 make[1]: Leaving directory `/home/videos/portage/net-dialup/capisuite-0.4.5-r4/work/capisuite-0.4.5' make: *** [all] Fehler 2 The problem is the ordering of the needed libs to be linked when linking libpython-2.4. wrong oder: -lpthread -ldl -lutil -lm -lpython2.4 right order: -lpython2.4 -lm -lpthread -ldl -lutil the attached patch changes the ordering of these libs in the acinclude.m4 file. Reproducible: Always
Created attachment 126729 [details, diff] correct link oder of needed libs when linking libpython-2.4
Fixed in cvs, thanks!