- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HOWTO compile shared C-libraries (e.g libpng) with...
Operating System - HP-UX
1752772
Members
4826
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2003 05:50 PM
тАО11-10-2003 05:50 PM
HOWTO compile shared C-libraries (e.g libpng) with gcc that do not depend on libgcc anymore
I tried to compile perl 5.8.1 and 5.8.2 on hp-ux 11.23 with gcc 3.3.1/2 what failed like this
cp op.c opmini.c
`sh cflags "optimize='-O3'" opmini.o` -fPIC -DPERL_EXTERNAL_GLOB opmini.c
CCCMD = gcc -DPERL_CORE -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -fno-strict-aliasing -I/opt/mfgd
ep/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -Wall
rm -f opmini.c
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 gcc -L/opt/mfgdep/lib/hpux32 -L/usr/lib/hpux32 -o miniperl \
miniperlmain.o opmini.o -L /usr/local/src/perl-5.8.2 -Wl,+s -Wl,+b/opt/mfgperl/lib/5.8.2/IA64.ARCHREV_0-thread-multi/COR
E -lperl -lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 ./miniperl -w -Ilib -MExporter -e '' || gmake minitest
/bin/sh: 13992 Memory fault(coredump)
gmake[1]: Entering directory `/usr/local/src/perl-5.8.2'
cp ext/re/re.pm ext/re/re.tmp && sh mv-if-diff ext/re/re.tmp lib/re.pm
gmake[2]: Entering directory `/usr/local/src/perl-5.8.2'
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 ./miniperl -Ilib configpm configpm.tmp
/bin/sh: 14003 Memory fault(coredump)
gmake[2]: *** [lib/Config.pm] Error 139
gmake[2]: Leaving directory `/usr/local/src/perl-5.8.2'
gmake[1]: [minitest] Error 2 (ignored)
Turning down optimization does not have any effect.
So I tried to compile perl with HP's ansic and perl itself was built ok. But all the supporting libs I have previously compiled with gcc (zlib, gdbm, jpeg-6, libpng, ...) seem to depend on gcc's libgcc. Building the perl extension modules results in error messages like: 'unresoled symbol __uudiv in ...' which is defined in libgcc.
How do to I tell gcc to compile all the libgcc stuff in the shared libraries themselves that I do not have to distribute libgcc on every machine I install the compiled packages on and ansic does not complain about missing symbols anymore?
By the way: gcc was compiled with:
configure --disable-nls --enable-threads=posix --enable-shared --enable-languages=c,
c++,objc --with-gnu-as --with-as=/usr/local/bin/as --prefix=/usr/local
Kind regards,
Lars
cp op.c opmini.c
`sh cflags "optimize='-O3'" opmini.o` -fPIC -DPERL_EXTERNAL_GLOB opmini.c
CCCMD = gcc -DPERL_CORE -c -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -fno-strict-aliasing -I/opt/mfgd
ep/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -Wall
rm -f opmini.c
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 gcc -L/opt/mfgdep/lib/hpux32 -L/usr/lib/hpux32 -o miniperl \
miniperlmain.o opmini.o -L /usr/local/src/perl-5.8.2 -Wl,+s -Wl,+b/opt/mfgperl/lib/5.8.2/IA64.ARCHREV_0-thread-multi/COR
E -lperl -lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 ./miniperl -w -Ilib -MExporter -e '' || gmake minitest
/bin/sh: 13992 Memory fault(coredump)
gmake[1]: Entering directory `/usr/local/src/perl-5.8.2'
cp ext/re/re.pm ext/re/re.tmp && sh mv-if-diff ext/re/re.tmp lib/re.pm
gmake[2]: Entering directory `/usr/local/src/perl-5.8.2'
LD_LIBRARY_PATH=/usr/local/src/perl-5.8.2 ./miniperl -Ilib configpm configpm.tmp
/bin/sh: 14003 Memory fault(coredump)
gmake[2]: *** [lib/Config.pm] Error 139
gmake[2]: Leaving directory `/usr/local/src/perl-5.8.2'
gmake[1]: [minitest] Error 2 (ignored)
Turning down optimization does not have any effect.
So I tried to compile perl with HP's ansic and perl itself was built ok. But all the supporting libs I have previously compiled with gcc (zlib, gdbm, jpeg-6, libpng, ...) seem to depend on gcc's libgcc. Building the perl extension modules results in error messages like: 'unresoled symbol __uudiv in ...' which is defined in libgcc.
How do to I tell gcc to compile all the libgcc stuff in the shared libraries themselves that I do not have to distribute libgcc on every machine I install the compiled packages on and ansic does not complain about missing symbols anymore?
By the way: gcc was compiled with:
configure --disable-nls --enable-threads=posix --enable-shared --enable-languages=c,
c++,objc --with-gnu-as --with-as=/usr/local/bin/as --prefix=/usr/local
Kind regards,
Lars
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-11-2003 05:28 PM
тАО11-11-2003 05:28 PM
Re: HOWTO compile shared C-libraries (e.g libpng) with gcc that do not depend on libgcc anymore
I think a recompile with adding the object files from libgcc.a to your module could solve your problem, if libgcc.a contains the real functions.
As for the libgcc you need to distribute: it would only be the .sl file you need to distribute...
Also remember you have to run 'CC= perl Makefile.pl' again for the modules you previously compiled with gcc to use the other compiler, because some of the compile options are different for the two compilers.
As for the libgcc you need to distribute: it would only be the .sl file you need to distribute...
Also remember you have to run 'CC=
Every problem has at least one solution. Only some solutions are harder to find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2003 01:02 AM
тАО11-13-2003 01:02 AM
Re: HOWTO compile shared C-libraries (e.g libpng) with gcc that do not depend on libgcc anymore
Thanks Elmar,
You are right. That this is a workaround, but I don't like it. Libtool, which is used by most libraries, does not work with a libgcc.a when you want to build the latter. Many of the libraries use libtool which does not seem to be smart enough to compile with a libgcc.a. To get around that, you have to rerun the ld command libtool produces with the manual addition of -L/usr/local/lib/gcc-lib/ia64.../3.3.2 -lgcc.
I have to support more OSes and think there is too much fiddeling involved. Do you or anyone else have another idea?
You are right. That this is a workaround, but I don't like it. Libtool, which is used by most libraries, does not work with a libgcc.a when you want to build the latter. Many of the libraries use libtool which does not seem to be smart enough to compile with a libgcc.a. To get around that, you have to rerun the ld command libtool produces with the manual addition of -L/usr/local/lib/gcc-lib/ia64.../3.3.2 -lgcc.
I have to support more OSes and think there is too much fiddeling involved. Do you or anyone else have another idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2003 12:43 AM
тАО11-14-2003 12:43 AM
Re: HOWTO compile shared C-libraries (e.g libpng) with gcc that do not depend on libgcc anymore
I don't have the possibility to check right now, but doesn't libtool support some environment variable containing its library paths?
Another option would be to run libtool with --mode link -R
Another option would be to run libtool with --mode link -R
Every problem has at least one solution. Only some solutions are harder to find.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP