aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/osx
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-09-20 22:00:15 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-09-21 11:03:51 +0200
commitdc176903da9e84680a1cb2d19b469562e76e570f (patch)
treeb90f8de72b70877b446587c48a9c0e1679410eca /tools/osx
parent3dd22a362730706101ed7deec4ad8a58cd67ec32 (diff)
This time for sure: stop using --undefined dynamic_lookup in osx linking.
For the time being, all C++ links will provide ObjC core libraries on the command line, via having the link actions imply 'contains_objc_sources', which is a built-in feature that is in the process of being enabled automatically when objective-C/C++ sources are involved in the build. Once that happens, the 'imply' directives will be removed. RELNOTES: Stop using --undefined dynamic_lookup in Apple links. Enables unresolved symbol errors. PiperOrigin-RevId: 169437020
Diffstat (limited to 'tools/osx')
-rw-r--r--tools/osx/crosstool/CROSSTOOL.tpl287
1 files changed, 233 insertions, 54 deletions
diff --git a/tools/osx/crosstool/CROSSTOOL.tpl b/tools/osx/crosstool/CROSSTOOL.tpl
index 8abffa5cd7..e2193ddbe5 100644
--- a/tools/osx/crosstool/CROSSTOOL.tpl
+++ b/tools/osx/crosstool/CROSSTOOL.tpl
@@ -118,9 +118,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
@@ -144,6 +143,8 @@ toolchain {
}
linking_mode_flags {
mode: DYNAMIC
+ linker_flag: "-undefined"
+ linker_flag: "dynamic_lookup"
}
make_variable {
name: "STACK_FRAME_UNLIMITED"
@@ -205,6 +206,17 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -1505,6 +1517,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -1526,6 +1539,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -1604,6 +1618,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -1704,9 +1719,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "x86_64-apple-ios"
@@ -1730,9 +1744,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -1795,6 +1806,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -3102,6 +3133,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -3123,6 +3155,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -3201,6 +3234,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -3301,9 +3335,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "i386-apple-ios"
@@ -3327,9 +3360,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -3392,6 +3422,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -4701,6 +4751,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -4722,6 +4773,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -4800,6 +4852,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -4900,9 +4953,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "x86_64-apple-tvos"
@@ -4927,9 +4979,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -4992,6 +5041,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -5831,8 +5900,6 @@ toolchain {
action: "c++-link-dynamic-library"
flag_group {
flag: "-lc++"
- flag: "-undefined"
- flag: "dynamic_lookup"
flag: "-target"
flag: "x86_64-apple-tvos"
}
@@ -6329,6 +6396,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -6351,6 +6419,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -6430,6 +6499,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -6530,9 +6600,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "i386-apple-ios"
@@ -6556,9 +6625,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -6621,6 +6687,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -7928,6 +8014,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -7949,6 +8036,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -8027,6 +8115,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -8127,9 +8216,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "armv7-apple-ios"
@@ -8153,9 +8241,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -8218,6 +8303,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -9513,6 +9618,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -9534,6 +9640,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -9612,6 +9719,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -9712,9 +9820,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "armv7-apple-watchos"
@@ -9738,9 +9845,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -9803,6 +9907,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -11100,6 +11224,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -11121,6 +11246,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -11199,6 +11325,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -11299,9 +11426,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "arm64-apple-tvos"
@@ -11326,9 +11452,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -11391,6 +11514,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -12230,8 +12373,6 @@ toolchain {
action: "c++-link-dynamic-library"
flag_group {
flag: "-lc++"
- flag: "-undefined"
- flag: "dynamic_lookup"
flag: "-target"
flag: "arm64-apple-tvos"
}
@@ -12716,6 +12857,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -12738,6 +12880,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -12817,6 +12960,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -12917,9 +13061,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
linker_flag: "-target"
linker_flag: "arm64-apple-ios"
@@ -12943,9 +13086,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -13008,6 +13148,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -14303,6 +14463,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -14324,6 +14485,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -14402,6 +14564,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}
@@ -14503,9 +14666,8 @@ toolchain {
compiler_flag: "-Wself-assign"
compiler_flag: "-fno-omit-frame-pointer"
cxx_flag: "-std=c++11"
- linker_flag: "-undefined"
- linker_flag: "dynamic_lookup"
linker_flag: "-headerpad_max_install_names"
+ linker_flag: "-lc++"
linker_flag: "-no-canonical-prefixes"
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
@@ -14528,12 +14690,6 @@ toolchain {
mode: DBG
compiler_flag: "-g"
}
- linking_mode_flags {
- mode: DYNAMIC
- }
- linking_mode_flags {
- mode: DYNAMIC
- }
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
@@ -14599,6 +14755,26 @@ toolchain {
}
}
feature {
+ name: "contains_objc_source"
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-fobjc-link-runtime"
+ }
+ }
+ flag_set {
+ action: "c++-link-interface-dynamic-library"
+ action: "c++-link-dynamic-library"
+ action: "c++-link-executable"
+ flag_group {
+ flag: "-framework"
+ flag: "UIKit"
+ }
+ }
+ }
+ feature {
name: "objc_actions"
implies: "objc-compile"
implies: "objc++-compile"
@@ -15894,6 +16070,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "symbol_counts"
implies: "linkstamps"
implies: "output_execpath_flags_executable"
@@ -15915,6 +16092,7 @@ toolchain {
tool_path: "cc_wrapper.sh"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "has_configured_linker_path"
implies: "symbol_counts"
implies: "shared_flag"
@@ -15993,6 +16171,7 @@ toolchain {
tool_path: "wrapped_clang"
execution_requirement: "requires-darwin"
}
+ implies: "contains_objc_source"
implies: "strip_debug_symbols"
implies: "apple_env"
}