diff options
Diffstat (limited to 'src/test')
4 files changed, 62 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/mock/MOCK_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/analysis/mock/MOCK_CROSSTOOL index 14e38acd44..5f8b523c88 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/mock/MOCK_CROSSTOOL +++ b/src/test/java/com/google/devtools/build/lib/analysis/mock/MOCK_CROSSTOOL @@ -21,6 +21,10 @@ default_toolchain { toolchain_identifier: "local_darwin" } default_toolchain { + cpu: "ios_x86_64" + toolchain_identifier: "local_ios" +} +default_toolchain { cpu: "x64_windows" toolchain_identifier: "local_windows_msys64" } @@ -354,6 +358,52 @@ toolchain { supports_interface_shared_objects: true } +# Stub crosstool to allow construction of apple crosstool configuration in a +# static configuration set. +# TODO(b/33804121): Remove this once dynamic configurations are in place. +toolchain { + toolchain_identifier: "local_ios" + + host_system_name: "local" + target_system_name: "local" + target_cpu: "ios_x86_64" + target_libc: "ios" + compiler: "compiler" + linking_mode_flags { mode: DYNAMIC } + + abi_version: "local" + abi_libc_version: "local" + + tool_path { name: "ar" path: "/usr/bin/libtool" } + tool_path { name: "compat-ld" path: "/usr/bin/ld" } + tool_path { name: "cpp" path: "/usr/bin/cpp" } + tool_path { name: "dwp" path: "/usr/bin/dwp" } + tool_path { name: "gcc" path: "/usr/bin/gcc" } + tool_path { name: "gcov" path: "/usr/bin/gcov" } + tool_path { name: "ld" path: "/usr/bin/ld" } + tool_path { name: "nm" path: "/usr/bin/nm" } + tool_path { name: "objcopy" path: "/usr/bin/objcopy" } + tool_path { name: "objdump" path: "/usr/bin/objdump" } + tool_path { name: "strip" path: "/usr/bin/strip" } + + needsPic: false + + builtin_sysroot: "" + cxx_flag: "-std=c++0x" + ar_flag: "-static" + ar_flag: "-s" + ar_flag: "-o" + linker_flag: "-lstdc++" + cxx_builtin_include_directory: "/usr/include" + cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain" + cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs" + cxx_builtin_include_directory: "/opt/local/include" + cxx_builtin_include_directory: "/Library/Developer/CommandLineTools" + objcopy_embed_flag: "-I" + objcopy_embed_flag: "binary" + supports_interface_shared_objects: true +} + toolchain { toolchain_identifier: "local_windows_mingw" diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java index dd2f474bf0..cc063b146a 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java @@ -87,6 +87,7 @@ public final class BazelMockCcSupport extends MockCcSupport { " 'k8|compiler': ':cc-compiler-k8',", " 'piii|compiler': ':cc-compiler-piii',", " 'darwin|compiler': ':cc-compiler-darwin',", + " 'ios_x86_64|compiler': ':cc-compiler-ios_x86_64',", " 'armeabi-v7a|compiler': ':cc-compiler-armeabi-v7a',", " 'x64_windows|windows_msys64': ':cc-compiler-x64_windows',", " 'ppc|compiler': ':cc-compiler-ppc',", @@ -116,6 +117,13 @@ public final class BazelMockCcSupport extends MockCcSupport { " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", ")", + "cc_toolchain(name = 'cc-compiler-ios_x86_64', all_files = ':empty', ", + " compiler_files = ':empty',", + " cpu = 'local', dwp_files = ':empty', dynamic_runtime_libs = [':empty'], ", + " linker_files = ':empty',", + " module_map = 'crosstool.cppmap', supports_header_parsing = 1,", + " objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',", + ")", "cc_toolchain(name = 'cc-compiler-armeabi-v7a', all_files = ':empty', ", " compiler_files = ':empty',", " cpu = 'local', dwp_files = ':empty', dynamic_runtime_libs = [':empty'], ", diff --git a/src/test/shell/bazel/apple/bazel_apple_test.sh b/src/test/shell/bazel/apple/bazel_apple_test.sh index b1027c34cb..db3a11e1c7 100755 --- a/src/test/shell/bazel/apple/bazel_apple_test.sh +++ b/src/test/shell/bazel/apple/bazel_apple_test.sh @@ -753,8 +753,8 @@ EOF bazel build --verbose_failures --xcode_version=$XCODE_VERSION -s \ //ios:bin >$TEST_log 2>&1 || fail "should build" - expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/local-fastbuild/genfiles/ios/dep/_objs/ios_dep.swiftmodule" - expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/local-fastbuild/genfiles/ios/swift_lib/_objs/ios_swift_lib.swiftmodule" + expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/apple_crosstool-ios_x86_64-fastbuild/genfiles/ios/dep/_objs/ios_dep.swiftmodule" + expect_log "-Xlinker -add_ast_path -Xlinker bazel-out/apple_crosstool-ios_x86_64-fastbuild/genfiles/ios/swift_lib/_objs/ios_swift_lib.swiftmodule" } function test_swiftc_script_mode() { diff --git a/src/test/shell/bazel/apple/bazel_objc_test.sh b/src/test/shell/bazel/apple/bazel_objc_test.sh index 325cb0b0c9..12f9c9153b 100755 --- a/src/test/shell/bazel/apple/bazel_objc_test.sh +++ b/src/test/shell/bazel/apple/bazel_objc_test.sh @@ -207,9 +207,9 @@ EOF # Dec 31 1969 or Jan 1 1970 -- either is fine. # We would use 'date' here, but the format is slightly different (Jan 1 vs. # Jan 01). - ar -tv bazel-bin/objclib/libobjclib.a \ + ar -tv bazel-out/apple_crosstool-ios_x86_64-fastbuild/bin/objclib/libobjclib.a \ | grep "mysrc" | grep "Dec 31" | grep "1969" \ - || ar -tv bazel-bin/objclib/libobjclib.a \ + || ar -tv bazel-out/apple_crosstool-ios_x86_64-fastbuild/bin/objclib/libobjclib.a \ | grep "mysrc" | grep "Jan 1" | grep "1970" || \ fail "Timestamp of contents of archive file should be zero" } |