[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Failure building .so on HP-UX 11.00 + cc
From: |
Daniel Richard G. |
Subject: |
Failure building .so on HP-UX 11.00 + cc |
Date: |
Fri, 2 Jun 2006 14:07:15 -0400 |
Working on an HP-UX/PA-RISC 11.00 system, with the native compiler:
$ uname -a
HP-UX hrdygrdy B.11.00 A 9000/785 2003934647 two-user license
$ which cc
/opt/ansic/bin/cc
$ cc -V -c hello.c -o hello
cpp.ansi: HP92453-01 A.11.01.20 HP C Preprocessor (ANSI)
ccom: HP92453-01 A.11.01.20 HP C Compiler
/usr/ccs/bin/ld: 92453-07 linker linker ld B.11.13 990903
Tried to build a shared library:
...
/bin/sh ./libtool --tag=CC --mode=link cc -g -o libfoo.la -rpath
/usr/local/lib foo.lo
cc -b -Wl,+h -Wl,libfoo.sl.0 -Wl,+b -Wl,/usr/local/lib -o
.libs/libfoo.sl.0.0 .libs/foo.o -lc
cc: warning 422: Unknown option "b" ignored.
/usr/ccs/bin/ld: Unsatisfied symbols:
main
*** Error exit code 1
cc(1) does not understand the -b option, and is attempting to link the
library as an executable. This problem occurs with both 1.5.22 and CVS
HEAD.
However, if I edit libtool.m4, and make it use the shared-library-link
command designated for HP-UX 10.x, everything works:
...
/bin/sh ./libtool --tag=CC --mode=link cc -g -o libfoo.la -rpath
/usr/local/lib foo.lo
libtool: link: /usr/ccs/bin/ld -b +h libfoo.sl.0 +b /usr/local/lib -o
.libs/libfoo.sl.0.0 .libs/foo.o -lc
libtool: link: (cd ".libs" && ...
Here is the problem: Libtool uses "ld -b" on HP-UX 10.x, and "cc -b" on
HP-UX 11.x. The latter invocation works fine on a separate HP-UX/IA64 11.23
system I have here. But the 11.00 system can only handle "ld -b". The major
version of 11, in itself, does not guarantee that a sufficiently new
version of the compiler is installed.
Something to consider: The "ld -b" syntax also works fine on 11.23. Is
there any benefit to using "cc -b" at all?
I am attaching a patch (against CVS) that shows the one-line edit I made.
It is not a full patch; it addresses only my particular case, and is
intended more as illustration than a real fix.
--Daniel
--
NAME = Daniel Richard G. ## Remember, skunks _\|/_ meef?
EMAIL1 = address@hidden ## don't smell bad--- (/o|o\) /
EMAIL2 = address@hidden ## it's the people who < (^),>
WWW = http://www.******.org/ ## annoy them that do! / \
--
(****** = site not yet online)
libtool-m4.patch
Description: Text document
- Failure building .so on HP-UX 11.00 + cc,
Daniel Richard G. <=