Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Building 32bit shared library on 64bit HP-UX 11.0

Amod Kumbhar
Occasional Visitor

Building 32bit shared library on 64bit HP-UX 11.0

On HP-UX 11.0, we are trying to call external c routine from Oracle PL/SQL
(Oracle 9i - Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit)

For this we are trying to make 32 bit shared library (HPUX 11.0 - 64 bit)
using demo_rdbms32.mk file supplied by oracle. (Reason for going for 32 bit
is that our rest of the application is 32 bit although HP-UX machine is 64 bit)

Should be use any specific switches for building 32 bit shared libraries on
64-bit machine. Request you to advice on this.

Below mentioned are steps which we followed.
----------------------------------------

make -f demo_rdbms32.mk extproc_with_context
SHARED_LIBNAME=exception.sl OBJS="exception.o elimspace.o get_symbol.o ipc.o
secmisc2.o getmbxkey.o secmisc.o secmisc3.o"

IT GIVES ME FOLLOWING ERROR

ld -G /data/app/oracle/product/Oracle9i/lib/libclntsh.sl -b
-L/data/app/oracle/product/Oracle9i/lib
-L/data/app/oracle/product/Oracle9i/lib/
-L/data/app/oracle/product/Oracle9i/rdbms/lib/ -o exception.sl exception.o
elimspace.o get_symbol.o ipc.o secmisc2.o getmbxkey.o secmisc.o secmisc3.o
/data/app/oracle/product/Oracle9i/lib/libpls9.a -lclntsh `cat
/data/app/oracle/product/Oracle9i/lib/sysliblist` -lm
ld: Mismatched ABI (not an ELF file) for exception.o
Fatal error.
*** Error exit code 1

Stop.

Thanks in advance
Vinay Godbole
(Vinay_Godbole@satyam.com)


3 REPLIES
Cheryl Griffin
Honored Contributor

Re: Building 32bit shared library on 64bit HP-UX 11.0

You can use the file command to determine the bit of the library:
# file /data/app/oracle/product/Oracle9i/lib/libpls9.a

A 32 bit library might say:
archive file -PA-RISC1.1 relocatable library

A 64 bit library might say:
ELF-64 shared object file - PA-RISC 2.0 (LP64)


If trying to build the program for 32 bit, make sure the Oracle libraries involved are all 32 bit.

Cheryl
"Downtime is a Crime."
Amod Kumbhar
Occasional Visitor

Re: Building 32bit shared library on 64bit HP-UX 11.0

Thanks for your reply. Oracle9i product on HP-UX is 64-bit. However Oracle allows you to build 32-bit as well as 64-bit applications as they have provided both set of libraries.

Our requirement is that our HP-UX is 64-bit, Oracle9i is 64-bit but our application and dependant programs are 32-bit. Hence we want to build 32bit shared library. We have already modified paths to include Oracle9i's 32bit libraries.

For your reference I am attaching values of LD_LIBRARY_PATH,SHLIB_PATH and PATH environmental variables

hpawls:oracle:/home/oracle/templib/userexit32> echo $LD_LIBRARY_PATH
/opt/java1.3/lib:/opt/java1.3/lib/tools.jar:/opt/java1.3/jre/lib/PA_RISC2.0:/opt/netscape/java/classes:/opt/netscape/java/classes/java40.jar:/usr/lib:/data/app/oracle/product/Oracle9i/lib32

hpawls:oracle:/home/oracle/templib/userexit32> echo $PATH
/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/perf/bin://opt/perl/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/pred/bin:/opt/hparray/bin:/opt/ignite/bin:/opt/langtools/bin:/opt/java1.3/bin:/opt/netscape:.:/usr/bin:/usr/local/bin:.:/usr/sbin:/etc:/data/app/oracle/product/Oracle9i/bin:/bin:/usr/ccs/bin

hpawls:oracle:/home/oracle/templib/userexit32> echo $SHLIB_PATH
/usr/lib:/usr/local/lib:/data/app/oracle/product/Oracle9i/precomp/lib32:/data/app/oracle/product/Oracle9i/lib32:/data/app/oracle/product/Oracle9i/rdbms/lib32:/data/app/oracle/product/Oracle9i/lib32

Please let me know your comments on this.

Thanks
Vinay
Olav Baadsvik
Esteemed Contributor

Re: Building 32bit shared library on 64bit HP-UX 11.0


Hi,If you are still getting the error message:
ld: Mismatched ABI ...
then Cheryl's reply still applies.

The environment-variables LD_LIBRARY_PATH, PATH and
SHLIB_PATH may be important when you run a program, but not
when you compile/link.

The cause of the error-message is that you are trying to link
a mix of 64-bit and 32-bit objects.

You have some -L/data/app... in your ld command.
Is this the correct path to where the 32-bit versions of the
oracle libs are found?

Regards
Olav