Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
318 lines (263 sloc) 9.87 KB
# Copyright 2016 The Bazel Authors. All rights reserved.
# Copyright 2018-2019 Josh Pieper, jjp@pobox.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
major_version: "local"
minor_version: ""
default_target_cpu: "same_as_host"
default_toolchain {
cpu: "k8"
toolchain_identifier: "clang-x86_64"
}
default_toolchain {
cpu: "armeabihf"
toolchain_identifier: "clang-armeabihf"
}
toolchain {
toolchain_identifier: "clang-x86_64"
abi_version: "local"
abi_libc_version: "local"
builtin_sysroot: ""
compiler: "clang"
host_system_name: "local"
target_libc: "local"
target_cpu: "k8"
target_system_name: "local"
tool_path { name: "ar" path: "wrapper/clang-ar" }
tool_path { name: "cpp" path: "wrapper/clang-cpp" }
tool_path { name: "dwp" path: "wrapper/clang-dwp" }
tool_path { name: "gcc" path: "wrapper/clang-clang" }
tool_path { name: "gcov" path: "" }
tool_path { name: "ld" path: "wrapper/clang-lld" }
tool_path { name: "nm" path: "wrapper/clang-nm" }
tool_path { name: "objcopy" path: "wrapper/clang-objcopy" }
tool_path { name: "objdump" path: "wrapper/clang-objdump" }
tool_path { name: "strip" path: "wrapper/clang-strip" }
supports_gold_linker: false
supports_thin_archives: true
supports_start_end_lib: true
supports_interface_shared_objects: true
supports_embedded_runtimes: true
supports_incremental_linker: true
supports_normalizing_ar: true
supports_fission: true
needsPic: true
cxx_builtin_include_directory: "external/org_llvm_clang/include/"
cxx_builtin_include_directory: "external/org_llvm_clang/lib/clang/7.0.0/include/"
cxx_builtin_include_directory: "/usr/include/"
# bazel currently insists on passing "-static-libgcc" for some reason
linker_flag: "-Wno-unused-command-line-argument"
cxx_flag: "-std=c++17"
# We rely on a compiled version of libcxx, which for now users must
# manually specify when linking applications (but not compiling).
cxx_flag: "-nostdinc++"
linker_flag: "-nostdinc++"
linker_flag: "-nostdlib++"
cxx_flag: "-isystem"
cxx_flag: "external/org_llvm_libcxx/include"
cxx_flag: "-isystem"
cxx_flag: "external/org_llvm_libcxxabi/include"
linker_flag: "-fuse-ld=lld"
linker_flag: "-rtlib=compiler-rt"
linker_flag: "-lm"
linker_flag: "-lpthread"
linker_flag: "-ldl"
linker_flag: "-lrt"
objcopy_embed_flag: ["-I", "binary"]
# 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: "-D_FORTIFY_SOURCE=1"
compiler_flag: "-fstack-protector"
linker_flag: "-Wl,-z,relro,-z,now"
compiler_flag: "-Wall"
compiler_flag: "-Wextra"
unfiltered_cxx_flag: "-no-canonical-prefixes"
compiler_flag: "-no-canonical-prefixes"
# 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: "-ggdb"
compiler_flag: "-fstandalone-debug"
linker_flag: "-ggdb"
compiler_flag: "-O0"
}
compilation_mode_flags {
mode: FASTBUILD
compiler_flag: "-ggdb"
compiler_flag: "-fstandalone-debug"
linker_flag: "-ggdb"
compiler_flag: "-O1"
}
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: "-ggdb"
compiler_flag: "-fstandalone-debug"
linker_flag: "-ggdb"
# 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"
}
# This overrides the default runtime_library_search_directories because the default one uses
# $EXEC_ORIGIN which isn't supported on ubuntu 14.04 or 16.04
feature {
name: 'runtime_library_search_directories',
flag_set {
expand_if_all_available: 'runtime_library_search_directories'
action: 'c++-link-executable'
action: 'c++-link-dynamic-library'
action: 'c++-link-nodeps-dynamic-library'
flag_group {
iterate_over: 'runtime_library_search_directories'
flag_group {
flag: '-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}'
}
}
}
}
}
toolchain {
toolchain_identifier: "clang-armeabihf"
abi_version: "local"
abi_libc_version: "local"
builtin_sysroot: ""
compiler: "clang"
host_system_name: "local"
target_libc: "local"
target_cpu: "armeabihf"
target_system_name: "arm-linux-armeabihf"
tool_path { name: "ar" path: "wrapper/clang-ar" }
tool_path { name: "cpp" path: "wrapper/clang-cpp" }
tool_path { name: "dwp" path: "wrapper/clang-dwp" }
tool_path { name: "gcc" path: "wrapper/clang-clang" }
tool_path { name: "gcov" path: "" }
tool_path { name: "ld" path: "wrapper/clang-lld" }
tool_path { name: "nm" path: "wrapper/clang-nm" }
tool_path { name: "objcopy" path: "wrapper/clang-objcopy" }
tool_path { name: "objdump" path: "wrapper/clang-objdump" }
tool_path { name: "strip" path: "wrapper/clang-strip" }
supports_gold_linker: false
supports_thin_archives: true
supports_start_end_lib: true
supports_interface_shared_objects: true
supports_embedded_runtimes: true
supports_incremental_linker: true
supports_normalizing_ar: true
supports_fission: true
needsPic: true
cxx_builtin_include_directory: "external/raspberry_pi/sysroot/usr/include/arm-linux-gnueabihf"
cxx_builtin_include_directory: "external/raspberry_pi/sysroot/usr/include"
cxx_builtin_include_directory: "external/org_llvm_clang/include/"
cxx_builtin_include_directory: "external/org_llvm_clang/lib/clang/7.0.0/include/"
cxx_builtin_include_directory: "/usr/include/"
# bazel currently insists on passing "-static-libgcc" for some reason
linker_flag: "-Wno-unused-command-line-argument"
cxx_flag: "-std=c++17"
# We rely on a compiled version of libcxx, which for now users must
# manually specify when linking applications (but not compiling).
cxx_flag: "-nostdinc++"
linker_flag: "-nostdinc++"
linker_flag: "-nostdlib++"
cxx_flag: "-isystem"
cxx_flag: "external/org_llvm_libcxx/include"
cxx_flag: "-isystem"
cxx_flag: "external/org_llvm_libcxxabi/include"
linker_flag: "-fuse-ld=lld"
linker_flag: "-lm"
linker_flag: "-lpthread"
linker_flag: "-ldl"
linker_flag: "-lrt"
objcopy_embed_flag: ["-I", "binary"]
# 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: "-D_FORTIFY_SOURCE=1"
compiler_flag: "-fstack-protector"
linker_flag: "-Wl,-z,relro,-z,now"
compiler_flag: "-Wall"
compiler_flag: "-Wextra"
unfiltered_cxx_flag: "-no-canonical-prefixes"
compiler_flag: "-no-canonical-prefixes"
# Keep stack frames for debugging, even in opt mode.
compiler_flag: "-fno-omit-frame-pointer"
linker_flag: "--target=armv7-linux-gnueabihf"
linker_flag: "--sysroot=external/raspberry_pi/sysroot"
linker_flag: "-Wl,-no-as-needed"
linker_flag: "-Wl,-z,relro,-z,now"
linker_flag: "-B/usr/bin"
linker_flag: "-B/usr/bin"
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
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\""
compiler_flag: "--target=armv7-linux-gnueabihf"
compiler_flag: "-DMB_LEN_MAX=16"
compiler_flag: "-B/usr/bin"
compiler_flag: "-B/usr/bin"
compiler_flag: "-fcolor-diagnostics"
compiler_flag: "-ffreestanding"
compiler_flag: "-fno-omit-frame-pointer"
compiler_flag: "-isysroot=external/raspberry_pi/sysroot"
compiler_flag: "--sysroot=external/raspberry_pi/sysroot"
compilation_mode_flags {
mode: DBG
compiler_flag: "-g"
linker_flag: "-g"
}
compilation_mode_flags {
mode: FASTBUILD
compiler_flag: "-g"
linker_flag: "-g"
}
compilation_mode_flags {
mode: OPT
compiler_flag: "-g"
compiler_flag: "-O2"
compiler_flag: "-ffunction-sections"
compiler_flag: "-fdata-sections"
linker_flag: "-Wl,--gc-sections"
linker_flag: "-g"
}
linking_mode_flags { mode: DYNAMIC }
}
You can’t perform that action at this time.