aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java8
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL614
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcBinaryTest.java14
-rw-r--r--tools/osx/crosstool/CROSSTOOL.tpl553
4 files changed, 622 insertions, 567 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
index b06e89d71c..705dc80a26 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java
@@ -1719,16 +1719,16 @@ public class CcToolchainFeatures implements Serializable {
*/
public List<String> getCommandLine(String action, Variables variables) {
List<String> commandLine = new ArrayList<>();
- for (Feature feature : enabledFeatures) {
- feature.expandCommandLine(action, variables, enabledFeatureNames, commandLine);
- }
-
if (actionIsConfigured(action)) {
actionConfigByActionName
.get(action)
.expandCommandLine(variables, enabledFeatureNames, commandLine);
}
+ for (Feature feature : enabledFeatures) {
+ feature.expandCommandLine(action, variables, enabledFeatureNames, commandLine);
+ }
+
return commandLine;
}
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
index fb072bda32..ecf8053fb1 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
@@ -1111,23 +1111,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -1151,14 +1142,35 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -2732,23 +2744,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -2772,14 +2775,35 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -4357,23 +4381,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -4388,6 +4403,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -4401,14 +4419,32 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -5990,23 +6026,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -6021,6 +6048,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -6034,14 +6064,32 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -7622,26 +7670,6 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
- }
- feature {
name: "cpp_linker_flags"
flag_set {
action: "c++-link-executable"
@@ -7678,6 +7706,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -7691,44 +7722,70 @@ toolchain {
}
}
feature {
- name: "dbg_only_flag"
+ name: "unfiltered_cxx_flags"
flag_set {
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-module-compile"
+ action: "c++-header-parsing"
+ action: "assemble"
+ action: "preprocess-assemble"
+ flag_group {
+ flag: "-no-canonical-prefixes"
+ flag: "-pthread"
+ }
+ }
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
+ flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "--DBG_ONLY_FLAG"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
- name: "fastbuild_only_flag"
+ name: "dbg_only_flag"
flag_set {
action: "objc-compile"
flag_group {
- flag: "--FASTBUILD_ONLY_FLAG"
+ flag: "--DBG_ONLY_FLAG"
}
}
}
feature {
- name: "opt_only_flag"
+ name: "fastbuild_only_flag"
flag_set {
action: "objc-compile"
flag_group {
- flag: "--OPT_ONLY_FLAG"
+ flag: "--FASTBUILD_ONLY_FLAG"
}
}
}
feature {
- name: "unfiltered_cxx_flags"
+ name: "opt_only_flag"
flag_set {
- action: "c-compile"
- action: "c++-compile"
- action: "c++-module-compile"
- action: "c++-header-parsing"
- action: "assemble"
- action: "preprocess-assemble"
+ action: "objc-compile"
flag_group {
- flag: "-no-canonical-prefixes"
- flag: "-pthread"
+ flag: "--OPT_ONLY_FLAG"
}
}
}
@@ -9289,23 +9346,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -9320,6 +9368,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -9333,14 +9384,32 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ }
+ feature {
+ name: "bitcode_embedded"
+ }
+ feature {
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -10920,23 +10989,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -10951,6 +11011,27 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ flag_set {
+ action: "objc-compile"
+ action: "objc++-compile"
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-fembed-bitcode-marker"
+ }
+ }
+ }
+ feature {
name: "bitcode_embedded"
flag_set {
action: "objc-compile"
@@ -10977,26 +11058,23 @@ toolchain {
}
}
feature {
- name: "bitcode_embedded_markers"
+ name: "copts"
flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
action: "objc-compile"
action: "objc++-compile"
- action: "objc-executable"
- action: "objc++-executable"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
- }
- feature {
- name: "cpp_linker_flags"
- flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -12576,23 +12654,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -12607,6 +12676,27 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ flag_set {
+ action: "objc-compile"
+ action: "objc++-compile"
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-fembed-bitcode-marker"
+ }
+ }
+ }
+ feature {
name: "bitcode_embedded"
flag_set {
action: "objc-compile"
@@ -12633,26 +12723,23 @@ toolchain {
}
}
feature {
- name: "bitcode_embedded_markers"
+ name: "copts"
flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
action: "objc-compile"
action: "objc++-compile"
- action: "objc-executable"
- action: "objc++-executable"
flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
- }
- feature {
- name: "cpp_linker_flags"
- flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
- flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -14231,26 +14318,6 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
- }
- feature {
name: "cpp_linker_flags"
flag_set {
action: "c++-link-executable"
@@ -14287,6 +14354,39 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ flag_set {
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-module-compile"
+ action: "c++-header-parsing"
+ action: "assemble"
+ action: "preprocess-assemble"
+ flag_group {
+ flag: "-no-canonical-prefixes"
+ flag: "-pthread"
+ }
+ }
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ flag_set {
+ action: "objc-compile"
+ action: "objc++-compile"
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-fembed-bitcode-marker"
+ }
+ }
+ }
+ feature {
name: "bitcode_embedded"
flag_set {
action: "objc-compile"
@@ -14313,15 +14413,23 @@ toolchain {
}
}
feature {
- name: "bitcode_embedded_markers"
+ name: "copts"
flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
action: "objc-compile"
action: "objc++-compile"
- action: "objc-executable"
- action: "objc++-executable"
flag_group {
- flag: "-fembed-bitcode-marker"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
@@ -14351,21 +14459,6 @@ toolchain {
}
}
}
- feature {
- name: "unfiltered_cxx_flags"
- flag_set {
- action: "c-compile"
- action: "c++-compile"
- action: "c++-module-compile"
- action: "c++-header-parsing"
- action: "assemble"
- action: "preprocess-assemble"
- flag_group {
- flag: "-no-canonical-prefixes"
- flag: "-pthread"
- }
- }
- }
action_config {
config_name: "strip"
action_name: "strip"
@@ -15921,23 +16014,14 @@ toolchain {
provides: "profile"
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -15952,6 +16036,27 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "bitcode_embedded_markers"
+ flag_set {
+ action: "objc-compile"
+ action: "objc++-compile"
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-fembed-bitcode-marker"
+ }
+ }
+ }
+ feature {
name: "bitcode_embedded"
flag_set {
action: "objc-compile"
@@ -15978,26 +16083,23 @@ toolchain {
}
}
feature {
- name: "bitcode_embedded_markers"
+ name: "copts"
flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
action: "objc-compile"
action: "objc++-compile"
- action: "objc-executable"
- action: "objc++-executable"
flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
- }
- feature {
- name: "cpp_linker_flags"
- flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
- flag_group {
- flag: "-undefined"
- flag: "dynamic_lookup"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
feature {
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcBinaryTest.java
index 298f704d13..33a6c8fb44 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcBinaryTest.java
@@ -100,6 +100,13 @@ public class ExperimentalObjcBinaryTest extends ObjcRuleTestCase {
.containsExactlyElementsIn(
new ImmutableList.Builder<String>()
.add("tools/osx/crosstool/ios/" + WRAPPED_CLANG)
+ .add("-arch armv7")
+ .add("-Xlinker", "-objc_abi_version", "-Xlinker", "2")
+ .add("-Xlinker", "-rpath", "-Xlinker", "@executable_path/Frameworks")
+ .add("-fobjc-link-runtime")
+ .add("-ObjC")
+ .add("-filelist " + execPathEndingWith(action.getInputs(), "bin-linker.objlist"))
+ .add("-o " + Iterables.getOnlyElement(Artifact.toExecPaths(action.getOutputs())))
.add("-F" + AppleToolchain.sdkDir() + AppleToolchain.DEVELOPER_FRAMEWORK_PATH)
.add("-F" + frameworkDir(platform))
.add("-isysroot")
@@ -109,13 +116,6 @@ public class ExperimentalObjcBinaryTest extends ObjcRuleTestCase {
.add("-target", "armv7-apple-ios")
.add("-miphoneos-version-min=" + DEFAULT_IOS_SDK_VERSION)
.addAll(automaticSdkFrameworks())
- .add("-arch armv7")
- .add("-Xlinker", "-objc_abi_version", "-Xlinker", "2")
- .add("-Xlinker", "-rpath", "-Xlinker", "@executable_path/Frameworks")
- .add("-fobjc-link-runtime")
- .add("-ObjC")
- .add("-filelist " + execPathEndingWith(action.getInputs(), "bin-linker.objlist"))
- .add("-o " + Iterables.getOnlyElement(Artifact.toExecPaths(action.getOutputs())))
.build())
.inOrder();
}
diff --git a/tools/osx/crosstool/CROSSTOOL.tpl b/tools/osx/crosstool/CROSSTOOL.tpl
index 5b9d5abf27..668e1c8e6d 100644
--- a/tools/osx/crosstool/CROSSTOOL.tpl
+++ b/tools/osx/crosstool/CROSSTOOL.tpl
@@ -869,23 +869,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -1029,24 +1015,7 @@ toolchain {
}
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
+ name: "cpp_linker_flags"
}
feature {
name: "apply_implicit_frameworks"
@@ -1068,6 +1037,32 @@ toolchain {
}
}
}
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "copts"
+ flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
+ flag_group {
+ flag: "%{copts}"
+ iterate_over: "copts"
+ }
+ expand_if_all_available: "copts"
+ }
+ }
action_config {
config_name: "strip"
action_name: "strip"
@@ -2370,23 +2365,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -2531,24 +2512,7 @@ toolchain {
}
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
+ name: "cpp_linker_flags"
}
feature {
name: "apply_implicit_frameworks"
@@ -2562,6 +2526,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -2574,6 +2541,29 @@ toolchain {
}
}
}
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "copts"
+ flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
+ flag_group {
+ flag: "%{copts}"
+ iterate_over: "copts"
+ }
+ expand_if_all_available: "copts"
+ }
+ }
action_config {
config_name: "strip"
action_name: "strip"
@@ -3880,23 +3870,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -4041,24 +4017,7 @@ toolchain {
}
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
+ name: "cpp_linker_flags"
}
feature {
name: "apply_implicit_frameworks"
@@ -4072,6 +4031,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -4084,6 +4046,29 @@ toolchain {
}
}
}
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "copts"
+ flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
+ flag_group {
+ flag: "%{copts}"
+ iterate_over: "copts"
+ }
+ expand_if_all_available: "copts"
+ }
+ }
action_config {
config_name: "strip"
action_name: "strip"
@@ -5389,23 +5374,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -5550,23 +5521,17 @@ toolchain {
}
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-lc++"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
+ flag: "-target"
+ flag: "x86_64-apple-tvos"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -5581,6 +5546,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -5609,17 +5577,23 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-lc++"
- flag: "-undefined"
- flag: "dynamic_lookup"
- flag: "-target"
- flag: "x86_64-apple-tvos"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
action_config {
@@ -6935,23 +6909,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -7096,24 +7056,7 @@ toolchain {
}
}
feature {
- name: "copts"
- flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
- }
- expand_if_all_available: "copts"
- }
+ name: "cpp_linker_flags"
}
feature {
name: "apply_implicit_frameworks"
@@ -7127,6 +7070,9 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
name: "apply_simulator_compiler_flags"
flag_set {
action: "objc-compile"
@@ -7139,6 +7085,29 @@ toolchain {
}
}
}
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
+ name: "copts"
+ flag_set {
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
+ flag_group {
+ flag: "%{copts}"
+ iterate_over: "copts"
+ }
+ expand_if_all_available: "copts"
+ }
+ }
action_config {
config_name: "strip"
action_name: "strip"
@@ -8443,23 +8412,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -8604,6 +8559,29 @@ toolchain {
}
}
feature {
+ name: "cpp_linker_flags"
+ }
+ feature {
+ name: "apply_implicit_frameworks"
+ flag_set {
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-framework Foundation"
+ flag: "-framework UIKit"
+ }
+ }
+ }
+ feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
name: "copts"
flag_set {
action: "assemble"
@@ -8623,17 +8601,6 @@ toolchain {
expand_if_all_available: "copts"
}
}
- feature {
- name: "apply_implicit_frameworks"
- flag_set {
- action: "objc-executable"
- action: "objc++-executable"
- flag_group {
- flag: "-framework Foundation"
- flag: "-framework UIKit"
- }
- }
- }
action_config {
config_name: "strip"
action_name: "strip"
@@ -9938,23 +9905,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -10099,6 +10052,29 @@ toolchain {
}
}
feature {
+ name: "cpp_linker_flags"
+ }
+ feature {
+ name: "apply_implicit_frameworks"
+ flag_set {
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-framework Foundation"
+ flag: "-framework UIKit"
+ }
+ }
+ }
+ feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
name: "copts"
flag_set {
action: "assemble"
@@ -10118,17 +10094,6 @@ toolchain {
expand_if_all_available: "copts"
}
}
- feature {
- name: "apply_implicit_frameworks"
- flag_set {
- action: "objc-executable"
- action: "objc++-executable"
- flag_group {
- flag: "-framework Foundation"
- flag: "-framework UIKit"
- }
- }
- }
action_config {
config_name: "strip"
action_name: "strip"
@@ -11432,23 +11397,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -11593,23 +11544,17 @@ toolchain {
}
}
feature {
- name: "copts"
+ name: "cpp_linker_flags"
flag_set {
- action: "assemble"
- action: "preprocess-assemble"
- action: "c-compile"
- action: "c++-compile"
- action: "c++-header-parsing"
- action: "c++-header-preprocessing"
- action: "c++-module-compile"
- action: "c++-module-codegen"
- action: "objc-compile"
- action: "objc++-compile"
+ action: "c++-link-executable"
+ action: "c++-link-dynamic-library"
flag_group {
- flag: "%{copts}"
- iterate_over: "copts"
+ flag: "-lc++"
+ flag: "-undefined"
+ flag: "dynamic_lookup"
+ flag: "-target"
+ flag: "arm64-apple-tvos"
}
- expand_if_all_available: "copts"
}
}
feature {
@@ -11624,6 +11569,12 @@ toolchain {
}
}
feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
name: "unfiltered_cxx_flags"
flag_set {
action: "c-compile"
@@ -11639,17 +11590,23 @@ toolchain {
}
}
feature {
- name: "cpp_linker_flags"
+ name: "copts"
flag_set {
- action: "c++-link-executable"
- action: "c++-link-dynamic-library"
+ action: "assemble"
+ action: "preprocess-assemble"
+ action: "c-compile"
+ action: "c++-compile"
+ action: "c++-header-parsing"
+ action: "c++-header-preprocessing"
+ action: "c++-module-compile"
+ action: "c++-module-codegen"
+ action: "objc-compile"
+ action: "objc++-compile"
flag_group {
- flag: "-lc++"
- flag: "-undefined"
- flag: "dynamic_lookup"
- flag: "-target"
- flag: "arm64-apple-tvos"
+ flag: "%{copts}"
+ iterate_over: "copts"
}
+ expand_if_all_available: "copts"
}
}
action_config {
@@ -12963,23 +12920,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -13124,6 +13067,29 @@ toolchain {
}
}
feature {
+ name: "cpp_linker_flags"
+ }
+ feature {
+ name: "apply_implicit_frameworks"
+ flag_set {
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-framework Foundation"
+ flag: "-framework UIKit"
+ }
+ }
+ }
+ feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
name: "copts"
flag_set {
action: "assemble"
@@ -13143,17 +13109,6 @@ toolchain {
expand_if_all_available: "copts"
}
}
- feature {
- name: "apply_implicit_frameworks"
- flag_set {
- action: "objc-executable"
- action: "objc++-executable"
- flag_group {
- flag: "-framework Foundation"
- flag: "-framework UIKit"
- }
- }
- }
action_config {
config_name: "strip"
action_name: "strip"
@@ -14462,23 +14417,9 @@ toolchain {
}
feature {
name: "bitcode_embedded"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode"
- }
- }
}
feature {
name: "bitcode_embedded_markers"
- flag_set {
- action: "objc-compile"
- action: "objc++-compile"
- flag_group {
- flag: "-fembed-bitcode-marker"
- }
- }
}
feature {
name: "objc_arc"
@@ -14623,6 +14564,29 @@ toolchain {
}
}
feature {
+ name: "cpp_linker_flags"
+ }
+ feature {
+ name: "apply_implicit_frameworks"
+ flag_set {
+ action: "objc-executable"
+ action: "objc++-executable"
+ flag_group {
+ flag: "-framework Foundation"
+ flag: "-framework UIKit"
+ }
+ }
+ }
+ feature {
+ name: "link_cocoa"
+ }
+ feature {
+ name: "apply_simulator_compiler_flags"
+ }
+ feature {
+ name: "unfiltered_cxx_flags"
+ }
+ feature {
name: "copts"
flag_set {
action: "assemble"
@@ -14642,17 +14606,6 @@ toolchain {
expand_if_all_available: "copts"
}
}
- feature {
- name: "apply_implicit_frameworks"
- flag_set {
- action: "objc-executable"
- action: "objc++-executable"
- flag_group {
- flag: "-framework Foundation"
- flag: "-framework UIKit"
- }
- }
- }
action_config {
config_name: "strip"
action_name: "strip"