This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: building shared libs with g++ 2.95.2 on HP-UX 11


On Sep  9, 2000, Martin Sebor <sebor@roguewave.com> wrote:

> $ echo "void foo () { }" > t.cpp ; gcc -c -fPIC t.cpp && gcc t.o -shared
> -o libt.sl
> /usr/bin/ld: DP relative code in file /var/tmp/ccyhoDuR.o - shared
> library must be position
>     independent.  Use +z or +Z to recompile.

Use -fPIC when linking too, so that the C file implicitly compiled by
collect is compiled with -fPIC too.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]