Operating System - HP-UX
1752790 Members
6274 Online
108789 Solutions
New Discussion юеВ

Re: Need help compiling cobol program

 
Ken Mueller
Advisor

Need help compiling cobol program

Hi All,
I'm trying to compile a program using a script from an old PARISC machine. The new machine is 11.31.
Here's the comand:
cob -o $DC_BIN/DCRTSORA -xe "" $DC_BIN/dcsaddr.o \
$DC_BIN/dcspos.o \
$DC_BIN/trmout.o \
-l:libpthread.so \
$ORACLE_HOME/precomp/lib/cobsqlintf.o \
-lcurses \
-L $ORACLE_HOME/lib \
-lsqlplus \

here's the output:
ld: Mismatched ABI for -lsqlplus, found /u01/app/oracle/product/11.2.0/dbhome_1/lib/libsqlplus.so
Fatal error.

here's 'file' of that library:
ELF-64 shared object file - IA64

I ran file against all of the preceding objects - they are all ELF64. In other words it does not appear I am mixing 32 and 64 bit libraries.

Any ideas?
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: Need help compiling cobol program

>The new machine is 11.31.

You neglected to mention that it is an Integrity server.

>they are all ELF64. In other words it does not appear I am mixing 32 and 64 bit libraries.

How do you tell cob(1) that you want to create a 64 bit executable? If there is an option you use when compiling, you need it when linking too.
Ken Mueller
Advisor

Re: Need help compiling cobol program

You tell cob which mode by using "cobmode." I've verified it is set to 64. I even changed "cob" to "cob64" at one point to be sure.
I've assumed it was using ld in /usr/sbin for linking and I checked that too to be sure it was 64 bits. Perhaps I will try to verify cob is using that ld.
Ken Mueller
Advisor

Re: Need help compiling cobol program

errr... /usr/sbin should have been /usr/bin.
Anyway, I found only one other ld and it was an old 32-bit PARISC one. Renamed it to ld.old and reran the compile script. Still no luck. I've confirmed that cob is using the 64 bit ld in /usr/bin.
Ken Mueller
Advisor

Re: Need help compiling cobol program

It turns out the first .o was a 32-bit library. I had just missed that somehow.
Dennis Handly
Acclaimed Contributor

Re: Need help compiling cobol program

>I've confirmed that cob is using the 64 bit ld in /usr/bin.

How did you confirm? There is only one ld, it runs in 64 bit mode but produces either 32 or 64 bit. (And ld is in /usr/ccs/bin/.)

And as you found, it bases its bitness on the first file it sees. If cob doesn't have -Wl,-t, you can "export LDOPTS=-t" to see each input file.
Ken Mueller
Advisor

Re: Need help compiling cobol program

There are actually two ld's on our system. One is the "normal" 64 bit version, and then there's a legacy PA ld. I needed to confirm that one wasn't being called somehow.
Dennis Handly
Acclaimed Contributor

Re: Need help compiling cobol program

>There are actually two lds on our system. ... and then there's a legacy PA ld.

Ah, right but actually three. /usr/ccs/pa/usr/ccs/bin/ld invokes either ld32 or ld64.
Ken Mueller
Advisor

Re: Need help compiling cobol program

Yes indeed. Can you tell I'm new to the mixed architecture? It's making for some challenging work.