Re: [pypy-dev] '@rpython/$(TARGET)' problem

2017-02-20 Thread Armin Rigo
Hi John,

On 16 February 2017 at 01:50, John Zhang  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.
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] '@rpython/$(TARGET)' problem

2017-02-16 Thread John Zhang
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.zh...@anu.edu.au







suggestion.patch
Description: suggestion.patch
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev