Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 1 | load(":cc_toolchain_config.bzl", "cc_toolchain_config") |
Deanna Garcia | b1877bb | 2021-09-22 21:21:04 +0000 | [diff] [blame] | 2 | |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 3 | package(default_visibility = ["//visibility:public"]) |
| 4 | |
| 5 | filegroup(name = "empty") |
| 6 | |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 7 | TOOLCHAINS = { |
deannagarcia | 3ad04bd | 2021-11-22 10:40:37 -0800 | [diff] [blame] | 8 | "osx-x86_64": "cc-compiler-osx-x86_64", |
| 9 | "osx-aarch_64": "cc-compiler-osx-aarch_64", |
Deanna Garcia | a793c7f | 2021-10-05 17:49:50 +0000 | [diff] [blame] | 10 | "linux-aarch_64": "cc-compiler-linux-aarch_64", |
| 11 | "linux-ppcle_64": "cc-compiler-linux-ppcle_64", |
| 12 | "linux-s390_64": "cc-compiler-linux-s390_64", |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 13 | "linux-x86_32": "cc-compiler-linux-x86_32", |
| 14 | "linux-x86_64": "cc-compiler-linux-x86_64", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 15 | "win32": "cc-compiler-windows-x86_32", |
| 16 | "win64": "cc-compiler-windows-x86_64", |
Deanna Garcia | 9a4c48a | 2022-04-06 17:42:12 +0000 | [diff] [blame] | 17 | "k8": "cc-compiler-k8", |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 18 | } |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 19 | |
| 20 | cc_toolchain_suite( |
| 21 | name = "clang_suite", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 22 | toolchains = TOOLCHAINS |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 23 | ) |
| 24 | |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 25 | [ |
| 26 | cc_toolchain( |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 27 | name = toolchain, |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 28 | all_files = ":empty", |
| 29 | compiler_files = ":empty", |
| 30 | dwp_files = ":empty", |
| 31 | dynamic_runtime_lib = ":empty", |
| 32 | linker_files = ":empty", |
| 33 | objcopy_files = ":empty", |
| 34 | output_licenses = ["restricted"], |
| 35 | static_runtime_lib = ":empty", |
| 36 | strip_files = ":empty", |
| 37 | toolchain_config = ":" + cpu + "-config", |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 38 | toolchain_identifier = toolchain, |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 39 | ) |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 40 | for cpu, toolchain in TOOLCHAINS.items() |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 41 | ] |
| 42 | |
| 43 | cc_toolchain_config( |
Deanna Garcia | 9a4c48a | 2022-04-06 17:42:12 +0000 | [diff] [blame] | 44 | name = "k8-config", |
| 45 | linker_path = "/usr/bin/ld", |
| 46 | sysroot = "/opt/manylinux/2014/x86_64", |
| 47 | target_cpu = "x86_64", |
| 48 | target_full_name = "x86_64-linux-gnu", |
| 49 | ) |
| 50 | |
| 51 | cc_toolchain_config( |
Deanna Garcia | a793c7f | 2021-10-05 17:49:50 +0000 | [diff] [blame] | 52 | name = "linux-aarch_64-config", |
Joshua Haberman | 9d01899 | 2022-02-15 18:02:10 -0800 | [diff] [blame] | 53 | sysroot = "/opt/manylinux/2014/aarch64", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 54 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 55 | target_cpu = "aarch64", |
| 56 | target_full_name = "aarch64-linux-gnu", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 57 | ) |
| 58 | |
| 59 | cc_toolchain_config( |
Deanna Garcia | a793c7f | 2021-10-05 17:49:50 +0000 | [diff] [blame] | 60 | name = "linux-ppcle_64-config", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 61 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 02be7a0 | 2022-03-09 23:34:31 +0000 | [diff] [blame] | 62 | sysroot = "/opt/manylinux/2014/ppc64le", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 63 | target_cpu = "ppc64", |
| 64 | target_full_name = "powerpc64le-linux-gnu", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 65 | ) |
| 66 | |
| 67 | cc_toolchain_config( |
Deanna Garcia | a793c7f | 2021-10-05 17:49:50 +0000 | [diff] [blame] | 68 | name = "linux-s390_64-config", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 69 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 02be7a0 | 2022-03-09 23:34:31 +0000 | [diff] [blame] | 70 | sysroot = "/opt/manylinux/2014/s390x", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 71 | target_cpu = "systemz", |
| 72 | target_full_name = "s390x-linux-gnu", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 73 | ) |
| 74 | |
| 75 | cc_toolchain_config( |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 76 | name = "linux-x86_32-config", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 77 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 02be7a0 | 2022-03-09 23:34:31 +0000 | [diff] [blame] | 78 | sysroot = "/opt/manylinux/2014/i686", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 79 | target_cpu = "x86_32", |
| 80 | target_full_name = "i386-linux-gnu", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 81 | ) |
| 82 | |
| 83 | cc_toolchain_config( |
Deanna Garcia | 33f3c0e | 2021-09-22 19:44:04 +0000 | [diff] [blame] | 84 | name = "linux-x86_64-config", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 85 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 02be7a0 | 2022-03-09 23:34:31 +0000 | [diff] [blame] | 86 | sysroot = "/opt/manylinux/2014/x86_64", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 87 | target_cpu = "x86_64", |
| 88 | target_full_name = "x86_64-linux-gnu", |
Deanna Garcia | 5532dae | 2021-09-22 18:30:53 +0000 | [diff] [blame] | 89 | ) |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 90 | |
| 91 | cc_toolchain_config( |
deannagarcia | a49dbd7 | 2021-11-22 10:14:26 -0800 | [diff] [blame] | 92 | name = "osx-aarch_64-config", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 93 | extra_compiler_flags = [ |
deannagarcia | a162273 | 2021-11-16 11:38:16 -0800 | [diff] [blame] | 94 | "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1", |
| 95 | "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include" |
Deanna Garcia | 97c901c | 2021-11-10 21:27:20 +0000 | [diff] [blame] | 96 | ], |
deannagarcia | a162273 | 2021-11-16 11:38:16 -0800 | [diff] [blame] | 97 | linker_path = "/usr/tools", |
Deanna Garcia | 8608ee9 | 2021-11-19 22:56:15 +0000 | [diff] [blame] | 98 | sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 99 | target_cpu = "aarch64", |
| 100 | target_full_name = "aarch64-apple-macosx11.3", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 101 | ) |
| 102 | |
| 103 | cc_toolchain_config( |
deannagarcia | a49dbd7 | 2021-11-22 10:14:26 -0800 | [diff] [blame] | 104 | name = "osx-x86_64-config", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 105 | extra_compiler_flags = [ |
deannagarcia | a162273 | 2021-11-16 11:38:16 -0800 | [diff] [blame] | 106 | "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include/c++/v1", |
| 107 | "-I/usr/tools/apple_sdks/xcode_13_0/macosx/usr/include" |
Deanna Garcia | 97c901c | 2021-11-10 21:27:20 +0000 | [diff] [blame] | 108 | ], |
deannagarcia | a162273 | 2021-11-16 11:38:16 -0800 | [diff] [blame] | 109 | linker_path = "/usr/tools", |
Deanna Garcia | 8608ee9 | 2021-11-19 22:56:15 +0000 | [diff] [blame] | 110 | sysroot = "/usr/tools/apple_sdks/xcode_13_0/macosx", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 111 | target_cpu = "x86_64", |
| 112 | target_full_name = "x86_64-apple-macosx11.3", |
Deanna Garcia | a5fa4fb | 2021-11-10 21:12:44 +0000 | [diff] [blame] | 113 | ) |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 114 | |
| 115 | cc_toolchain_config( |
| 116 | name = "win32-config", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 117 | extra_compiler_flags = [ |
deannagarcia | b360b9e | 2021-12-16 15:07:05 -0800 | [diff] [blame] | 118 | "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++", |
| 119 | "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++/i686-w64-mingw32", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 120 | "-fsjlj-exceptions", |
| 121 | ], |
Deanna Garcia | 202ec9e | 2022-03-14 17:33:08 +0000 | [diff] [blame] | 122 | extra_include = "/usr/lib/gcc/i686-w64-mingw32", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 123 | extra_linker_flags = [ |
| 124 | "-L/usr/lib/gcc/i686-w64-mingw32/8.3-posix", |
| 125 | "-pthread", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 126 | ], |
| 127 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 202ec9e | 2022-03-14 17:33:08 +0000 | [diff] [blame] | 128 | sysroot = "/usr/i686-w64-mingw32", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 129 | target_cpu = "x86_32", |
| 130 | target_full_name = "i686-w64-mingw32", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 131 | ) |
| 132 | |
| 133 | cc_toolchain_config( |
| 134 | name = "win64-config", |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 135 | extra_compiler_flags = [ |
deannagarcia | b360b9e | 2021-12-16 15:07:05 -0800 | [diff] [blame] | 136 | "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/", |
| 137 | "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/x86_64-w64-mingw32", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 138 | ], |
Deanna Garcia | a863972 | 2021-12-03 18:34:37 +0000 | [diff] [blame] | 139 | extra_include = "/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include", |
| 140 | extra_linker_flags = [ |
| 141 | "-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix", |
| 142 | ], |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 143 | linker_path = "/usr/bin/ld", |
Deanna Garcia | 202ec9e | 2022-03-14 17:33:08 +0000 | [diff] [blame] | 144 | sysroot = "/usr/x86_64-w64-mingw32", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 145 | target_cpu = "x86_64", |
| 146 | target_full_name = "x86_64-w64-mingw32", |
Deanna Garcia | 73c5703 | 2021-11-24 19:48:16 +0000 | [diff] [blame] | 147 | ) |