Skip to content

Commit 3446ce5

Browse files
committed
[GR-22782] Sulong launchers code modified to facilitate single-image launchers.
PullRequest: graal/17916
2 parents 4a3013d + 9d2ee0c commit 3446ce5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

sulong/mx.sulong/mx_sulong.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2023, Oracle and/or its affiliates.
2+
# Copyright (c) 2016, 2024, Oracle and/or its affiliates.
33
#
44
# All rights reserved.
55
#
@@ -410,7 +410,7 @@ class ToolchainConfig(object):
410410
"BINUTIL": ["graalvm-{name}-binutil"] + _llvm_tool_map + ["llvm-" + i for i in _llvm_tool_map]
411411
}
412412

413-
def __init__(self, name, dist, bootstrap_dist, tools, suite, select_flags=None):
413+
def __init__(self, name, dist, bootstrap_dist, tools, suite, tool_map_templ=None, select_flags=None):
414414
self.name = name
415415
self.dist = dist if isinstance(dist, list) else [dist]
416416
self.bootstrap_provider = create_toolchain_root_provider(name, bootstrap_dist)
@@ -420,7 +420,9 @@ def __init__(self, name, dist, bootstrap_dist, tools, suite, select_flags=None):
420420
self.suite = suite
421421
self.select_flags = select_flags or []
422422
self.mx_command = self.name + '-toolchain'
423-
self.tool_map = {tool: [_exe_sub(alias.format(name=name)) for alias in aliases] for tool, aliases in ToolchainConfig._tool_map.items()}
423+
if tool_map_templ is None:
424+
tool_map_templ = ToolchainConfig._tool_map
425+
self.tool_map = {tool: [_exe_sub(alias.format(name=name)) for alias in aliases] for tool, aliases in tool_map_templ.items()}
424426
self.path_map = {_exe_sub(path): tool for tool, aliases in self.tool_map.items() for path in aliases}
425427
# register mx command
426428
mx.update_commands(_suite, {

sulong/projects/com.oracle.truffle.llvm.toolchain.launchers/src/com/oracle/truffle/llvm/toolchain/launchers/AbstractBinUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public final void run(String[] args) {
5454
}
5555

5656
final Path toolPath = getTargetPath(toolName);
57+
runTool(toolPath, args);
58+
}
5759

60+
public static void runTool(Path toolPath, String[] args) {
5861
ArrayList<String> utilArgs = new ArrayList<>(args.length + 1);
5962
utilArgs.add(toolPath.toString());
6063
if (args.length > 0) {
@@ -83,7 +86,7 @@ private static boolean isWindows() {
8386
return System.getProperty("os.name").startsWith("Windows");
8487
}
8588

86-
private static String getProcessName() {
89+
public static String getProcessName() {
8790
String binPathName = System.getProperty("org.graalvm.launcher.executablename");
8891

8992
if (binPathName == null) {

0 commit comments

Comments
 (0)