C/C++

C/C++

C/C++

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.

 View Only
  • 1.  Can I not use dll functions with option METAL?

    Posted Wed July 22, 2015 01:42 AM

     

    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.

    BachDoanIMS


  • 2.  Re: Can I not use dll functions with option METAL?

    Posted Wed July 22, 2015 10:59 AM

    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

     

    Visda


  • 3.  Re: Can I not use dll functions with option METAL?

    Posted Wed July 22, 2015 04:41 PM

    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

     

    BachDoanIMS


  • 4.  Re: Can I not use dll functions with option METAL?

    Posted Fri July 24, 2015 09:53 AM

    Hello,

    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?

    Visda


  • 5.  Re: Can I not use dll functions with option METAL?

    Posted Wed September 02, 2015 01:52 PM

    A side note: any reason you're not using one of the existing Java launchers like the java command or the JZOS JVMLDMnn?

    brataj


  • 6.  Re: Can I not use dll functions with option METAL?

    Posted Wed March 16, 2016 01:58 AM

    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. 

    Katherinehayden