@@ -505,17 +505,12 @@ public Object loadCExtLibrary(String feature, String path, Node currentNode) {
505
505
try {
506
506
final TruffleFile truffleFile = FileLoader .getSafeTruffleFile (language , context , path );
507
507
FileLoader .ensureReadable (context , truffleFile , currentNode );
508
-
509
- final Source source ;
510
- try {
511
- source = Source .newBuilder ("llvm" , truffleFile ).build ();
512
- } catch (IOException e ) {
513
- throw new RaiseException (context , context .getCoreExceptions ().loadError (e , path , currentNode ));
514
- }
515
-
508
+ final Source source = Source
509
+ .newBuilder ("nfi" , "with llvm load (RTLD_GLOBAL) '" + path + "'" ,
510
+ "load RTLD_GLOBAL with Sulong through NFI" )
511
+ .build ();
516
512
final Object library = context .getEnv ().parseInternal (source ).call ();
517
-
518
- final Object embeddedABIVersion = getEmbeddedABIVersion (path , library );
513
+ final Object embeddedABIVersion = getEmbeddedABIVersion (library );
519
514
DispatchNode .getUncached ().call (context .getCoreLibrary ().truffleCExtModule , "check_abi_version" ,
520
515
embeddedABIVersion , path );
521
516
@@ -525,7 +520,7 @@ public Object loadCExtLibrary(String feature, String path, Node currentNode) {
525
520
}
526
521
}
527
522
528
- private Object getEmbeddedABIVersion (String expandedPath , Object library ) {
523
+ private Object getEmbeddedABIVersion (Object library ) {
529
524
final Object abiVersionFunction ;
530
525
try {
531
526
abiVersionFunction = InteropLibrary .getFactory ().getUncached (library ).readMember (library ,
0 commit comments