views:

35

answers:

1

Hi All,

I am trying to build my PRO* C application in 32 bit mode using Oracle 10g 64 bit on Solaris SPARC platform.

Can someone tell me what settings has to be made inorder to successfully compiler and create an executable?

Currently when i switch my LD_LIBRARY_PATH=$ORACLE_HOME/lib32, proc fails with the following error

ld.so.1: proc: fatal: /opt/oracle/product/10.2.0.4/lib32/libclntsh.so.10.1: wrong ELF class: ELFCLASS32

Any help is appreciated. Thanks

Thanks Jegan Kunniya

A: 

The error message is quite clear, you try to link a 32bit library with a 64bit application. You should try with LD_LIBRARY_PATH=$ORACLE_HOME/lib as it is there that the 64bit libraries are put. Oracle doesn't use the normal library scheme of Solaris (the sparcv9 subdirectory thing).

tristopia
Thanks for the prompt response. I am trying to create a 32 bit executable out of 64 bit PRO C. I am looking for setting that will not let PRO C crib with ELF error.
Jegan
Then it means that you have to compile your code in 32bit mode. By default gcc and Sunstudio build 32bit code. On gcc and newer versions of the cc you have to explicitly give an option `-m64` to compile in 64bit.
tristopia
To make it short, your problem comes from your binaries, not the Oracle libs as they are 32bit, that's what the message says.
tristopia
Thanks tristopia. But is there a way that i can get the Oracle 10g to use the 32 bit libraries and get the executable s out of it? if there is a way, what env settings that i have to do to get that?
Jegan
Also, since you have said that the problems are with my binaries. To contrast that statement, I have got 32 bit CC compiler and the binaries that i have are all 32 bit versions.
Jegan
That's strange as the error message tells that the Oracle library linked is 32 bit (`ELFCLASS32`). Could you give the options with which you compile your binaries?
tristopia
ok..here is what i tried.. I set LD_LIBRARY_PATH=$ORACLE_HOME/lib32 and run command PROC, it fails with the error that i had mentioned. But when we export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib and execute PROC then it works like a charm. This way of exporting libraries is suggested in ORACLE documentation (refer http://download.oracle.com/docs/html/B14399_01/post_inst_task.htm#sthref786)
Jegan
Ok, now I understand, you want to run a 32bit `proc` binary. Why? There's no point in that. The preprocessor doesn't care if you want to make your binaries 32bit or 64bit. The difference in performance would be negligible. This said, the problem comes from the `LD_LIBRARY_PATH`which will be invoked before the normal luist of library directories and the oracle tools will also find their symbols in them. You have to give the lib32 path on the linker line of you makefile and also when you run your app, but not at the time of invocation of proc.
tristopia
There you go. I did the same thing what you have mentioned and got my application compiled and built. Thanks for your responses. Also, if you aware please let me know if there is a Oracle 10g 32 bit installer for Solaris SPARC. Thanks
Jegan
Sorry, I'm not in charge of installing the software on ou servers, so I'm totally ignorant on that.
tristopia
Btw don't forget to mark the question as answered.
tristopia
sure. i will not. thanks for all your inputs.
Jegan