Build Pharo VM with --dynamic-linker

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Build Pharo VM with --dynamic-linker

alistairgrant
Hi All,

I'm still working on getting Pharo packaged with snapcraft.  The latest
hurdle is that 32 bit applications won't load correctly because the
snapcraft environment means that ld-linux.so.2 isn't in the expected
location.

My understanding is that adding the appropriate --dynamic-linker flag
should solve the problem, defining:

export LDFLAGS="-Wl,--dynamic-linker=/snap/pharo/x1/lib/ld-linux.so.2"

successfully builds, but the pharo executable still has the default
location:

$ strings pharo-vm/pharo | grep ld-linux
/lib/ld-linux.so.2

Can someone point me to where I should modify the build scipt(s) so I
can set --dynamic-linker appropriately?


Thanks!
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: Build Pharo VM with --dynamic-linker

Luke Gorrie
Hi Alistair,

Just an idea: One alternative could be to use patchelf [1] to modify the dynamic library path in an existing binary. My understanding is that this method is very robust and widely used.


On 5 April 2017 at 09:14, Alistair Grant <[hidden email]> wrote:
Hi All,

I'm still working on getting Pharo packaged with snapcraft.  The latest
hurdle is that 32 bit applications won't load correctly because the
snapcraft environment means that ld-linux.so.2 isn't in the expected
location.

My understanding is that adding the appropriate --dynamic-linker flag
should solve the problem, defining:

export LDFLAGS="-Wl,--dynamic-linker=/snap/pharo/x1/lib/ld-linux.so.2"

successfully builds, but the pharo executable still has the default
location:

$ strings pharo-vm/pharo | grep ld-linux
/lib/ld-linux.so.2

Can someone point me to where I should modify the build scipt(s) so I
can set --dynamic-linker appropriately?


Thanks!
Alistair


Reply | Threaded
Open this post in threaded view
|

Re: Build Pharo VM with --dynamic-linker

alistairgrant
Hi Luke,

On 5 April 2017 at 10:41, Luke Gorrie <[hidden email]> wrote:
> Hi Alistair,
>
> Just an idea: One alternative could be to use patchelf [1] to modify the
> dynamic library path in an existing binary. My understanding is that this
> method is very robust and widely used.
>
> [1]: https://nixos.org/patchelf.html

Brilliant!  That does the trick, thanks!

Cheers,
Alistair




> On 5 April 2017 at 09:14, Alistair Grant <[hidden email]> wrote:
>>
>> Hi All,
>>
>> I'm still working on getting Pharo packaged with snapcraft.  The latest
>> hurdle is that 32 bit applications won't load correctly because the
>> snapcraft environment means that ld-linux.so.2 isn't in the expected
>> location.
>>
>> My understanding is that adding the appropriate --dynamic-linker flag
>> should solve the problem, defining:
>>
>> export LDFLAGS="-Wl,--dynamic-linker=/snap/pharo/x1/lib/ld-linux.so.2"
>>
>> successfully builds, but the pharo executable still has the default
>> location:
>>
>> $ strings pharo-vm/pharo | grep ld-linux
>> /lib/ld-linux.so.2
>>
>> Can someone point me to where I should modify the build scipt(s) so I
>> can set --dynamic-linker appropriately?
>>
>>
>> Thanks!
>> Alistair
>>
>