Your one-stop destination to learn and collaborate about the latest innovations in IBM C/C++ for z/OS compilers to develop high-performing C/C++ applications and system programs on z/OS while maximizing hardware use and improving application performance.
Hi All,
It looks like we can't use the DLL functions such as dllload(), dllqueryfn() when compiling with the option METAL, is it true? Is it because
the header dll.h isn't in the directory /usr/include/metal?
Thank you for your reply.
Hello,
Support for DLL option and associated functionality is not available with Metal.
Can you explain your use case of DLL with MetalC?
Thanks,
Visda
Here is a long story: Currently, we have a 31-bit assembler code (A1) to call a jni C program (C1). This C program launches a 31-bit JVM. Now I have to change the C program so that it launches a 64-bit JVM. And here is my plan: My first plan is to use the compile option METAL to complete the task: - I write a small C program (C2): int C3(int) __attribute__((amode64)); int jvm00 (int func) { return(C3(func)); } This program will be compiled in 31-bit mode and with the option METAL. This program calls C3 program. C3 program is just a rename of C1 and is compiled in 64-bit and with the option METAL. Unfortunately, the jni code can't be compiled along with the option METAL. So, I came up with the second plan: The program C3 is compiled in 64-bit mode without the option METAL and linked to a DLL. - A C4 program is written and compiled in 64-bit mode and with the option METAL so that it can be called by C2. In C4, I use dll functions to load and call a method in C3 to bring up JVM in 64-bit. And I gave up because DLL functions doesn't work with option METAL. Do you have any idea?
Thank you very much
It sounds what is gating you from making the scenario work is the mix of 31- and 64- bit C object files. Is there a reason why you are not building all sources involved in this scenario in 64-bit?
A side note: any reason you're not using one of the existing Java launchers like the java command or the JZOS JVMLDMnn?
A set of C fun is provided for a METAL. With a METAL option, there are linker command line options available. the C compiler generated code does not have any dependencies.