Skip to content

Instantly share code, notes, and snippets.

@evadeflow
Created July 5, 2018 16:40
Show Gist options
  • Save evadeflow/d58895eb31d424958fd19bc351ceadc7 to your computer and use it in GitHub Desktop.
Save evadeflow/d58895eb31d424958fd19bc351ceadc7 to your computer and use it in GitHub Desktop.
Patch to cross-compile tensorflow
diff --git a/WORKSPACE b/WORKSPACE
index 11c5cdb..33c5a3c 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -95,3 +95,9 @@ new_http_archive(
"http://download.tensorflow.org/models/speech_commands_v0.01.zip",
],
)
+
+new_local_repository(
+ name = 'org_linaro_components_toolchain_gcc_5_3_1',
+ build_file = 'compilers/linaro_linux_gcc_5.3.1.BUILD',
+ path = "/home/evadeflow/Desktop/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf",
+)
diff --git a/compilers/linaro_linux_gcc_5.3.1.BUILD b/compilers/linaro_linux_gcc_5.3.1.BUILD
new file mode 100644
index 0000000..b231d01
--- /dev/null
+++ b/compilers/linaro_linux_gcc_5.3.1.BUILD
@@ -0,0 +1,81 @@
+package(default_visibility = ['//visibility:public'])
+
+filegroup(
+ name = 'gcc',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-gcc',
+ ],
+)
+
+filegroup(
+ name = 'ar',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-ar',
+ ],
+)
+
+filegroup(
+ name = 'ld',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-ld',
+ ],
+)
+
+filegroup(
+ name = 'nm',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-nm',
+ ],
+)
+
+filegroup(
+ name = 'objcopy',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-objcopy',
+ ],
+)
+
+filegroup(
+ name = 'objdump',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-objdump',
+ ],
+)
+
+filegroup(
+ name = 'strip',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-strip',
+ ],
+)
+
+filegroup(
+ name = 'as',
+ srcs = [
+ 'bin/arm-linux-gnueabihf-as',
+ ],
+)
+
+filegroup(
+ name = 'compiler_pieces',
+ srcs = glob([
+ 'arm-linux-gnueabihf/**',
+ 'libexec/**',
+ 'lib/gcc/arm-linux-gnueabihf/**',
+ 'include/**',
+ ]),
+)
+
+filegroup(
+ name = 'compiler_components',
+ srcs = [
+ ':gcc',
+ ':ar',
+ ':ld',
+ ':nm',
+ ':objcopy',
+ ':objdump',
+ ':strip',
+ ':as',
+ ],
+)
diff --git a/third_party/jpeg/jpeg.BUILD b/third_party/jpeg/jpeg.BUILD
index 4418ac3..b5739ee 100644
--- a/third_party/jpeg/jpeg.BUILD
+++ b/third_party/jpeg/jpeg.BUILD
@@ -31,7 +31,7 @@ libjpegturbo_copts = select({
":armeabi-v7a": [
"-D__ARM_NEON__",
"-march=armv7-a",
- "-mfloat-abi=softfp",
+ "-mfloat-abi=hard",
"-fprefetch-loop-arrays",
],
":linux_ppc64le": [
@@ -272,8 +272,10 @@ cc_library(
"jchuff.h",
"jconfig.h",
"jdct.h",
+ "jerror.h",
"jinclude.h",
"jmorecfg.h",
+ "jpegint.h",
"jpeglib.h",
"jsimd.h",
"jsimddct.h",
diff --git a/tools/arm_compiler/BUILD b/tools/arm_compiler/BUILD
new file mode 100644
index 0000000..7acd4e6
--- /dev/null
+++ b/tools/arm_compiler/BUILD
@@ -0,0 +1,103 @@
+# This is the entry point for --crosstool_top. Toolchains are found
+# by lopping off the name of --crosstool_top and searching for
+# 'cc-compiler-${CPU}' in this BUILD file, where CPU is the target CPU
+# specified in --cpu.
+#
+# This file group should include
+# * all cc_toolchain targets supported
+# * all file groups that said cc_toolchain might refer to,
+# including the default_grte_top setting in the CROSSTOOL
+# protobuf.
+filegroup(
+ name = "toolchain_fg",
+ srcs = [
+ ":cc-compiler-armeabi-v7a",
+ ":cc-compiler-k8",
+ ":linaro_linux_all_files",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:compiler_components",
+ ],
+)
+
+filegroup(
+ name = "srcs",
+ srcs = glob(["**"]) + [
+ "//src/test/shell/bazel/testdata/bazel_toolchain_test_data/tools/arm_compiler/linaro_linux_gcc:srcs",
+ ],
+ visibility = ["//src/test/shell/bazel/testdata/bazel_toolchain_test_data:__pkg__"],
+)
+
+cc_toolchain_suite(
+ name = "toolchain",
+ # target_cpu | compiler
+ toolchains = {
+ "armeabi-v7a|gcc": "cc-compiler-armeabi-v7a",
+ "k8|compiler": "cc-compiler-k8",
+ },
+ visibility = ["//visibility:public"],
+)
+
+filegroup(
+ name = "linaro_linux_all_files",
+ srcs = [
+ "//tools/arm_compiler/linaro_linux_gcc:tool-wrappers",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:compiler_pieces",
+ ],
+)
+
+filegroup(
+ name = "linaro_linux_linker_files",
+ srcs = [
+ "//tools/arm_compiler/linaro_linux_gcc:ar",
+ "//tools/arm_compiler/linaro_linux_gcc:gcc",
+ "//tools/arm_compiler/linaro_linux_gcc:ld",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:compiler_pieces",
+ ],
+)
+
+filegroup(
+ name = "linaro_linux_compiler_files",
+ srcs = [
+ "//tools/arm_compiler/linaro_linux_gcc:as",
+ "//tools/arm_compiler/linaro_linux_gcc:gcc",
+ "//tools/arm_compiler/linaro_linux_gcc:ld",
+ ],
+)
+
+filegroup(
+ name = "empty",
+ srcs = [],
+)
+
+cc_toolchain(
+ name = "cc-compiler-armeabi-v7a",
+ all_files = ":linaro_linux_all_files",
+ ar_files = "//tools/arm_compiler/linaro_linux_gcc:ar",
+ as_files = "//tools/arm_compiler/linaro_linux_gcc:as",
+ compiler_files = ":linaro_linux_compiler_files",
+ cpu = "armeabi-v7a",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":linaro_linux_linker_files",
+ objcopy_files = "//tools/arm_compiler/linaro_linux_gcc:objcopy",
+ static_runtime_libs = [":empty"],
+ strip_files = "//tools/arm_compiler/linaro_linux_gcc:strip",
+ supports_param_files = 1,
+ visibility = ["//visibility:public"],
+)
+
+cc_toolchain(
+ name = "cc-compiler-k8",
+ all_files = ":empty",
+ ar_files = ":empty",
+ as_files = ":empty",
+ compiler_files = ":empty",
+ cpu = "local",
+ dwp_files = ":empty",
+ dynamic_runtime_libs = [":empty"],
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ static_runtime_libs = [":empty"],
+ strip_files = ":empty",
+ supports_param_files = 1,
+ visibility = ["//visibility:public"],
+)
diff --git a/tools/arm_compiler/CROSSTOOL b/tools/arm_compiler/CROSSTOOL
new file mode 100644
index 0000000..d12988b
--- /dev/null
+++ b/tools/arm_compiler/CROSSTOOL
@@ -0,0 +1,249 @@
+major_version: "local"
+minor_version: ""
+default_target_cpu: "armeabi-v7a"
+
+default_toolchain {
+ cpu: "armeabi-v7a"
+ toolchain_identifier: "clang_linux_armhf"
+}
+
+default_toolchain {
+ cpu: "k8"
+ toolchain_identifier: "local"
+}
+
+toolchain {
+ abi_version: "gcc"
+ abi_libc_version: "glibc_2.19"
+ builtin_sysroot: ""
+ compiler: "gcc"
+ host_system_name: "armeabi-v7a"
+ needsPic: true
+ supports_gold_linker: false
+ supports_incremental_linker: false
+ supports_fission: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: true
+ supports_start_end_lib: false
+ supports_thin_archives: true
+ target_libc: "glibc_2.19"
+ target_cpu: "armeabi-v7a"
+ target_system_name: "arm_a15"
+ toolchain_identifier: "clang_linux_armhf"
+
+ tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" }
+ tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
+ tool_path { name: "cpp" path: "linaro_linux_gcc/arm-linux-gnueabihf-gcc" }
+ tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" }
+ tool_path { name: "gcc" path: "linaro_linux_gcc/arm-linux-gnueabihf-gcc" }
+ tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
+ # C(++) compiles invoke the compiler (as that is the one knowing where
+ # to find libraries), but we provide LD so other rules can invoke the linker.
+ tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
+ tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" }
+ tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" }
+ objcopy_embed_flag: "-I"
+ objcopy_embed_flag: "binary"
+ tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" }
+ tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" }
+
+ compiler_flag: "--sysroot=external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc"
+ compiler_flag: "-mfloat-abi=hard"
+
+ compiler_flag: "-std=c++11"
+
+ compiler_flag: "-nostdinc"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/lib/gcc/arm-linux-gnueabihf/5.3.1/include"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc/usr/include"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc/usr/include"
+
+ # DEW - It's messed up, but... we have to include these C++ flags here even
+ # when compiling `.c` files because many of them wind up including C++
+ # headers somewhere along their include chain.
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/include/c++/5.3.1"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/include/c++/5.3.1/arm-linux-gnueabihf"
+ compiler_flag: "-isystem"
+ compiler_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/include/c++/5.3.1"
+
+ cxx_flag: "-isystem"
+ cxx_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf"
+ cxx_flag: "-isystem"
+ cxx_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/include/c++/5.3.1"
+ cxx_flag: "-isystem"
+ cxx_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/include/c++/5.3.1/arm-linux-gnueabihf"
+ cxx_flag: "-isystem"
+ cxx_flag: "external/org_linaro_components_toolchain_gcc_5_3_1/include/c++/5.3.1"
+
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//include)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/libc/usr/include)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/libc/usr/lib/include)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//include)%/c++/5.3.1"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/5.3.1/include)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//lib/gcc/arm-linux-gnueabihf/5.3.1/include)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed)%"
+ cxx_builtin_include_directory: "%package(@org_linaro_components_toolchain_gcc_5_3_1//arm-linux-gnueabihf/include)%/c++/5.3.1"
+
+ linker_flag: "--sysroot=external/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc"
+ linker_flag: "-lstdc++"
+ linker_flag: "-latomic"
+ linker_flag: "-lm"
+ linker_flag: "-lpthread"
+ linker_flag: "-Ltools/arm_compiler/linaro_linux_gcc/clang_more_libs"
+ linker_flag: "-Lexternal/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/lib"
+ linker_flag: "-Lexternal/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc/lib"
+ linker_flag: "-Lexternal/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/libc/usr/lib"
+ linker_flag: "-Bexternal/org_linaro_components_toolchain_gcc_5_3_1/arm-linux-gnueabihf/bin"
+ linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3"
+
+ # Anticipated future default.
+ # This makes GCC and Clang do what we want when called through symlinks.
+ unfiltered_cxx_flag: "-no-canonical-prefixes"
+ linker_flag: "-no-canonical-prefixes"
+
+ # Make C++ compilation deterministic. Use linkstamping instead of these
+ # compiler symbols.
+ unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
+ unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
+
+ # Security hardening on by default.
+ # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
+ # We need to undef it before redefining it as some distributions now have
+ # it enabled by default.
+ compiler_flag: "-U_FORTIFY_SOURCE"
+ compiler_flag: "-fstack-protector"
+ compiler_flag: "-fPIE"
+ linker_flag: "-pie"
+ linker_flag: "-Wl,-z,relro,-z,now"
+
+ # Enable coloring even if there's no attached terminal. Bazel removes the
+ # escape sequences if --nocolor is specified.
+ compiler_flag: "-fdiagnostics-color=always"
+
+ # All warnings are enabled. Maybe enable -Werror as well?
+ compiler_flag: "-Wall"
+ # Enable a few more warnings that aren't part of -Wall.
+ compiler_flag: "-Wunused-but-set-parameter"
+ # But disable some that are problematic.
+ compiler_flag: "-Wno-free-nonheap-object" # has false positives
+
+ # Keep stack frames for debugging, even in opt mode.
+ compiler_flag: "-fno-omit-frame-pointer"
+
+ compilation_mode_flags {
+ mode: DBG
+ # Enable debug symbols.
+ compiler_flag: "-g"
+ }
+ compilation_mode_flags {
+ mode: OPT
+ # No debug symbols.
+ # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
+ # even generally? However, that can't happen here, as it requires special
+ # handling in Bazel.
+ compiler_flag: "-g0"
+
+ # Conservative choice for -O
+ # -O3 can increase binary size and even slow down the resulting binaries.
+ # Profile first and / or use FDO if you need better performance than this.
+ compiler_flag: "-O2"
+
+ # Disable assertions
+ compiler_flag: "-DNDEBUG"
+
+ # Removal of unused code and data at link time (can this increase binary size in some cases?).
+ compiler_flag: "-ffunction-sections"
+ compiler_flag: "-fdata-sections"
+ linker_flag: "-Wl,--gc-sections"
+ }
+}
+
+toolchain {
+ toolchain_identifier: "local"
+ abi_libc_version: "local"
+ abi_version: "local"
+ builtin_sysroot: ""
+ compiler: "compiler"
+ compiler_flag: "-U_FORTIFY_SOURCE"
+ compiler_flag: "-D_FORTIFY_SOURCE=2"
+ compiler_flag: "-fstack-protector"
+ compiler_flag: "-Wall"
+ compiler_flag: "-Wl,-z,-relro,-z,now"
+ compiler_flag: "-B/usr/bin"
+ compiler_flag: "-B/usr/bin"
+ compiler_flag: "-Wunused-but-set-parameter"
+ compiler_flag: "-Wno-free-nonheap-object"
+ compiler_flag: "-fno-omit-frame-pointer"
+ cxx_builtin_include_directory: "/usr/include/c++/4.8"
+ cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu/c++/4.8"
+ cxx_builtin_include_directory: "/usr/include/c++/4.8/backward"
+ cxx_builtin_include_directory: "/usr/lib/gcc/x86_64-linux-gnu/4.8/include"
+ cxx_builtin_include_directory: "/usr/local/include"
+ cxx_builtin_include_directory: "/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed"
+ cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu"
+ cxx_builtin_include_directory: "/usr/include"
+ cxx_builtin_include_directory: "/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include"
+ cxx_flag: "-std=c++0x"
+ host_system_name: "local"
+ linker_flag: "-lstdc++"
+ linker_flag: "-lm"
+ linker_flag: "-Wl,-no-as-needed"
+ linker_flag: "-B/usr/bin"
+ linker_flag: "-B/usr/bin"
+ linker_flag: "-pass-exit-codes"
+ needsPic: true
+ objcopy_embed_flag: "-I"
+ objcopy_embed_flag: "binary"
+ supports_fission: false
+ supports_gold_linker: false
+ supports_incremental_linker: false
+ supports_interface_shared_objects: false
+ supports_normalizing_ar: false
+ supports_start_end_lib: false
+ supports_thin_archives: false
+ target_cpu: "k8"
+ target_libc: "local"
+ target_system_name: "local"
+ unfiltered_cxx_flag: "-fno-canonical-system-headers"
+ unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
+ unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
+ unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
+ tool_path {name: "ar" path: "/usr/bin/ar" }
+ 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" }
+
+ compilation_mode_flags {
+ mode: DBG
+ compiler_flag: "-g"
+ }
+ compilation_mode_flags {
+ mode: OPT
+ compiler_flag: "-g0"
+ compiler_flag: "-O2"
+ compiler_flag: "-DNDEBUG"
+ compiler_flag: "-ffunction-sections"
+ compiler_flag: "-fdata-sections"
+ linker_flag: "-Wl,--gc-sections"
+ }
+ linking_mode_flags { mode: DYNAMIC }
+}
diff --git a/tools/arm_compiler/linaro_linux_gcc/BUILD b/tools/arm_compiler/linaro_linux_gcc/BUILD
new file mode 100644
index 0000000..eb686e8
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/BUILD
@@ -0,0 +1,85 @@
+package(default_visibility = ["//tools/arm_compiler:__pkg__"])
+
+filegroup(
+ name = "srcs",
+ srcs = glob(["**"]),
+ visibility = ["//src/test/shell/bazel/testdata/bazel_toolchain_test_data/tools/arm_compiler:__pkg__"],
+)
+
+filegroup(
+ name = "gcc",
+ srcs = [
+ "arm-linux-gnueabihf-gcc",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:gcc",
+ ],
+)
+
+filegroup(
+ name = "ar",
+ srcs = [
+ "arm-linux-gnueabihf-ar",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:ar",
+ ],
+)
+
+filegroup(
+ name = "ld",
+ srcs = [
+ "arm-linux-gnueabihf-ld",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:ld",
+ ],
+)
+
+filegroup(
+ name = "nm",
+ srcs = [
+ "arm-linux-gnueabihf-nm",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:nm",
+ ],
+)
+
+filegroup(
+ name = "objcopy",
+ srcs = [
+ "arm-linux-gnueabihf-objcopy",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:objcopy",
+ ],
+)
+
+filegroup(
+ name = "objdump",
+ srcs = [
+ "arm-linux-gnueabihf-objdump",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:objdump",
+ ],
+)
+
+filegroup(
+ name = "strip",
+ srcs = [
+ "arm-linux-gnueabihf-strip",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:strip",
+ ],
+)
+
+filegroup(
+ name = "as",
+ srcs = [
+ "arm-linux-gnueabihf-as",
+ "@org_linaro_components_toolchain_gcc_5_3_1//:as",
+ ],
+)
+
+filegroup(
+ name = "tool-wrappers",
+ srcs = [
+ ":ar",
+ ":as",
+ ":gcc",
+ ":ld",
+ ":nm",
+ ":objcopy",
+ ":objdump",
+ ":strip",
+ ],
+)
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ar b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ar
new file mode 100755
index 0000000..c84ed27
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ar
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-ar \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-ar \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-as b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-as
new file mode 100755
index 0000000..7738e76
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-as
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-as \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-as \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-gcc b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-gcc
new file mode 100755
index 0000000..ffc3967
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-gcc
@@ -0,0 +1,6 @@
+#!/bin/bash --norc
+
+PATH="external/org_linaro_components_toolchain_gcc_5_3_1/libexec/gcc/arm-linux-gnueabihf/4.9.3:$PATH" \
+ exec \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-gcc \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ld b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ld
new file mode 100755
index 0000000..b56a1c1
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-ld
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-ld \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-ld \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-nm b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-nm
new file mode 100755
index 0000000..c802e5b
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-nm
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-nm \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-nm \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objcopy b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objcopy
new file mode 100755
index 0000000..503184b
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objcopy
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-objcopy \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-objcopy \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objdump b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objdump
new file mode 100755
index 0000000..5c9667a
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-objdump
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-objdump \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-objdump \
+ "$@"
diff --git a/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-strip b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-strip
new file mode 100755
index 0000000..9e71cbf
--- /dev/null
+++ b/tools/arm_compiler/linaro_linux_gcc/arm-linux-gnueabihf-strip
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-linux-gnueabihf-strip \
+ external/org_linaro_components_toolchain_gcc_5_3_1/bin/arm-linux-gnueabihf-strip \
+ "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment