From 0020a97fdc20ca099ec6386771b20d3236f9890d Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 28 Mar 2019 10:52:59 -0700 Subject: [PATCH] Remove @executable_path/Frameworks from rpaths This is automatically added for these rule types by rules_apple. Having them here causes an issue with Xcode 10.2 and above because the /usr/bin/swift rpath _must_ be first, but this one is added first instead. Closes #7830. PiperOrigin-RevId: 240806623 --- .../util/mock/osx_cc_toolchain_config.bzl | 80 ------------------- .../lib/rules/objc/ObjcRuleTestCase.java | 1 - .../osx/crosstool/cc_toolchain_config.bzl.tpl | 56 ------------- 3 files changed, 137 deletions(-) diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/mock/osx_cc_toolchain_config.bzl b/src/test/java/com/google/devtools/build/lib/packages/util/mock/osx_cc_toolchain_config.bzl index 05fda226277a3d..5654e1b64793d8 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/mock/osx_cc_toolchain_config.bzl +++ b/src/test/java/com/google/devtools/build/lib/packages/util/mock/osx_cc_toolchain_config.bzl @@ -309,10 +309,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -373,10 +369,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -437,10 +429,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -501,10 +489,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -565,10 +549,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -629,10 +609,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -693,10 +669,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -757,10 +729,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -821,10 +789,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -885,10 +849,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -953,10 +913,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1018,10 +974,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1083,10 +1035,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1148,10 +1096,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1213,10 +1157,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1278,10 +1218,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1343,10 +1279,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1408,10 +1340,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1473,10 +1401,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1538,10 +1462,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java index 55d89363a8fbf4..a8fb7e173975a5 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java @@ -380,7 +380,6 @@ protected void verifyLinkAction( .add(frameworkDir(ApplePlatform.forTarget(PlatformType.IOS, arch))) .addAll(frameworkPathFragmentParents.build()) .add("-Xlinker -objc_abi_version -Xlinker 2") - .add("-Xlinker -rpath -Xlinker @executable_path/Frameworks") .add("-fobjc-link-runtime") .add("-ObjC") .addAll( diff --git a/tools/osx/crosstool/cc_toolchain_config.bzl.tpl b/tools/osx/crosstool/cc_toolchain_config.bzl.tpl index b6439a28cc744a..ba1ac58b7799a7 100644 --- a/tools/osx/crosstool/cc_toolchain_config.bzl.tpl +++ b/tools/osx/crosstool/cc_toolchain_config.bzl.tpl @@ -602,10 +602,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -669,10 +665,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -735,10 +727,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -801,10 +789,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -867,10 +851,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -934,10 +914,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1003,10 +979,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1898,10 +1870,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -1969,10 +1937,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -2039,10 +2003,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -2109,10 +2069,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -2179,10 +2135,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -2250,10 +2202,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ], @@ -2323,10 +2271,6 @@ def _impl(ctx): "-objc_abi_version", "-Xlinker", "2", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/Frameworks", "-fobjc-link-runtime", "-ObjC", ],