Skip to content

Commit 2509cc9

Browse files
committed
remove toolchain aliasing for crosstool workaround
prefer to patch aws BUILD files to remove reliance on the `@org_tensorflow//tensorflow:raspberry_pi_armeabi` config setting and the associated and required crosstool naming scheme
1 parent 606aa71 commit 2509cc9

File tree

7 files changed

+26
-46
lines changed

7 files changed

+26
-46
lines changed

Diff for: .bazelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ build:linux_amd64_avx_sse4.2 --define=tag_suffix=linux_amd64_avx_sse4.2
4141

4242
# this config group should not be invoked directly on the command-line
4343
# TODO: remove legacy crosstool when tf supports toolchain resolution
44-
build:common_arm --crosstool_top=@local_config_arm_compiler//:toolchain
44+
build:common_arm --crosstool_top=@com_github_emacski_bazeltools//toolchain/cpp/clang:toolchain
4545
build:common_arm --copt=-funsafe-math-optimizations
4646
build:common_arm --copt=-ftree-vectorize
4747
build:common_arm --copt=-fomit-frame-pointer

Diff for: WORKSPACE

+3-9
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ http_archive(
2626
# x86_64 to arm(64) cross-compile toolchains
2727
register_toolchains("@com_github_emacski_bazeltools//toolchain/cpp/clang:all")
2828

29-
# hack: tf depends on this specific toolchain target name to be used
30-
# as crosstool for one of its config_settings when building for arm
31-
load("//tools/cpp:cc_repo_config.bzl", "cc_repo_config")
32-
33-
cc_repo_config(name = "local_config_arm_compiler")
34-
3529
# project rules
3630

3731
# deb_package
@@ -71,12 +65,12 @@ io_bazel_rules_docker_pip_deps()
7165
http_archive(
7266
name = "org_tensorflow",
7367
patches = [
68+
# align arm cpu config values
69+
"//third_party/tensorflow/aws:BUILD.bazel.patch",
70+
"//third_party/tensorflow/aws:aws-c-common.bazel.patch",
7471
# arm (32-bit) datatype sizes
7572
"//third_party/tensorflow:curl.BUILD.patch",
7673
"//third_party/tensorflow:hwloc.BUILD.bazel.patch",
77-
# use canonical cpu value
78-
# as of tf 2.3.0, this seems to only affect aws deps
79-
"//third_party/tensorflow:BUILD.patch",
8074
],
8175
sha256 = "9c94bfec7214853750c7cacebd079348046f246ec0174d01cd36eda375117628",
8276
strip_prefix = "tensorflow-582c8d236cb079023657287c318ff26adb239002",

Diff for: third_party/tensorflow/BUILD.patch

-11
This file was deleted.
File renamed without changes.

Diff for: third_party/tensorflow/aws/BUILD.bazel.patch

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- third_party/aws/BUILD.bazel 2020-11-23 10:54:13.440058312 -0800
2+
+++ third_party/aws/BUILD.bazel.new 2020-12-16 15:35:03.425176353 -0800
3+
@@ -24,7 +24,7 @@
4+
"@org_tensorflow//tensorflow:linux_ppc64le": glob([
5+
"aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
6+
]),
7+
- "@org_tensorflow//tensorflow:raspberry_pi_armeabi": glob([
8+
+ "@org_tensorflow//tensorflow:arm": glob([
9+
"aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
10+
]),
11+
"@org_tensorflow//tensorflow:freebsd": glob([

Diff for: third_party/tensorflow/aws/aws-c-common.bazel.patch

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- third_party/aws/aws-c-common.bazel 2020-11-23 10:54:13.440058312 -0800
2+
+++ third_party/aws/aws-c-common.bazel.new 2020-12-16 15:34:46.216946839 -0800
3+
@@ -24,7 +24,7 @@
4+
"@org_tensorflow//tensorflow:linux_ppc64le": glob([
5+
"source/posix/*.c",
6+
]),
7+
- "@org_tensorflow//tensorflow:raspberry_pi_armeabi": glob([
8+
+ "@org_tensorflow//tensorflow:arm": glob([
9+
"source/posix/*.c",
10+
]),
11+
"@org_tensorflow//tensorflow:windows": glob([

Diff for: tools/cpp/cc_repo_config.bzl

-25
This file was deleted.

0 commit comments

Comments
 (0)