gcc 2.95 can't make shared objects on HP-UX 11?

Roland Roberts rroberts@muller.com
Fri Oct 1 00:00:00 GMT 1999


I'm trying to build readling 4.0 on HP-UX 11.00 with gcc 2.95.  gcc was
configured to used gas and the native ld.  At link time, I get the
following messages

gcc -shared -Wl,-b -Wl,+s -Wl,+h,libreadline.sl.4 -Wl,+b,/usr/local/pkg/readline-4.0/lib -o libreadline.sl.4 readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so nls.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so tilde.so 
/bin/ld: DP relative code in file /var/tmp/cc0bdEbU.o - shared library must be position
    independent.  Use +z or +Z to recompile.
collect2: ld returned 1 exit status

The +z or +Z is the HP ANSI C compiler flage for -fpic.

Here is an example of a compile line while building readline; I've also
tried building with -fPIC instead of -fpic.

gcc -c -DHAVE_CONFIG_H   -I. -I.. -I.. -I -DRL_LIBRARY_VERSION='"4.0"' -g -O -fpic -o vi_mode.o ../vi_mode.c

What do I need to do to build shared libs on HP-UX 11?

roland
-- 
	      Roland B Roberts, PhD; rroberts@muller.com
     Muller Data Corp, 395 Hudson Avenue, New York, NY 10014 USA
		 Tel: 212 807-5143; Fax: 212 989-7193



More information about the Gcc-help mailing list