This is the mail archive of the gcc@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]
Other format: [Raw text]

unexpected link behaviour g++-4.0.1 on hppa2.0w-hp-hpux11.00


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I got an unexpected link behaviour linking statically.

linking dynamically:

g++ -Wall -g0 -O3 -o batch_mesh_1 batch_mesh_1.o
- -L/raid/tecosim/it/devel/install-test/hp/lib -ltecosim -lteclic

everything works fine and ldd batch_mesh_1 gives:
         =>
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libm.2 =>      /usr/lib/libm.2


linking statically:

g++ -Wall -g0 -O3 -static -o batch_mesh_1 batch_mesh_1.o
- -L/raid/tecosim/it/devel/install-test/hp/lib -ltecosim -lteclic
/usr/ccs/bin/ld: Unsatisfied symbols:
   pthread_once (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(locale_init.o))
(code)
   pthread_key_create (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(eh_globals.o))
(code)
   pthread_setspecific (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(eh_globals.o))
(code)
   pthread_mutex_unlock (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(locale_init.o))
(code)
   pthread_getspecific (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(eh_globals.o))
(code)
   pthread_mutex_lock (first referenced in
/appl/shared/gcc/HP-UX/hppa2.0w-hp-hpux11.00/gcc-4.0.1-test/lib/libstdc++.a(locale_init.o))
(code)

Here I have to add -lpthread manually, then the link succeeds:
g++ -Wall -g0 -O3 -static -o batch_mesh_1 batch_mesh_1.o
- -L/raid/tecosim/it/devel/install-test/hp/lib -ltecosim -lteclic -lpthread

and ldd batch_mesh_1 gives:
         =>
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2
        /usr/lib/libc.2 =>      /usr/lib/libc.2
        /usr/lib/libdld.2 =>    /usr/lib/libdld.2


Compiler version: 4.0.1
Platform: hppa2.0w-hp-hpux11.00
configure flags:
- --prefix=/SCRATCH/gcc-build/HP-UX/hppa2.0w-hp-hpux11.00/install
- --with-gnu-as
- --with-as=/SCRATCH/gcc-build/HP-UX/hppa2.0w-hp-hpux11.00/install/bin/as
- --with-ld=/usr/ccs/bin/ld --enable-threads=posix --disable-shared
- --disable-nls --with-gmp=/appl/shared/gnu/HP-UX/hppa2.0w-hp-hpux11.00
- --with-mpfr=/appl/shared/gnu/HP-UX/hppa2.0w-hp-hpux11.00
- --enable-languages=c,c++,f95,java,objc

binutils:
binutils-2.16.1

System:
HP-UX c3600-1 B.11.00 A 9000/785 unknown unknown HP-UX

Any comments?

Rainer

- --
Rainer Emrich
TECOSIM GmbH
Im Eichsfeld 3
65428 Rüsselsheim

Phone: +49(0)6142/8272 12
Mobile: +49(0)163/56 949 20
Fax.:   +49(0)6142/8272 49
Web: www.tecosim.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDHwok3s6elE6CYeURAogtAJ4zfKEHiiH76r6cxklU9W3B9qTXKACeIwfV
Xs4bUs5z3m9vvJMapqlgmjA=
=jp8S
-----END PGP SIGNATURE-----


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