Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

complie and runtime problem with gcc compiler

SOLVED
Go to solution
jackie_siu
Advisor

complie and runtime problem with gcc compiler

hi all,
I encoutered a puzzled problem when i compile and run an old program on a new installed hp-ux machine. Following is the trouble detail:
machine info:
CPU info:
Number of CPUs = 16
Clock speed = 1598 MHz
Bus speed = 533 MT/s
CPUID registers
vendor information = "GenuineIntel"
processor serial number = 0x0000000000000000
processor version info = 0x0000000020010104
architecture revision: 0
processor family: 32 Intel(R) Itanium 2 9100 series
processor model: 1 Intel(R) Itanium 2 9100 series
processor revision: 1 Stepping A1
largest CPUID reg: 4
processor capabilities = 0x0000000000000005
implements long branch: 1
implements 16-byte atomic operations: 1
Bus features
implemented = 0xbdf0000020000000
selected = 0x0020000000000000
Exclusive Bus Cache Line Replacement Enabled

Cache info (per core):
L1 Instruction: size = 16 KB, associativity = 4
L1 Data: size = 16 KB, associativity = 4
L2 Instruction: size = 1024 KB, associativity = 8
L2 Data: size = 256 KB, associativity = 8
L3 Unified: size = 9216 KB, associativity = 9

Memory = 32634 MB (31.869141 GB)

Firmware info:
Firmware revision = 9.048
FP SWA driver revision: 1.18
IPMI is supported on this system.
ERROR: Unable to obtain manageability firmware revision info.

Platform info:
model string = "ia64 hp server rx8640"
machine id number = 7a16ac1c-771e-11dd-a308-d2950179ded4
machine serial number = SGH4830C73

