Issue 1648890: HP-UX: ld -Wl,+b... (original) (raw)
On HP-UX 11.* (here: 11.23), configure chooses "ld -b" for extension modules like unicodedata.so.
My $LDFLAGS contains instructions like "-Wl,+b
distutils compiles the extension modules with "cc" (I need to use the native compiler), then it links with
ld -b $(LDFLAGS) -I.... ...
These means that options like -Wl, and -I are passed to the linker!
To solve this problem quickly, I propose to modify configure. If LDSHARED="cc -b", Python 2.5 compiles.
Though this works very godd with with current HP-UX compilers, it does not work with ancient HP-UX compiler suites. Maybe there should be a test in configure in order to see if LDSHARED works.
If you really want to support old HP-UX compilers, distutils should not
- pass $LDFLAGS containing "-Wl," to "ld" nor
- call the linker with -I.
This is the current state of the linker call: ld -b -L/usr/local/python/2.5/lib/hpux32 -Wl,+b,/usr/local/python/2.5/lib/hpux32:/usr/local/devel/readline/5.1-static/lib/hpux32:/usr/local/ssl/lib:/usr/local/devel/bzip-1.0.3/lib/hpux32:/usr/local/devel/berkeleydb/4.3.29-static/lib:/usr/local/lib/hpux32 -L/usr/local/devel/readline/5.1-static/lib/hpux32 -Wl,+b,/usr/local/devel/readline/5.1-static/lib/hpux32:/usr/local/ssl/lib:/usr/local/devel/bzip-1.0.3/lib/hpux32:/usr/local/devel/berkeleydb/4.3.29-static/lib:/usr/local/lib/hpux32 -L/usr/local/ssl/lib -Wl,+b,/usr/local/ssl/lib:/usr/local/devel/bzip-1.0.3/lib/hpux32:/usr/local/devel/berkeleydb/4.3.29-static/lib:/usr/local/lib/hpux32 -L/usr/local/devel/bzip-1.0.3/lib/hpux32 -Wl,+b,/usr/local/devel/bzip-1.0.3/lib/hpux32:/usr/local/devel/berkeleydb/4.3.29-static/lib:/usr/local/lib/hpux32 -L/usr/local/devel/berkeleydb/4.3.29-static/lib -Wl,+b,/usr/local/devel/berkeleydb/4.3.29-static/lib:/usr/local/lib/hpux32 -L/usr/local/lib/hpux32 -Wl,+b,/usr/local/lib/hpux32 -I. -I/soft/python/python-2.5/Python-2.5/Include -I/usr/local/include -I/usr/local/devel/berkeleydb/4.3.29-static/include -I/usr/local/devel/bzip-1.0.3/include -I/usr/local/ssl/include -I/usr/local/devel/readline/5.1-static/include build/temp.hp-ux-B.11.23-ia64-2.5/soft/python/python-2.5/Python-2.5/Modules/readline.o -L/usr/lib/termcap -L/usr/local/python/2.5/lib -L/usr/local/lib -lreadline -o build/lib.hp-ux-B.11.23-ia64-2.5/readline.so