Skip to content

Commit 3ba78fb

Browse files
committed
Use the relative home property to specify where is the Sulong home
* Used in the Ruby standalone. * The path is from the truffleruby launcher's directory to the LLVM home.
1 parent 1610184 commit 3ba78fb

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

mx.truffleruby/native-image.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Args = -H:MaxRuntimeCompileMethods=5400 \
1212
-H:SubstitutionResources=org/truffleruby/aot/substitutions.json \
1313
-H:+AddAllCharsets
1414

15-
JavaArgs = -Dpolyglot.engine.PreinitializeContexts=ruby
15+
JavaArgs = -Dpolyglot.engine.PreinitializeContexts=ruby \
16+
-Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs

src/launcher/java/org/truffleruby/launcher/RubyLauncher.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.truffleruby.shared.TruffleRuby;
2525
import org.truffleruby.shared.Metrics;
2626

27-
import java.io.File;
2827
import java.io.IOException;
2928
import java.io.PrintStream;
3029
import java.lang.reflect.Method;
@@ -112,20 +111,6 @@ protected List<String> preprocessArguments(List<String> args, Map<String, String
112111
if (launcher != null) {
113112
polyglotOptions.put(OptionsCatalog.LAUNCHER.getName(), launcher);
114113
}
115-
116-
// In a native standalone distribution outside of GraalVM, we need to give the path to libsulong
117-
if (!isGraalVMAvailable()) { // TODO (eregon, 9 Jan 2019): This should check if Sulong is available.
118-
final String rubyHome = new File(launcher).getParentFile().getParent();
119-
final String libSulongPath = rubyHome + "/lib/cext/sulong-libs";
120-
121-
String libraryPath = System.getProperty("polyglot.llvm.libraryPath");
122-
if (libraryPath == null || libraryPath.isEmpty()) {
123-
libraryPath = libSulongPath;
124-
} else {
125-
libraryPath = libraryPath + ":" + libSulongPath;
126-
}
127-
polyglotOptions.put("llvm.libraryPath", libraryPath);
128-
}
129114
}
130115

131116
} catch (CommandLineException commandLineException) {

0 commit comments

Comments
 (0)