Operating System - HP-UX
1752648 Members
5710 Online
108788 Solutions
New Discussion юеВ

a library with debugging information is working fine but without that is not working.

 
SOLVED
Go to solution
ankur saxena
Occasional Advisor

a library with debugging information is working fine but without that is not working.

i build a library with debugging information and used , its works fine.
when i build that with out debugging information it soesnt work.
the thing is i am using optimization Level 3 for compiling. when we build with debugging info the optimization level is decreased to 2 . may b that removes some of the symbols.
But when i built that with +O2 that still didnt work.
the compiulation string i m using is
+O2 +Oconservative +Ovolatile +Onofail_safe +Ofastaccess +Onopipeline +ESlit
13 REPLIES 13
Vibhor Kumar Agarwal
Esteemed Contributor

Re: a library with debugging information is working fine but without that is not working.

Can you give us the error.
Vibhor Kumar Agarwal
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hello,

Is it a shared library or archive ? What error message you get when it loads ? Try to give more information possible,

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

how did you compile for debugging information? (Flags).

what is the error message you are getting when using that library? Change optimization level to 3 as +03 and compile with debug symbols.

check symbols information with odump or elfdump.

--
Muthu
Easy to suggest when don't know about the problem!
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

the problem is not coming at loading the library. its coming at the time of call of some functions.
whats happenening is when we are compiling with -g option some extra symbols are coming as compared with the compilation without -g symbols. Means it is removing some symbols at compilation with +O3 flag. and at run time those symbols are required.
only core dump is coming during execution of the program.
since it is very big project its difficult to track the exact point of failure.
can anyone suggest me the probable reasons whic can lead to such type of errors?
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hello,

Tyr running your application with "tusc" to find out where exactly it core dumps. "tusc" can be downloaded from,
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/

-Arun
P.S Remember to assign points.
"A ship in the harbor is safe, but that is not what ships are built for"
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

cc -c -Ae +O3 +Oconservative +Ovolatile +Onofail_safe +Ofastaccess +Onopipeline +ESlit -D_HP
UX_SOURCE -DHP -DSYSV -DCDF -DUNIX -DTND -D__HP_NO_STRING_OVERLOADS -DB1000 +DAportable

this s the compile string

ld -b -o ../lib/libpig.sl cachain.o cactime.o caulic.o camsgf.o dbgwrite.o casig.o castring.o CAgetenv.o catrans.o catstenv.o capstat.o capstats.o caimsgv.o caimsgio.o calic.o liccciem.o cad.o CAchmod.o CAget_tty.o enf_exists.o SIGNAL.o casetusr.o ca_hostname.o casrcpth.o caddcpath.o execgenrs.o pwcrypt.o ca_nodename.o ca_nodename_has.o caprof.o structpk.o caregex.o cauwvapi.o sdsapi.o cauwvsaf.o cauwvsds.o casystype.o quehlp.o cawcmbcn.o ufcmpcnv.o match.o calocale.o cmlocale.o caping.o camfunc.o dynlib.o chkemcci.o loaddll2.o cauemevt_ldr.o cauopr_ldr.o -lnsl -lpthread -ldld -lm -lcrypt -L/opt/CA/CAlib -lccimt -lenf


THIS IS THE BUILD STRING.
Arunvijai_4
Honored Contributor
Solution

Re: a library with debugging information is working fine but without that is not working.

Hello,

One more thing, have you applied all necessary latest pathces related to compiler and linker ? Probably, this could be due to a known bug with +O3. You can download patches from, http://www1.itrc.hp.com/service/patch/search.do?BC=patch.breadcrumb.main|&pageContextName=hpux:::

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

i found a segment of code in a c file.
in the C program a function call is there.
the definition of the called is in different library.
there is no conditional check to execute that function call (means taht statement has to be executed always).
on compilation with -g option that symbol is there in its object file but on compiling without -g option the symbol is not found in that object file. i used nm to do that.
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

Arun,
can you please help me in finding out the patch for the +O3 problem. i tried the making the hostname.fs file on my system and uploaded that on the site. there are atoo many patches coming .so what to apply here.?
i am attaching the hostname.fs file here.
please help me.