#473 Unable to dynamically load librexx.so

v4.1
closed
Mark Miesfeld
5
2012-08-14
2007-12-06
Anonymous
No

When I try to dlopen the librexx.so file it fails with an error

/usr/lib/librexx.so.3: undefined symbol: _Z11RxExitCleari

I checked the callrexx sample and it links with librexx.so which kind of defeats the purpose of dynamically linking. When I commented out the librexx.la and librexxapi.la calls in the Makefile, it failed with the same error.

This is on the RedHat version 4 client running on VMWare 1.0.1 build-19317, however I have plenty of complaints about this from users on other Linuxes.

... Blair Thompson blair@tangbu.com

Discussion

  • Logged In: NO

    I tinkered with the generated Makefile and came up with the following mods that allow me to ship my code without requiring oorexx but users can still use it by dlopen (within my code). There is likely a better way to do this, but this seems to work for now:

    Look for the definition of the am_librexx_la_OBJECTS variable and change it to:
    am_librexx_la_OBJECTS = librexxapi_la-SubcommandAPI.lo \ $(amobjects_1) $(amobjects_2) \ $(amobjects_3) $(amobjects_4) $(amobjects_5) \ $(amobjects_6) $(amobjects_7) $(amobjects_8) \ $(amobjects_9) $(amobjects_10) \ librexxapi_la-RexxAPIManager.lo \ librexxapi_la-SystemSemaphores.lo \ librexxapi_la-SharedMemorySupport.lo \ librexxapi_la-MacroSpace.lo librexxapi_la-QueuesAPI.lo

    Look for the definition of the am_librexxapi_la_OBJECTS variable and change it to:
    am_librexxapi_la_OBJECTS = librexxapi_la-SubcommandAPI.lo \ librexxapi_la-RexxAPIManager.lo \ librexxapi_la-SystemSemaphores.lo \ librexxapi_la-SharedMemorySupport.lo \ $(amobjects_1) $(amobjects_2) $(amobjects_3) \ $(amobjects_4) $(amobjects_5) $(amobjects_6) \ $(amobjects_7) \ $(amobjects_8) $(amobjects_9) $(amobjects_10) \ librexxapi_la-MacroSpace.lo librexxapi_la-QueuesAPI.lo

    ...Blair

     
  • Logged In: YES
    user_id=603711
    Originator: NO

    Issue confirmed on Linux (CentOS) - this means it (and the work around) will not work with Rexx/Trans.

    Repackaging of rexx.so or rexxapi.so needed?

    Note: Works fine in Windows.

     
  • Mark Miesfeld
    Mark Miesfeld
    2009-07-02

    This comment is made by
    J. L. Turriff ( jlturriff ) - 2009-05-22 23:07
    in an unrelated bug he opened. (Which is being closed.)

    I'm trying to interface Blair's X2 editor with ooRexx, using the current
    source tarball. I suspect that the patch needs to be modified to work with
    this later version, as there are a lot more am__objects_## than his 3.2
    probably had. Is this correct? (I don't know much about Makefiles and
    package building, so I'm hoping that you can help get this working.)

    Leslie

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-08-11

    I am able to dlopen both librexx.so and librexxapi.so with a build from trunk using the below program. This is on Ubuntu 9.10

    I'm closing this as out of date.

    / To compile use

    * gcc -o dlOpenTest dlOpenTest.c -ldl

    * output under ooRexx 4.1.0.6094

    * :~/work/ooRexx/dynamic.load.bug$ ./dlOpenTest
    * dlopen worked for /usr/lib/librexx.so, handle=0x9849020
    * dlopen worked for /usr/lib/librexxapi.so, handle=0x9849008
    */

    include <stdlib.h>

    include <stdio.h>

    include <dlfcn.h>

    int main(int argc, char argv) {
    void
    handle;
    char error;
    char libName1 = "/usr/lib/librexx.so";
    char
    libName2 = "/usr/lib/librexxapi.so";

    handle = dlopen (libName1, RTLD_LAZY);
    if (!handle) {
        fputs (dlerror(), stderr);
        exit(1);
    }
    
    printf ("dlopen worked for %s, handle=%p\n", libName1, handle);
    dlclose(handle);
    
    handle = dlopen (libName2, RTLD_LAZY);
    if (!handle) {
        fputs (dlerror(), stderr);
        exit(1);
    }
    
    printf ("dlopen worked for %s, handle=%p\n", libName2, handle);
    dlclose(handle);
    

    }

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-09-09

    For this bug, I'm leaving the resolution as out of date, changing status to open, and leaving group to v4.0.2. This will signal that I want to test it under the 4.1.0 build. If the test passes, then I will follow through and close it.

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-10-09

    Just tried on a Debian system with a current build of 4.1.0

    • dlopen worked for /usr/lib/ooRexx/librexx.so, handle=0x9451028
    • dlopen worked for /usr/lib/ooRexx/librexxapi.so, handle=0x9451598
     


Anonymous


Cancel   Add attachments