Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocatable MoarVM #1053

Merged
merged 8 commits into from Mar 20, 2019

Conversation

Projects
None yet
3 participants
@patzim
Copy link
Contributor

patzim commented Feb 13, 2019

This PR makes moar search for libmoar relative to its location by default, essentially making MoarVM relocatable. A Configure option --no-relocatable switches back to the old behavior.
Also MVM_exepath() is added to the public API. That function is required by the new perl6 runners in rakudo.
AIX very likely still needs work.
This PR is mostly about getting feedback from other devs. I do not expect this PR (and the respective PRs in NQP and Rakudo) to be merged right away.
I tested this on Linux+GCC, Windows10+MinGW and Windows10+VC.

ldshared => '-shared @ccshared@',
moarshared => '',
ldrpath => '-Wl,-rpath,"/@libdir@"',
ldrpath_relocatable => '-Wl,-z,origin,-rpath,\'$$ORIGIN/../lib\'',

This comment has been minimized.

Copy link
@manchicken

manchicken Feb 17, 2019

Contributor

I don't think that the -z flag to ld is terribly portable. It looks like the macOS linker is not a fan of that flag.

@patzim

This comment has been minimized.

Copy link
Contributor Author

patzim commented Feb 27, 2019

This branch is now confirmed to also work on OpenBSD and MacOS. I know of no other blockers so I'm fine with this PR (and the respectives in NQP and rakudo) to be merged post release.
I can do a rebase on head before the merge if that is in any way helpful.

Patrick Sebastian Zimmermann and others added some commits Sep 26, 2018

Add MVM_execpath() to public API.
It is just a forward to uv_exepath(). The function is helpful to implement
runner programs wrapping moar. It is used in the rakudo perl6 executable.
Fix build with nmake.
That fails with "too long argument" when trying to remove the build object
files. Fix by splitting the object list in two.
Never build a relocatable moar on AIX.
AIX has no support for rpath $ORIGIN or any similar mechanism. Thus
dynamically locating the libmoar.so relative to the executable path is
impossible. Once building a static moar (without libmoar.so) is possible
we can use that instead. A static moar would be relocatable by default.

@patzim patzim force-pushed the patzim:reloc branch from dcfa5f1 to 12bfa1b Mar 20, 2019

@AlexDaniel AlexDaniel merged commit 079d670 into MoarVM:master Mar 20, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
CodeFactor No issues found.
Details

@patzim patzim deleted the patzim:reloc branch Mar 27, 2019

@patzim patzim referenced this pull request Apr 18, 2019

Closed

Make MoarVM portable #965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.