@@ -54,7 +54,6 @@ public static class DefaultArguments {
5454 public final List <String > unixWarningArgs = List .of ("-Wall" , "-Wextra" );
5555 public final List <String > unixWarningsAsErrorsArgs = List .of ("-Werror" );
5656
57- public final String unixRpathOriginArg = "-Wl,-rpath,'$ORIGIN'" ;
5857 public final String unixSymbolArg = "-g" ;
5958
6059 // -Wdeprecated-enum-enum-conversion was introduced in GCC 11
@@ -64,15 +63,15 @@ public static class DefaultArguments {
6463 public final List <String > linuxCrossCompilerExtraArgs10 = List .of ("-Wno-error=deprecated-declarations" );
6564 public final List <String > linuxCrossCCompilerArgs = List .of ("-Wformat=2" , "-pedantic" , "-Wno-psabi" ,
6665 "-Wno-unused-parameter" , "-fPIC" , "-pthread" );
67- public final List <String > linuxCrossLinkerArgs = List .of ("-rdynamic" , "-pthread" , "-ldl" , "-latomic" );
66+ public final List <String > linuxCrossLinkerArgs = List .of ("-rdynamic" , "-pthread" , "-ldl" , "-latomic" , "-Wl,-rpath,'$ORIGIN'" );
6867 public final List <String > linuxCrossReleaseCompilerArgs = List .of ("-O2" );
6968 public final List <String > linuxCrossDebugCompilerArgs = List .of ("-Og" );
7069
7170 public final List <String > linuxCompilerArgs = List .of ("-std=c++20" , "-Wformat=2" , "-pedantic" , "-Wno-psabi" ,
7271 "-Wno-unused-parameter" , "-Wno-error=deprecated-enum-enum-conversion" , "-fPIC" , "-pthread" );
7372 public final List <String > linuxCCompilerArgs = List .of ("-Wformat=2" , "-pedantic" , "-Wno-psabi" ,
7473 "-Wno-unused-parameter" , "-fPIC" , "-pthread" );
75- public final List <String > linuxLinkerArgs = List .of ("-rdynamic" , "-pthread" , "-ldl" , "-latomic" );
74+ public final List <String > linuxLinkerArgs = List .of ("-rdynamic" , "-pthread" , "-ldl" , "-latomic" , "-Wl,-rpath,'$ORIGIN'" );
7675 public final List <String > linuxReleaseCompilerArgs = List .of ("-O2" );
7776 public final List <String > linuxDebugCompilerArgs = List .of ("-O0" );
7877
@@ -91,7 +90,7 @@ public static class DefaultArguments {
9190 public final List <String > macDebugCompilerArgs = List .of ("-O0" );
9291 public final List <String > macLinkerArgs = List .of ("-framework" , "CoreFoundation" , "-framework" , "AVFoundation" ,
9392 "-framework" , "Foundation" , "-framework" , "CoreMedia" , "-framework" , "CoreVideo" ,
94- "-headerpad_max_install_names" );
93+ "-headerpad_max_install_names" , "-Wl,-rpath,'@loader_path'" );
9594 }
9695
9796 public static class Platforms {
@@ -379,26 +378,6 @@ public void addWarningsAsErrors(String... platforms) {
379378 }
380379 }
381380
382- private void addPlatformRpathAsOrigin (String platform ) {
383- PlatformConfig plat = unixPlatforms .get (platform );
384- if (plat != null ) {
385- plat .getLinker ().getArgs ().add (defaultArguments .unixRpathOriginArg );
386- return ;
387- }
388- }
389-
390- public void addPlatformRpathAsOrigin (String ... platforms ) {
391- if (platforms .length == 0 ) {
392- for (String platform : this .platforms .allPlatforms ) {
393- addPlatformRpathAsOrigin (platform );
394- }
395- } else {
396- for (String platform : platforms ) {
397- addPlatformRpathAsOrigin (platform );
398- }
399- }
400- }
401-
402381 private DependencyVersions dependencyVersions ;
403382
404383 private void registerStandardDependency (ExtensiblePolymorphicDomainObjectContainer <NativeDependency > configs ,
0 commit comments