From d3c96e306fe3fe907eb519f6b05e748c21f020cc Mon Sep 17 00:00:00 2001 From: Liangliang He Date: Wed, 9 Jan 2019 11:24:16 +0800 Subject: [PATCH] Fix GNU linker pthread symlink issue and Linaro toolchian download URL. --- WORKSPACE | 4 ++-- tools/arm_compiler/CROSSTOOL | 1 - tools/bazel.rc | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index a719665d..c8e20cee 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -148,7 +148,7 @@ new_http_archive( strip_prefix = "gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf", urls = [ "https://cnbj1.fds.api.xiaomi.com/mace/third-party/gcc-linaro/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz", - "https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz", + "https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz", ], ) @@ -159,6 +159,6 @@ new_http_archive( strip_prefix = "gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu", urls = [ "https://cnbj1.fds.api.xiaomi.com/mace/third-party/gcc-linaro/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz", - "https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz", + "https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz", ], ) diff --git a/tools/arm_compiler/CROSSTOOL b/tools/arm_compiler/CROSSTOOL index 592fb12c..ce7f6d15 100644 --- a/tools/arm_compiler/CROSSTOOL +++ b/tools/arm_compiler/CROSSTOOL @@ -65,7 +65,6 @@ toolchain { cxx_builtin_include_directory: "%package(@gcc_linaro_7_3_1_arm_linux_gnueabihf//arm-linux-gnueabihf/include)%/c++/7.3.1" linker_flag: "--sysroot=external/gcc_linaro_7_3_1_arm_linux_gnueabihf/arm-linux-gnueabihf/libc" - linker_flag: "-fuse-ld=gold" linker_flag: "-Wl,-no-as-needed" linker_flag: "-lstdc++" linker_flag: "-latomic" diff --git a/tools/bazel.rc b/tools/bazel.rc index fc0b9b57..77978ea3 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -18,7 +18,12 @@ build:android --distinct_host_configuration=true build:android --crosstool_top=//external:android/crosstool build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain + # Usage example: bazel build --config arm_linux_gnueabihf +# Used to fix library not find linking issue, see also: +# https://github.com/bazelbuild/bazel/issues/6653, +# https://github.com/bazelbuild/bazel/issues/6189 +build:arm_linux_gnueabihf --spawn_strategy=standalone build:arm_linux_gnueabihf --distinct_host_configuration=true build:arm_linux_gnueabihf --crosstool_top=//tools/arm_compiler:toolchain build:arm_linux_gnueabihf --host_crosstool_top=@bazel_tools//tools/cpp:toolchain @@ -31,6 +36,7 @@ build:arm_linux_gnueabihf --copt -Wno-sequence-point build:arm_linux_gnueabihf --copt -Wno-implicit-fallthrough # Usage example: bazel build --config aarch64_linux_gnu +build:aarch64_linux_gnu --spawn_strategy=standalone build:aarch64_linux_gnu --distinct_host_configuration=true build:aarch64_linux_gnu --crosstool_top=//tools/aarch64_compiler:toolchain build:aarch64_linux_gnu --host_crosstool_top=@bazel_tools//tools/cpp:toolchain -- GitLab