File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 50
50
import static com .oracle .graal .python .nodes .StringLiterals .J_LLVM_LANGUAGE ;
51
51
import static com .oracle .graal .python .nodes .StringLiterals .T_COLON ;
52
52
import static com .oracle .graal .python .nodes .StringLiterals .T_EMPTY_STRING ;
53
+ import static com .oracle .graal .python .nodes .StringLiterals .T_LLVM_LANGUAGE ;
54
+ import static com .oracle .graal .python .nodes .StringLiterals .T_NATIVE ;
53
55
import static com .oracle .graal .python .nodes .StringLiterals .T_PATH ;
54
56
import static com .oracle .graal .python .nodes .StringLiterals .T_STRICT ;
55
57
import static com .oracle .graal .python .nodes .StringLiterals .T_SURROGATEESCAPE ;
@@ -254,6 +256,7 @@ public void postInitialize(Python3Core core) {
254
256
mod .setAttribute (tsLiteral ("executable_list" ), executableList );
255
257
mod .setAttribute (tsLiteral ("ForeignType" ), core .lookupType (PythonBuiltinClassType .ForeignObject ));
256
258
mod .setAttribute (tsLiteral ("use_system_toolchain" ), context .getOption (PythonOptions .UseSystemToolchain ));
259
+ mod .setAttribute (tsLiteral ("ext_mode" ), context .getOption (PythonOptions .NativeModules ) ? T_NATIVE : T_LLVM_LANGUAGE );
257
260
258
261
if (!context .getOption (PythonOptions .EnableDebuggingBuiltins )) {
259
262
mod .setAttribute (tsLiteral ("dump_truffle_ast" ), PNone .NO_VALUE );
Original file line number Diff line number Diff line change 38
38
# SOFTWARE.
39
39
40
40
# Set library search path so that binaries built with sulong toolchain can find libc++.so
41
- import os , sys
42
- if sys .platform == "linux" :
43
- var = "LD_LIBRARY_PATH"
44
- elif sys .platform == "darwin" :
45
- var = "DYLD_LIBRARY_PATH"
46
- elif sys .platform == "win32" :
47
- var = "PATH"
48
- path = os .environ .get (var , '' )
49
- sulong_path = os .pathsep .join (__graalpython__ .get_toolchain_paths ('LD_LIBRARY_PATH' ))
50
- os .environ [var ] = f"{ path } { os .pathsep } { sulong_path } " if path else sulong_path
41
+ if __graalpython__ .ext_mode == "llvm" :
42
+ import os , sys
43
+ if sys .platform == "linux" :
44
+ var = "LD_LIBRARY_PATH"
45
+ elif sys .platform == "darwin" :
46
+ var = "DYLD_LIBRARY_PATH"
47
+ elif sys .platform == "win32" :
48
+ var = "PATH"
49
+ path = os .environ .get (var , '' )
50
+ sulong_path = os .pathsep .join (__graalpython__ .get_toolchain_paths ('LD_LIBRARY_PATH' ))
51
+ os .environ [var ] = f"{ path } { os .pathsep } { sulong_path } " if path else sulong_path
You can’t perform that action at this time.
0 commit comments