@@ -71,6 +71,7 @@ public static void main(String[] args) {
71
71
private boolean stdinIsInteractive = System .console () != null ;
72
72
private boolean runLLI = false ;
73
73
private VersionAction versionAction = VersionAction .None ;
74
+ private String sulongLibraryPath = null ;
74
75
75
76
@ Override
76
77
protected List <String > preprocessArguments (List <String > arguments , Map <String , String > polyglotOptions ) {
@@ -232,6 +233,7 @@ protected void launch(Builder contextBuilder) {
232
233
noUserSite = noUserSite || System .getenv ("PYTHONNOUSERSITE" ) != null ;
233
234
verboseFlag = verboseFlag || System .getenv ("PYTHONVERBOSE" ) != null ;
234
235
}
236
+ sulongLibraryPath = System .getenv ("SULONG_LIBRARY_PATH" );
235
237
236
238
// setting this to make sure our TopLevelExceptionHandler calls the excepthook
237
239
// to print Python exceptions
@@ -244,6 +246,9 @@ protected void launch(Builder contextBuilder) {
244
246
contextBuilder .option ("python.QuietFlag" , Boolean .toString (quietFlag ));
245
247
contextBuilder .option ("python.NoUserSiteFlag" , Boolean .toString (noUserSite ));
246
248
contextBuilder .option ("python.NoSiteFlag" , Boolean .toString (noSite ));
249
+ if (sulongLibraryPath != null ) {
250
+ contextBuilder .option ("llvm.libraryPath" , sulongLibraryPath );
251
+ }
247
252
248
253
ConsoleHandler consoleHandler = createConsoleHandler (System .in , System .out );
249
254
contextBuilder .arguments (getLanguageId (), programArgs .toArray (new String [0 ])).in (consoleHandler .createInputStream ());
@@ -416,7 +421,9 @@ protected void printHelp(OptionCategory maxCategory) {
416
421
"PYTHONHASHSEED: if this variable is set to 'random', the effect is the same\n " +
417
422
" as specifying the -R option: a random value is used to seed the hashes of\n " +
418
423
" str, bytes and datetime objects. It can also be set to an integer\n " +
419
- " in the range [0,4294967295] to get hash values with a predictable seed." );
424
+ " in the range [0,4294967295] to get hash values with a predictable seed.\n " +
425
+ "SULONG_LIBRARY_PATH: Specifies the library path for Sulong.\n " +
426
+ " This is required when starting subprocesses of python." );
420
427
if (maxCategory .compareTo (OptionCategory .DEBUG ) >= 0 ) {
421
428
print ("\n GraalPython performance debugging options:\n " +
422
429
"-debug-perf : Enable tracing of Truffle compilations and its warnings\n " +
0 commit comments