github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/third_party/sycl/crosstool/CROSSTOOL.tpl (about) 1 major_version: "local" 2 minor_version: "" 3 default_target_cpu: "same_as_host" 4 5 default_toolchain { 6 cpu: "k8" 7 toolchain_identifier: "local_linux" 8 } 9 10 default_toolchain { 11 cpu: "arm" 12 toolchain_identifier: "local_arm" 13 } 14 15 toolchain { 16 abi_version: "local" 17 abi_libc_version: "local" 18 builtin_sysroot: "" 19 compiler: "compiler" 20 host_system_name: "local" 21 needsPic: true 22 supports_gold_linker: false 23 supports_incremental_linker: false 24 supports_fission: false 25 supports_interface_shared_objects: false 26 supports_normalizing_ar: false 27 supports_start_end_lib: false 28 supports_thin_archives: false 29 target_libc: "local" 30 target_cpu: "local" 31 target_system_name: "local" 32 toolchain_identifier: "local_linux" 33 34 tool_path { name: "ar" path: "/usr/bin/ar" } 35 tool_path { name: "compat-ld" path: "/usr/bin/ld" } 36 tool_path { name: "cpp" path: "/usr/bin/cpp" } 37 tool_path { name: "dwp" path: "/usr/bin/dwp" } 38 tool_path { name: "gcc" path: "%{sycl_impl}" } 39 # Use "-std=c++11" for nvcc. For consistency, force both the host compiler 40 # and the device compiler to use "-std=c++11". 41 cxx_flag: "%{c++_std}" 42 linker_flag: "-Wl,-no-as-needed" 43 linker_flag: "-lstdc++" 44 linker_flag: "-B/usr/bin/" 45 46 # TODO(bazel-team): In theory, the path here ought to exactly match the path 47 # used by gcc. That works because bazel currently doesn't track files at 48 # absolute locations and has no remote execution, yet. However, this will need 49 # to be fixed, maybe with auto-detection? 50 cxx_builtin_include_directory: "/usr/lib/gcc/" 51 cxx_builtin_include_directory: "/usr/lib" 52 cxx_builtin_include_directory: "/usr/lib64" 53 cxx_builtin_include_directory: "/usr/local/include" 54 cxx_builtin_include_directory: "/usr/include" 55 56 cxx_builtin_include_directory: "%{sycl_include_dir}" 57 cxx_builtin_include_directory: "%{python_lib_path}" 58 59 tool_path { name: "gcov" path: "/usr/bin/gcov" } 60 61 # C(++) compiles invoke the compiler (as that is the one knowing where 62 # to find libraries), but we provide LD so other rules can invoke the linker. 63 tool_path { name: "ld" path: "/usr/bin/ld" } 64 65 tool_path { name: "nm" path: "/usr/bin/nm" } 66 tool_path { name: "objcopy" path: "/usr/bin/objcopy" } 67 objcopy_embed_flag: "-I" 68 objcopy_embed_flag: "binary" 69 tool_path { name: "objdump" path: "/usr/bin/objdump" } 70 tool_path { name: "strip" path: "/usr/bin/strip" } 71 72 # Make C++ compilation deterministic. Use linkstamping instead of these 73 # compiler symbols. 74 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" 75 unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" 76 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" 77 unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" 78 79 compiler_flag: "-fPIE" 80 81 # Keep stack frames for debugging, even in opt mode. 82 compiler_flag: "-fno-omit-frame-pointer" 83 84 # Anticipated future default. 85 linker_flag: "-no-canonical-prefixes" 86 unfiltered_cxx_flag: "-fno-canonical-system-headers" 87 88 # Have gcc return the exit code from ld. 89 linker_flag: "-pass-exit-codes" 90 91 # All warnings are enabled. Maybe enable -Werror as well? 92 compiler_flag: "-Wall" 93 94 # Enable SSE instructions by default 95 compiler_flag: "-msse3" 96 97 # Anticipated future default. 98 linker_flag: "-Wl,-no-as-needed" 99 # Stamp the binary with a unique identifier. 100 linker_flag: "-Wl,--build-id=md5" 101 linker_flag: "-Wl,--hash-style=gnu" 102 103 linking_mode_flags { mode: DYNAMIC } 104 105 compilation_mode_flags { 106 mode: FASTBUILD 107 compiler_flag: "-O0" 108 } 109 110 compilation_mode_flags { 111 mode: DBG 112 compiler_flag: "-g" 113 } 114 115 compilation_mode_flags { 116 mode: OPT 117 compiler_flag: "-g0" 118 compiler_flag: "-O2" 119 compiler_flag: "-DNDEBUG" 120 compiler_flag: "-ffunction-sections" 121 compiler_flag: "-fdata-sections" 122 linker_flag: "-Wl,--gc-sections" 123 } 124 } 125 126 toolchain { 127 abi_version: "local" 128 abi_libc_version: "local" 129 builtin_sysroot: "" 130 compiler: "compiler" 131 host_system_name: "local" 132 needsPic: true 133 supports_gold_linker: false 134 supports_incremental_linker: false 135 supports_fission: false 136 supports_interface_shared_objects: false 137 supports_normalizing_ar: false 138 supports_start_end_lib: false 139 supports_thin_archives: false 140 target_libc: "local" 141 target_cpu: "local" 142 target_system_name: "local" 143 toolchain_identifier: "local_arm" 144 145 tool_path { name: "ar" path: "/usr/bin/ar" } 146 tool_path { name: "compat-ld" path: "/usr/bin/ld" } 147 tool_path { name: "cpp" path: "/usr/bin/cpp" } 148 tool_path { name: "dwp" path: "/usr/bin/dwp" } 149 tool_path { name: "gcc" path: "computecpp" } 150 # Use "-std=c++11" for nvcc. For consistency, force both the host compiler 151 # and the device compiler to use "-std=c++11". 152 cxx_flag: "-std=c++11" 153 linker_flag: "-Wl,-no-as-needed" 154 linker_flag: "-lstdc++" 155 linker_flag: "-B/usr/bin/" 156 157 # TODO(bazel-team): In theory, the path here ought to exactly match the path 158 # used by gcc. That works because bazel currently doesn't track files at 159 # absolute locations and has no remote execution, yet. However, this will need 160 # to be fixed, maybe with auto-detection? 161 cxx_builtin_include_directory: "/usr/lib/gcc/" 162 cxx_builtin_include_directory: "/usr/lib" 163 cxx_builtin_include_directory: "/usr/lib64" 164 cxx_builtin_include_directory: "/usr/local/include" 165 cxx_builtin_include_directory: "/usr/include" 166 167 cxx_builtin_include_directory: "%{computecpp_toolkit_path}" 168 cxx_builtin_include_directory: "%{python_lib_path}" 169 170 tool_path { name: "gcov" path: "/usr/bin/gcov" } 171 172 # C(++) compiles invoke the compiler (as that is the one knowing where 173 # to find libraries), but we provide LD so other rules can invoke the linker. 174 tool_path { name: "ld" path: "/usr/bin/ld" } 175 176 tool_path { name: "nm" path: "/usr/bin/nm" } 177 tool_path { name: "objcopy" path: "/usr/bin/objcopy" } 178 objcopy_embed_flag: "-I" 179 objcopy_embed_flag: "binary" 180 tool_path { name: "objdump" path: "/usr/bin/objdump" } 181 tool_path { name: "strip" path: "/usr/bin/strip" } 182 183 # Make C++ compilation deterministic. Use linkstamping instead of these 184 # compiler symbols. 185 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" 186 unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" 187 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" 188 unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" 189 190 # All warnings are enabled. Maybe enable -Werror as well? 191 compiler_flag: "-Wall" 192 193 # Anticipated future default. 194 linker_flag: "-Wl,-no-as-needed" 195 # Stamp the binary with a unique identifier. 196 linker_flag: "-Wl,--build-id=md5" 197 linker_flag: "-Wl,--hash-style=gnu" 198 199 linking_mode_flags { mode: DYNAMIC } 200 201 compilation_mode_flags { 202 mode: FASTBUILD 203 compiler_flag: "-O0" 204 } 205 206 compilation_mode_flags { 207 mode: DBG 208 compiler_flag: "-g" 209 } 210 211 compilation_mode_flags { 212 mode: OPT 213 compiler_flag: "-g0" 214 compiler_flag: "-O2" 215 compiler_flag: "-DNDEBUG" 216 } 217 }