OS info:
sysname = HP-UX
nodename = SRBZ-6
release = B.11.23
version = U (unlimited-user license)
machine = ia64
idnumber = 2048306204
vmunix _release_version:
@(#) $Revision: vmunix: B11.23_LR FLAVOR=perf Fri Aug 29 22:35:38 PDT 2003 $

useful env info:
MANPATH=/opt/VRTS/vxfs4.1/man:/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/man/%L:/usr/local/man:/opt/graphics/common/man:/opt/ignite/share/man/%L:/opt/ignite/share/man:/opt/ldapux/share/man:/opt/ldapux/ypldapd/man:/opt/ipf/man:/opt/cifsclient/share/man:/opt/openssl/man:/opt/openssl/prngd/man:/opt/wbem/share/man:/opt/amgr/man:/opt/amgr/man/%L:/usr/dt/share/man:/opt/samba/man:/opt/samba/WTEC_Support_Tools/man:/opt/resmon/share/man/%L:/opt/resmon/share/man:/opt/perf/man/%L:/opt/perf/man:/opt/prm/man/%L:/opt/prm/man:/opt/gwlm/man/%L:/opt/gwlm/man:/opt/sec_mgmt/share/man:/opt/dsau/man:/opt/gnome/man:/opt/VRTS/man:/opt/perl_32/man:/opt/perl_64/man:/opt/swa/share/man/%L:/opt/swa/share/man:/opt/ssh/share/man:/opt/drd/share/man/%L:/opt/drd/share/man:/opt/sfmdb/pgsql/man:/opt/sfm/share/man:/opt/aCC/share/man/%L:/opt/aCC/share/man:/opt/audio/share/man:/opt/langtools/share/man/%L:/opt/langtools/share/man:/opt/caliper/man/%L:/opt/caliper/man:/opt/cadvise/share/man/%L:/opt/cadvise/share/man:/opt/image/share/man:/opt/sentinel/man/%L:/opt/sentinel/man:/opt/imake/man:/opt/EMCpower/share:/opt/hp-gcc/man
SHLIB_PATH=/usr/lib:/usr/local/lib:/usr/lib/hpux64:/u01/app/lib:/opt/hp-gcc-4.0.4/lib:/opt/hp-gcc-4.0.4/lib/hpux64:/oracle/ora/lib:/oracle/ora/lib32
BILLINGROOT=/develop/bill
PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/usr/contrib/kwdb/bin:/usr/bin/X11:/opt/graphics/common/bin:/opt/upgrade/bin:/opt/ipf/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/resmon/bin:/opt/perf/bin:/opt/prm/bin:/opt/hpsmh/bin:/opt/gwlm/bin:/opt/gvsd/bin:/opt/sas/bin:/opt/sec_mgmt/bastille/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/firefox:/opt/gnome/bin:/opt/ignite/bin:/opt/mozilla:/opt/perl_32/bin:/opt/perl_64/bin:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/swa/bin:/opt/thunderbird:/opt/drd/bin:/opt/sfm/bin:/opt/aCC/bin:/opt/caliper/bin:/opt/cadvise/bin:/opt/sentinel/bin:/opt/langtools/bin:/usr/contrib/bin/X11:/opt/hp-gcc/bin:/develop/bill/bin:/oracle/app/oracle/product/10.2.0/db_2/bin:/opt/aCC/bin:/opt/langtools/bin:/usr/local/bin:/opt/java1.4:.:/develop/bill/bin:/oracle/app/oracle/product/10.2.0/db_2/bin:/opt/aCC/bin:/opt/langtools/bin:/usr/local/bin:/opt/java1.4:.
NLS_LANG=american_america.zhs16gbk
EDITOR=vi
ORACLE_SID=radb
ERASE=^H
ORA_NLS10=/oracle/app/oracle/product/10.2.0/db_2/nls/data
SHELL=/usr/bin/ksh
LD_LIBRARY_PATH=/oracle/app/oracle/product/10.2.0/db_2/lib:ORACLE_HOME/rdbms/lib:/oracle/app/oracle/product/10.2.0/db_2/network/lib:/develop/bill/apps/dll:/usr/lib:/usr/local/lib:/develop/bill/apps/lib/com:/develop/bill/apps/lib/favor_part:/opt/hp-gcc-4.0.4/lib:/opt/hp-gcc-4.0.4/lib/hpux64
TERM=vt100
ORACLE_HOME=/oracle/app/oracle/product/10.2.0/db_2
PWD=/opt/aCC/include
TZ=EAT-8
LINES=53

compiler info:
software_spec GNU_C_C++,l=/opt/hp-gcc-4.0.4,r=4.0.4,v=HP
install_source SRBZ-6:/develop/gcc-ia64-4.0.4.depot
directory /opt/hp-gcc-4.0.4
location /opt/hp-gcc-4.0.4

complie error info:

gcc -mlp64 -o recordtodb recordtodb.o /develop/bill/repository/obj/login.o /develop/bill/repository/obj/stdafx.o /develop/bill/repository/obj/cast5.o /develop/bill/repository/obj/cast5box.o /develop/bill/repository/obj/basicfunc.o /develop/bill/repository/obj/md5.o public.o -lxnet -L/oracle/app/oracle/product/10.2.0/db_2/lib/ -L/develop/bill/repository/obj/ -lclntsh -lm -lstream -lstdc++
ld: (Warning) Unsatisfied symbol "_stream_rmutex" in file /lib/hpux64/libstream.so
ld: (Warning) Potential unresolved symbol "__udivdi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.0.4/lib/gcc/ia64-hp-hpux11.23/4.0.4/hpux64/libgcc.a[__udivdi3.o]".
ld: (Warning) Potential unresolved symbol "__udivsi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.0.4/lib/gcc/ia64-hp-hpux11.23/4.0.4/hpux64/libgcc.a[__udivsi3.o]".
ld: (Warning) Potential unresolved symbol "__divdi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.0.4/lib/gcc/ia64-hp-hpux11.23/4.0.4/hpux64/libgcc.a[__divdi3.o]".
ld: (Warning) Potential unresolved symbol "__divsi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.0.4/lib/gcc/ia64-hp-hpux11.23/4.0.4/hpux64/libgcc.a[__divsi3.o]".
ld: (Warning) Unsatisfied symbol "_cstreams_rmutex" in file /lib/hpux64/libstream.so
ld: (Warning) Unsatisfied symbol "__cxa_finalize" in file /lib/hpux64/libstream.so
ld: (Warning) Unsatisfied symbol "__cxa_atexit" in file /lib/hpux64/libstream.so
ld: (Warning) Unsatisfied symbol "__cxa_personality_routine" in file /lib/hpux64/libstream.so
9 warnings.

run error info:
/usr/lib/hpux64/dld.so: Unsatisfied code symbol '__cxa_personality_routine' in load module '/usr/lib/hpux64/libstream.so.1'.
/usr/lib/hpux64/dld.so: Unsatisfied data symbol '_cstreams_rmutex' in load module '/usr/lib/hpux64/libstream.so.1'.
/usr/lib/hpux64/dld.so: Unsatisfied data symbol '_stream_rmutex' in load module '/usr/lib/hpux64/libstream.so.1'.
Killed


that's all.


how to solve this problem?

5 REPLIES
Steven E. Protter
Exalted Contributor

Re: complie and runtime problem with gcc compiler

Shalom,

This seems likely a problem with the code itself.

Also insure that HP-UX 64 bit libraries are installed, present and on the SHLIB_PATH and other library path environment variables.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
jackie_siu
Advisor

Re: complie and runtime problem with gcc compiler

Steven,
thanks for your reply. But I don't think the problem is generated from original code,because I have runned the code for about 2 years at other machine(same hp-ux version). and I assure that the 64-bit libraries has been installed. I have compared the shlib_path configuration of the new machine with the old ones, and didn't find any difference. So I don't think the resolution you provide can resolve my trouble.
Dennis Handly
Acclaimed Contributor
Solution

Re: complie and runtime problem with gcc compiler

What you are doing is illegal. You can't mix g++ with aC++ code, remove -lstream.

You also must compile and link with g++, not gcc. Remove -lstdc++.

This warning is scary but it doesn't say where the problem is:
ld: (Warning) Potential unresolved symbol "__udivdi3": shared library reference is resolved to non-exported definition in file __udivdi3.o".
jackie_siu
Advisor

Re: complie and runtime problem with gcc compiler

Thanks a lot, Dennis. I have got the correct result.
Highlighted
jackie_siu
Advisor

Re: complie and runtime problem with gcc compiler

change the compiler option from gcc to g++ and remove -lstream & -lstdc++. and that works.