Operating System - HP-UX
1753428 Members
4949 Online
108793 Solutions
New Discussion юеВ

gcc, ELF-64, PA-RISC2.0 link problem

 
SOLVED
Go to solution
sombriks
Advisor

gcc, ELF-64, PA-RISC2.0 link problem

gentlemen, good day.

actually i have some JNI code and for now it's almost functional, let me tell why:

those jvm's that i have probably were compiled with aCC compiler, but i do'nt have one for now.

i'm working with gcc 4.4.0 from porting center; using just it i can do a shared library able to be loaded on those jvm's;

the problem is that code needs to load a small PA-RISC2.0 library, so, jvm will load my glue code, and that code will use do load that PA-RISC2.0 library.

the jvm's could successfully load the JNI code compiled with gcc (i've used the -mlp64 flag) but that code using could not load the lib.

is there any gcc flag that i could use to load the PA-RISC2.0 lib on my ELF-64 binary?

thanks in advance, and please tell me even if aCC is the only choice,
3 REPLIES 3
Dennis Handly
Acclaimed Contributor
Solution

Re: gcc, ELF-64, PA-RISC2.0 link problem

>those JVMs that I have probably were compiled with aC++ compiler, but I don't have one for now.

Since java is compiled with aC++, you must compile your JNIs with either gcc, cc or aCC but not g++.

>please tell me even if aCC is the only choice

Yes, unless you can just use C.


sombriks
Advisor

Re: gcc, ELF-64, PA-RISC2.0 link problem


>Since java is compiled with aC++, you must >compile your JNIs with either gcc, cc or aCC >but not g++.

i'm not using g++

>Yes, unless you can just use C.

it's just C, the JNI par is ok, but dlfnc is problematic... there's a sample attached.

noteworthy:

$ file calce.sl
calce.sl: PA-RISC2.0 shared library -not stripped


$ file teste_GetVersao
teste_GetVersao: ELF-64 executable object file - IA64


i'm compiling teste_GetVersao.c with


$ gcc teste_GetVersao.c -ldl -mlp64 -o teste_GetVersao

so, i'm glad if you guys share ssome ideas, ;)
Dennis Handly
Acclaimed Contributor

Re: gcc, ELF-64, PA-RISC2.0 link problem

>it's just C

Then you can use gcc.

calce.sl: PA-RISC2.0 shared library
teste_GetVersao: ELF-64 executable object file - IA64

You can't mix 32 and 64 nor PA and IPF.

>I'm compiling teste_GetVersao.c with
$ gcc teste_GetVersao.c -ldl -mlp64

You need to replace your PA shlib calce.sl by an Integrity version.