Hi all (Armin?), I have been troubled by the line rpython/translator/platform/drawin.py:35, where it adds ‘@rpath/$(TARGET)’ to the linker arguments for shared libraries. This assumes that the usage case will be from a Makefile, where $(TARGET) is defined. However, in ExternalCompilationInfo.compile_shared_library function, which I use to compile a few support C files into a shared library dependency, there is no Makefile involved, yet the flag is still involved in the final linking. This seemed to pose a problem for other shared library that depends on the compiled library, and dlopen was complaining that it cannot find library ‘@rpath/$(TARGET)’. I’m wondering if there is a good solution for this. A possible solution would be to add a default parameter for _args_for_shared, which could be altered if not compiled using Makefile. What do you think? The attached is a suggested solution. Regards, John Zhang ------------------------------------------------------ John Zhang Research Assistant Programming Languages, Design & Implementation Division Computer Systems Group ANU College of Engineering & Computer Science 108 North Rd The Australian National University Acton ACT 2601 john.zhang@anu.edu.au<mailto:john.zhang@anu.edu.au>
Hi John, On 16 February 2017 at 01:50, John Zhang <John.Zhang@anu.edu.au> wrote:
Hi all (Armin?), I have been troubled by the line rpython/translator/platform/drawin.py:35, where it adds ‘@rpath/$(TARGET)’ to the linker arguments for shared libraries. This assumes that the usage case will be from a Makefile, where $(TARGET) is defined. However, in ExternalCompilationInfo.compile_shared_library function, which I use to compile a few support C files into a shared library dependency, there is no Makefile involved, yet the flag is still involved in the final linking. This seemed to pose a problem for other shared library that depends on the compiled library, and dlopen was complaining that it cannot find library ‘@rpath/$(TARGET)’. I’m wondering if there is a good solution for this. A possible solution would be to add a default parameter for _args_for_shared, which could be altered if not compiled using Makefile. What do you think? The attached is a suggested solution.
I've checked in a similar solution (your patch is not acceptable because it breaks on non-OS/X platforms). Can you check if it works for you? A bientôt, Armin.
participants (2)
-
Armin Rigo
-
John Zhang