- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- JNI compilation/linking issues on an HP-UX IA64 u...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2008 05:08 AM
12-29-2008 05:08 AM
JNI compilation/linking issues on an HP-UX IA64 using gcc
1.) Can anyone provide me with the command line arguments that would be required to compile and link JNI 'c' code in 64bit mode using gcc ?
Compiler: gcc-hppa64-4.3.1.depot
Java : jdk6_16002_pa.depot
OS : IA64 11.23
2.) What are the Options we need to set for
compiling the java code in 64 bit mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2008 05:57 AM
12-29-2008 05:57 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
(I'm not sure why you have "_pa" when you are on IPF?)
Basically you need to compile in 64 bit mode: -mlp64
And run java with -d64.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2008 10:45 PM
12-29-2008 10:45 PM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
I have used jdk6_16002_ia.depot for IA64 not the PA_RISC jvm ( It was a typing mistake ).
I compiled the JNI 'c' code in 64bit mode using gcc options:
GCC Compiling options as
gcc -fPIC -mlp64 -D_REENTRANT
GCC Linking Options as
gcc -lc -shared
I invoked the 64 Bit JVM using
-d64
While compiling i got the error as
[jnicc] ** COMPILER: ld: Mismatched ABI for -lgcc_s, found /opt/hp-gcc-4.3.1/lib/gcc/ia64-hp-hpux11.23/4.3.1/../../../libgcc_s.so
[jnicc] ** COMPILER: Fatal error.
[jnicc] ** COMPILER: collect2: ld returned 1 exit status
Error while executing gcc -g -lc -shared -o /tmp/nalgo01/libStats.so /tmp/nalgo01/compiler/hpuxmonitor/java_interface.o
I would appreciate any help on this
Thanks in Advance
Gopinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2008 11:22 PM
12-29-2008 11:22 PM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
You forgot the most important option, -mlp64. Also leave -lc off all link lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 01:51 AM
12-30-2008 01:51 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
As u have said i have used the gcc linking options as
GCC Linking Options as
gcc -mlp64 -shared
It got compiled sucessfully.
I used the generated .jar and .so files in my application and it produced the following error
java.lang.UnsatisfiedLinkError: Can't load library: /tmp/nalgo01/Probeing/libStats.so
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
java.lang.Runtime.load0(Runtime.java:770)
java.lang.System.load(System.java:1005)
I would appreciate any help on this
Thanks in Advance
Gopinath
- Tags:
- unsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 02:17 AM
12-30-2008 02:17 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
This isn't helpful, it should print the unsatisfied symbol.
Can you relink with -lc and retry? I don't think it will fix it but it will make the nm(1) list below smaller.
Can you provide:
nm -px /tmp/nalgo01/Probeing/libStats.so | grep " U "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 04:19 AM
12-30-2008 04:19 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
linked With out -lc option
$ nm -p -x libIntroscopeHPUXItanium64Stats.so | grep " U "
0x0000000000000000 U atoi
0x0000000000000000 U free
0x0000000000000000 U getpid
0x0000000000000000 U getppid
0x0000000000000000 U getrusage
0x0000000000000000 U malloc
0x0000000000000000 U pstat_getdynamic
0x0000000000000000 U pstat_getprocessor
0x0000000000000000 U sysconf
linked With -lc option
$ nm -p -x libIntroscopeHPUXItanium64Stats.so | grep " U "
0x0000000000000000 U atoi
0x0000000000000000 U free
0x0000000000000000 U getpid
0x0000000000000000 U getppid
0x0000000000000000 U getrusage
0x0000000000000000 U malloc
0x0000000000000000 U pstat_getdynamic
0x0000000000000000 U pstat_getprocessor
0x0000000000000000 U sysconf
Both are producing the same result.
Does i need to set any ld or shlib path
Thanks in Advance
Gopinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 05:00 AM
12-30-2008 05:00 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
>U sysconf
These all should be defined in libc.
>linked With -lc option
Oops, that's linked with -lc and -Wl,+vshlibunsats
(So, you don't need nm(1).)
>Do I need to set any ld or shlib path?
No. I don't know if using -Wl,-Bverbose may help?
Have you looked at the java JNI documentation to see if there are specific symbols that must be defined?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 05:29 AM
12-30-2008 05:29 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
can u please explain what it means
1.) Does using these options in linking helps
-Wl,+vshlibunsats
> No. I don't know if using -Wl,-Bverbose may help?
shall i use these options -Wl,-Bverbose as linker arguments
> Have you looked at the java JNI documentation to see if there are specific symbols that must be defined?
specific symbol means.. what kind of symboles
I would appreciate any help on this
Thanks in Advance
Gopinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 06:22 AM
12-30-2008 06:22 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
No. They just will list the symbols that aren't defined in your shlib. Which I assumed was the cause of your java UnsatisfiedLinkError.
>shall I use these options -Wl,-Bverbose as linker arguments?
Yes, that may cause dld.so to print more verbose errors.
>specific symbol means. what kind of symbols?
Specific names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2008 08:11 AM
12-30-2008 08:11 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
http://docs.hp.com/en/JAVAPROGUIDE/JNI_java2.html#java_native_c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2008 01:02 AM
12-31-2008 01:02 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
I have gone through the link which u have send
> http://docs.hp.com/en/JAVAPROGUIDE/JNI_java2.html#java_native_c
In this link i found a statement which states as follows...
""
On Integrity, create the shared library using:
$ aCC -b -o libaCCImpl.so aCCImpl.o \
-lstd_v2 -lCsup -lunwind -lm
On Integrity, the -AA lib -lstd_v2 is necessary, otherwise, running the program will result in UnsatisfiedLinkErrors.
""
Does we have an option -lstd_v2 in gcc.
Where we need to include this option ie in compilation or linking.
In advance i wish u Very Happy New Year
Regards,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2008 01:24 AM
12-31-2008 01:24 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
This should be for aC++ only, not C.
>Do we have an option -lstd_v2 in gcc?
>Where we need to include this option ie in compilation or linking.
This is a link option but I can't see how it would make it work, since you don't have any unsats.
What are the names of your native methods and are they in your shlib?
nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2008 02:38 AM
12-31-2008 02:38 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
> nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "
$ nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "
0x4000000000001ca0 T JNU_ThrowByName
0x4000000000003000 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getAggregateCPUUsage
0x4000000000001ea0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getCPUIndexMap
0x4000000000002ee0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getParentProcessID
0x40000000000023a0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProcessCPUUsage
0x4000000000002dc0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProcessID
0x4000000000002d50 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProtocolVersion
0x4000000000003be0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getThreadCpuTime
0x40000000000025e0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getTotalClockTicks
0x4000000000002d80 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_init
0x4000000000003bb0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_isThreadCpuTimeEnabled
0x4000000000002da0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_term
0x40000000000002b0 D _DYNAMIC
1.) What are the compiling options for aCC(aC++) to compile in 64 bit mode ( HP-UX IA64 ).
Is it +DD64
> What are the names of your native methods and are they in your shlib?
The names of the native methods u can see above.
Does we nee to set shlib path. if yes to which location we need to set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2008 04:25 AM
12-31-2008 04:25 AM
Re: JNI compilation/linking issues on an HP-UX IA64 using gcc
Yes.
>The names of the native methods you can see above.
How are they declared in java?
Is this some class name? Java_com_hpux
What is JNU_ThrowByName for?
>Do we need to set SHLIB_PATH?
No, you aren't using any other shlibs.
I suppose you could use gdb to see what dl* functions are being called, dlopen, dlsym.