Skip to content

Commit 4ece4cd

Browse files
committed
Append sulong to LD_LIBRARY_PATH in the launcher
1 parent e092cc2 commit 4ece4cd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates.
33
* Copyright (c) 2013, Regents of the University of California
44
*
55
* All rights reserved.
@@ -687,6 +687,14 @@ protected void launch(Builder contextBuilder) {
687687
evalInternal(context, "__graalpython__.startup_wall_clock_ts = " + startupWallClockTime + "; __graalpython__.startup_nano = " + startupNanoTime);
688688
}
689689

690+
// Set LD_LIBRARY_PATH so that binaries built with sulong toolchain can find libc++.so
691+
evalInternal(context, """
692+
import os
693+
path = os.environ.get('LD_LIBRARY_PATH', '')
694+
sulong_path = os.pathsep.join(__graalpython__.get_toolchain_paths('LD_LIBRARY_PATH'))
695+
os.environ['LD_LIBRARY_PATH'] = path + os.pathsep + sulong_path if path else sulong_path
696+
""");
697+
690698
if (!quietFlag && (verboseFlag || (commandString == null && inputFile == null && stdinIsInteractive))) {
691699
print("Python " + evalInternal(context, "import sys; sys.version + ' on ' + sys.platform").asString());
692700
if (!noSite) {

0 commit comments

Comments
 (0)