[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"
New submission from Funda Wang : gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.6 -lpthread -ldl -lutil -lm build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/_ctypes_test.o: In function `my_sqrt': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/_ctypes_test.c:83: undefined reference to `sqrt' collect2: ld returned 1 exit status build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ audioop.o: In function `audioop_rms': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/audioop.c:419: undefined reference to `sqrt' collect2: ld returned 1 exit status build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ dlmodule.o: In function `dl_open': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:187: undefined reference to `dlopen' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:189: undefined reference to `dlerror' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ dlmodule.o: In function `dl_close': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:49: undefined reference to `dlclose' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ dlmodule.o: In function `dl_sym': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:68: undefined reference to `dlsym' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ dlmodule.o: In function `dl_call': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:96: undefined reference to `dlsym' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:100: undefined reference to `dlerror' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ dlmodule.o: In function `dl_dealloc': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/dlmodule.c:41: undefined reference to `dlclose' collect2: ld returned 1 exit status build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/_ctypes.o: In function `CDataType_in_dll': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/_ctypes.c:600: undefined reference to `dlsym' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/_ctypes.c:608: undefined reference to `dlerror' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/_ctypes.o: In function `CFuncPtr_FromDll': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/_ctypes.c:3285: undefined reference to `dlsym' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/_ctypes.c:3293: undefined reference to `dlerror' /usr/bin/ld: Dwarf Error: Offset (2614) greater than or equal to .debug_str size (815). build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/callproc.o: In function `py_dl_sym': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1448: undefined reference to `dlsym' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1451: undefined reference to `dlerror' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/callproc.o: In function `py_dl_close': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1430: undefined reference to `dlclose' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1432: undefined reference to `dlerror' build/temp.linux-i686-2.6/home/fwang/rpm/BUILD/Python-2.6.2/Modules/ _ctypes/callproc.o: In function `py_dl_open': /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1412: undefined reference to `dlopen' /home/fwang/rpm/BUILD/Python-2.6.2/Modules/_ctypes/callproc.c:1414: undefined reference to `dlerror' collect2: ld returned 1 exit status Failed to find the necessary bits to build these modules: bsddb185 sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _ctypes_ctypes_test audioop dl I've attached the detail build log. -- components: Build files: build.0.20090608003719.log.bz2 messages: 89066 nosy: fundawang severity: normal status: open title: Build errors when using LDFLAGS="-Wl,--no-undefined" type: compile error versions: Python 2.6 Added file: http://bugs.python.org/file14224/build.0.20090608003719.log.bz2 ___ Python tracker <http://bugs.python.org/issue6237> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"
Funda Wang added the comment: Regarding python binary target, the actual command when linking is: gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -LL. -lpython2.6 -lpthread -ldl -lutil -lm The linking order is wrong. "-lstdc++" is LIBADD, it should appear after OBJECTS such as Modules/python.o. The same applies to -pthread. The command should looks like: gcc -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Xlinker -export- dynamic -o python \ Modules/python.o \ -LL. -lpython2.6 -lpthread -ldl -lutil -lm -lstdc++ -- ___ Python tracker <http://bugs.python.org/issue6237> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"
Funda Wang added the comment: How is this issue going? -- ___ Python tracker <http://bugs.python.org/issue6237> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com