diff --git a/utils/bazel/.bazelrc b/utils/bazel/.bazelrc index a52e21e87ee0f..c98639c946e80 100644 --- a/utils/bazel/.bazelrc +++ b/utils/bazel/.bazelrc @@ -9,7 +9,9 @@ # Flip off to disable MODULE.bazel until we're ready. # https://github.com/llvm/llvm-project/issues/55924 -common --enable_bzlmod=false --enable_workspace +# +# WARNING: This option will be removed soon. Please migrate to bzlmod. +common:deprecated_workspace --enable_bzlmod=false --enable_workspace # TODO: Remove lit test reliance on this common --legacy_external_runfiles @@ -58,14 +60,6 @@ build --experimental_cc_shared_library # https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df build --build_runfile_links=false -############################################################################### -# Options to select different strategies for linking potential dependent -# libraries. The default leaves it disabled. -############################################################################### - -build:zlib_external --repo_env=BAZEL_LLVM_ZLIB_STRATEGY=external -build:zlib_system --repo_env=BAZEL_LLVM_ZLIB_STRATEGY=system - ############################################################################### # Options for "generic_clang" builds: these options should generally apply to # builds using a Clang-based compiler, and default to the `clang` executable on diff --git a/utils/bazel/MODULE.bazel b/utils/bazel/MODULE.bazel new file mode 100644 index 0000000000000..1b361f064e998 --- /dev/null +++ b/utils/bazel/MODULE.bazel @@ -0,0 +1,43 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +module( + name = "llvm-project-overlay", + version = "main", + compatibility_level = 0, +) + +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "rules_cc", version = "0.0.17") +bazel_dep(name = "rules_python", version = "1.1.0") +bazel_dep(name = "apple_support", version = "1.17.1") +bazel_dep(name = "rules_foreign_cc", version = "0.13.0") +bazel_dep(name = "robin-map", version = "1.3.0") +bazel_dep(name = "zlib-ng", version = "2.0.7") +bazel_dep(name = "zstd", version = "1.5.6") + +llvm_project_overlay = use_extension( + "//:extensions.bzl", + "llvm_project_overlay", +) + +# Don't add targets here. An empty list resolves to "all targets" and allows +# downstream repos to configure subsets. +llvm_project_overlay.configure() + +use_repo( + llvm_project_overlay, + "llvm-project", + "llvm-raw", + + # Vendored. + "vulkan_headers", + "vulkan_sdk", + "gmp", + "mpfr", + "pfm", + "pybind11", + "nanobind", +) diff --git a/utils/bazel/MODULE.bazel.lock b/utils/bazel/MODULE.bazel.lock new file mode 100644 index 0000000000000..ce5836f9c56c3 --- /dev/null +++ b/utils/bazel/MODULE.bazel.lock @@ -0,0 +1,768 @@ +{ + "lockFileVersion": 16, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/apple_support/1.17.1/MODULE.bazel": "655c922ab1209978a94ef6ca7d9d43e940cd97d9c172fb55f94d91ac53f8610b", + "https://bcr.bazel.build/modules/apple_support/1.17.1/source.json": "6b2b8c74d14e8d485528a938e44bdb72a5ba17632b9e14ef6e68a5ee96c8347f", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/source.json": "f121b43eeefc7c29efbd51b83d08631e2347297c95aac9764a701f2a6a2bb953", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", + "https://bcr.bazel.build/modules/platforms/0.0.11/source.json": "f7e188b79ebedebfe75e9e1d098b8845226c7992b307e28e1496f23112e8fc29", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "https://bcr.bazel.build/modules/robin-map/1.3.0/MODULE.bazel": "5d71f001690c9b3665e14b90ae62ca44c15ce9090fea978cedbc1d9648b97321", + "https://bcr.bazel.build/modules/robin-map/1.3.0/source.json": "07d6bda7632f8a0cf1d04ac1d070a6b3ab351facbbad4f12474c14730f88c487", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/source.json": "4db99b3f55c90ab28d14552aa0632533e3e8e5e9aea0f5c24ac0014282c2a7c5", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.13.0/MODULE.bazel": "5a9419cd02f6c2328eafd5234be8bef4d53357af80873392f5907f73f348c61b", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.13.0/source.json": "e3495e083f232b3de375b77d2b0b01c18b6c2d1fc7337e451e8cd8e0c3e43dc6", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/8.6.1/source.json": "f18d9ad3c4c54945bf422ad584fa6c5ca5b3116ff55a5b1bc77e5c1210be5960", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/1.1.0/MODULE.bazel": "57e01abae22956eb96d891572490d20e07d983e0c065de0b2170cafe5053e788", + "https://bcr.bazel.build/modules/rules_python/1.1.0/source.json": "29f1fdfd23a40808c622f813bc93e29c3aae277333f03293f667e76159750a0f", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib-ng/2.0.7/MODULE.bazel": "3ca640b745b55f287e95aa0477e6cd76dfa0a565725d5412b7d8dae4274436c8", + "https://bcr.bazel.build/modules/zlib-ng/2.0.7/source.json": "107bf3a70ecf9f87fe90f7002c9e35423564ffed070affec23d41478503bc5cf", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198", + "https://bcr.bazel.build/modules/zstd/1.5.6/MODULE.bazel": "471ebe7d3cdd8c6469390fcf623eb4779ff55fbee0a87f1dc57a1def468b96d4", + "https://bcr.bazel.build/modules/zstd/1.5.6/source.json": "02010c3333fc89b44fe861db049968decb6e688411f7f9d4f6791d74f9adfb51" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "//:extensions.bzl%llvm_project_overlay": { + "general": { + "bzlTransitiveDigest": "y3sOb8taqqvNZs0yhVnox+DDHMzZQESpaEVHkFavA9E=", + "usagesDigest": "efykF+NkQPa9IXy6sjP3kJNKJgQgQNJt1WZtxmrIdsU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "llvm-project": { + "repoRuleId": "@@//:configure.bzl%llvm_configure", + "attributes": { + "targets": [ + "AArch64", + "AMDGPU", + "ARM", + "AVR", + "BPF", + "Hexagon", + "Lanai", + "LoongArch", + "Mips", + "MSP430", + "NVPTX", + "PowerPC", + "RISCV", + "Sparc", + "SPIRV", + "SystemZ", + "VE", + "WebAssembly", + "X86", + "XCore" + ] + } + }, + "llvm-raw": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:local.bzl%new_local_repository", + "attributes": { + "path": "../..", + "build_file_content": "# Empty." + } + }, + "vulkan_headers": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD", + "sha256": "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895", + "strip_prefix": "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378", + "urls": [ + "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz" + ] + } + }, + "vulkan_sdk": { + "repoRuleId": "@@//:vulkan_sdk.bzl%vulkan_sdk_setup", + "attributes": {} + }, + "gmp": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:gmp.BUILD", + "sha256": "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2", + "strip_prefix": "gmp-6.2.1", + "urls": [ + "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz", + "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz" + ] + } + }, + "mpfr": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:mpfr.BUILD", + "sha256": "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7", + "strip_prefix": "mpfr-4.1.1", + "urls": [ + "https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz" + ] + } + }, + "pfm": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:pfm.BUILD", + "sha256": "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1", + "strip_prefix": "libpfm-4.13.0", + "urls": [ + "https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz" + ] + } + }, + "pybind11": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:pybind.BUILD", + "sha256": "201966a61dc826f1b1879a24a3317a1ec9214a918c8eb035be2f30c3e9cfbdcb", + "strip_prefix": "pybind11-2.10.3", + "url": "https://github.com/pybind/pybind11/archive/v2.10.3.zip" + } + }, + "nanobind": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file": "@@+llvm_project_overlay+llvm-raw//utils/bazel/third_party_build:nanobind.BUILD", + "sha256": "bb35deaed7efac5029ed1e33880a415638352f757d49207a8e6013fefb6c49a7", + "strip_prefix": "nanobind-2.4.0", + "url": "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "Ync9nL0AbHC6ondeEY7fBjBjLxojTsiXcJh65ZDTRlA=", + "usagesDigest": "3L+PK6aRnliv0iIS8m3kdo+LjmvjJWoFCm3qZcPSg+8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc_toolchains": { + "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf_toolchains", + "attributes": {} + }, + "local_config_apple_cc": { + "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support+", + "bazel_tools", + "bazel_tools" + ], + [ + "bazel_tools", + "rules_cc", + "rules_cc+" + ] + ] + } + }, + "@@rules_foreign_cc+//foreign_cc:extensions.bzl%tools": { + "general": { + "bzlTransitiveDigest": "gSYCcLbqaVeGzjJbZ8sbe3m7H3GKhJu9vAWq4fRg1f0=", + "usagesDigest": "mqChTKgeSo2+U6Pxt2FXlbg3JnDADJTrRE2okUyeU4g=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rules_foreign_cc_framework_toolchain_linux": { + "repoRuleId": "@@rules_foreign_cc+//foreign_cc/private/framework:toolchain.bzl%framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:linux_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:linux" + ] + } + }, + "rules_foreign_cc_framework_toolchain_freebsd": { + "repoRuleId": "@@rules_foreign_cc+//foreign_cc/private/framework:toolchain.bzl%framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:freebsd_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:freebsd" + ] + } + }, + "rules_foreign_cc_framework_toolchain_windows": { + "repoRuleId": "@@rules_foreign_cc+//foreign_cc/private/framework:toolchain.bzl%framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:windows_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:windows" + ] + } + }, + "rules_foreign_cc_framework_toolchain_macos": { + "repoRuleId": "@@rules_foreign_cc+//foreign_cc/private/framework:toolchain.bzl%framework_toolchain_repository", + "attributes": { + "commands_src": "@rules_foreign_cc//foreign_cc/private/framework/toolchains:macos_commands.bzl", + "exec_compatible_with": [ + "@platforms//os:macos" + ] + } + }, + "rules_foreign_cc_framework_toolchains": { + "repoRuleId": "@@rules_foreign_cc+//foreign_cc/private/framework:toolchain.bzl%framework_toolchain_repository_hub", + "attributes": {} + }, + "cmake_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "f316b40053466f9a416adf981efda41b160ca859e97f6a484b447ea299ff26aa", + "strip_prefix": "cmake-3.23.2", + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz" + ], + "patches": [ + "@@rules_foreign_cc+//toolchains:cmake-c++11.patch" + ] + } + }, + "gnumake_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3", + "strip_prefix": "make-4.4.1", + "urls": [ + "https://mirror.bazel.build/ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz", + "http://ftpmirror.gnu.org/gnu/make/make-4.4.1.tar.gz" + ] + } + }, + "ninja_build_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "integrity": "sha256-ghvf9Io/aDvEuztvC1/nstZHz2XVKutjMoyRpsbfKFo=", + "strip_prefix": "ninja-1.12.1", + "urls": [ + "https://mirror.bazel.build/github.com/ninja-build/ninja/archive/v1.12.1.tar.gz", + "https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz" + ] + } + }, + "meson_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "exports_files([\"meson.py\"])\n\nfilegroup(\n name = \"runtime\",\n srcs = glob([\"mesonbuild/**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "567e533adf255de73a2de35049b99923caf872a455af9ce03e01077e0d384bed", + "strip_prefix": "meson-1.5.1", + "urls": [ + "https://mirror.bazel.build/github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz", + "https://github.com/mesonbuild/meson/releases/download/1.5.1/meson-1.5.1.tar.gz" + ] + } + }, + "glib_dev": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"glib_dev\",\n hdrs = glob([\"include/**\"]),\n shared_library = \"@glib_runtime//:bin/libglib-2.0-0.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bdf18506df304d38be98a4b3f18055b8b8cca81beabecad0eece6ce95319c369", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip", + "https://download.gnome.org/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip" + ] + } + }, + "glib_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"msvc_hdr\",\n hdrs = [\"msvc_recommended_pragmas.h\"],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "bc96f63112823b7d6c9f06572d2ad626ddac7eb452c04d762592197f6e07898e", + "strip_prefix": "glib-2.26.1", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz", + "https://download.gnome.org/sources/glib/2.26/glib-2.26.1.tar.gz" + ] + } + }, + "glib_runtime": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\nexports_files(\n [\n \"bin/libgio-2.0-0.dll\",\n \"bin/libglib-2.0-0.dll\",\n \"bin/libgmodule-2.0-0.dll\",\n \"bin/libgobject-2.0-0.dll\",\n \"bin/libgthread-2.0-0.dll\",\n ],\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "88d857087e86f16a9be651ee7021880b3f7ba050d34a1ed9f06113b8799cb973", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip", + "https://download.gnome.org/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip" + ] + } + }, + "gettext_runtime": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\ncc_import(\n name = \"gettext_runtime\",\n shared_library = \"bin/libintl-8.dll\",\n visibility = [\"//visibility:public\"],\n)\n ", + "sha256": "1f4269c0e021076d60a54e98da6f978a3195013f6de21674ba0edbc339c5b079", + "urls": [ + "https://mirror.bazel.build/download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip", + "https://download.gnome.org/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip" + ] + } + }, + "pkgconfig_src": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "filegroup(\n name = \"all_srcs\",\n srcs = glob([\"**\"]),\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591", + "strip_prefix": "pkg-config-0.29.2", + "patches": [ + "@@rules_foreign_cc+//toolchains:pkgconfig-detectenv.patch", + "@@rules_foreign_cc+//toolchains:pkgconfig-makefile-vc.patch", + "@@rules_foreign_cc+//toolchains:pkgconfig-builtin-glib-int-conversion.patch" + ], + "urls": [ + "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz", + "https://mirror.bazel.build/pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz" + ] + } + }, + "bazel_features": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "ba1282c1aa1d1fffdcf994ab32131d7c7551a9bc960fbf05f42d55a1b930cbfb", + "strip_prefix": "bazel_features-1.15.0", + "url": "https://github.com/bazel-contrib/bazel_features/releases/download/v1.15.0/bazel_features-v1.15.0.tar.gz" + } + }, + "bazel_skylib": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz" + ], + "sha256": "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728" + } + }, + "rules_python": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841", + "strip_prefix": "rules_python-0.23.1", + "url": "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.23.1.tar.gz" + } + }, + "rules_shell": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53", + "strip_prefix": "rules_shell-0.3.0", + "url": "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz" + } + }, + "cmake-3.23.2-linux-aarch64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-aarch64.tar.gz" + ], + "sha256": "f2654bf780b53f170bbbec44d8ac67d401d24788e590faa53036a89476efa91e", + "strip_prefix": "cmake-3.23.2-linux-aarch64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_bin\",\n srcs = [\"bin/cmake\"],\n)\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"**/* *\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n env = {\"CMAKE\": \"$(execpath :cmake_bin)\"},\n tools = [\":cmake_bin\"],\n)\n" + } + }, + "cmake-3.23.2-linux-x86_64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-x86_64.tar.gz" + ], + "sha256": "aaced6f745b86ce853661a595bdac6c5314a60f8181b6912a0a4920acfa32708", + "strip_prefix": "cmake-3.23.2-linux-x86_64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_bin\",\n srcs = [\"bin/cmake\"],\n)\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"**/* *\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n env = {\"CMAKE\": \"$(execpath :cmake_bin)\"},\n tools = [\":cmake_bin\"],\n)\n" + } + }, + "cmake-3.23.2-macos-universal": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-macos-universal.tar.gz" + ], + "sha256": "853a0f9af148c5ef47282ffffee06c4c9f257be2635936755f39ca13c3286c88", + "strip_prefix": "cmake-3.23.2-macos-universal/CMake.app/Contents", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_bin\",\n srcs = [\"bin/cmake\"],\n)\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"**/* *\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake\",\n target = \":cmake_data\",\n env = {\"CMAKE\": \"$(execpath :cmake_bin)\"},\n tools = [\":cmake_bin\"],\n)\n" + } + }, + "cmake-3.23.2-windows-i386": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-windows-i386.zip" + ], + "sha256": "6a4fcd6a2315b93cb23c93507efccacc30c449c2bf98f14d6032bb226c582e07", + "strip_prefix": "cmake-3.23.2-windows-i386", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_bin\",\n srcs = [\"bin/cmake.exe\"],\n)\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"**/* *\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake.exe\",\n target = \":cmake_data\",\n env = {\"CMAKE\": \"$(execpath :cmake_bin)\"},\n tools = [\":cmake_bin\"],\n)\n" + } + }, + "cmake-3.23.2-windows-x86_64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-windows-x86_64.zip" + ], + "sha256": "2329387f3166b84c25091c86389fb891193967740c9bcf01e7f6d3306f7ffda0", + "strip_prefix": "cmake-3.23.2-windows-x86_64", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"cmake_bin\",\n srcs = [\"bin/cmake.exe\"],\n)\n\nfilegroup(\n name = \"cmake_data\",\n srcs = glob(\n [\n \"**\",\n ],\n exclude = [\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"**/* *\",\n ],\n ),\n)\n\nnative_tool_toolchain(\n name = \"cmake_tool\",\n path = \"bin/cmake.exe\",\n target = \":cmake_data\",\n env = {\"CMAKE\": \"$(execpath :cmake_bin)\"},\n tools = [\":cmake_bin\"],\n)\n" + } + }, + "cmake_3.23.2_toolchains": { + "repoRuleId": "@@rules_foreign_cc+//toolchains:prebuilt_toolchains_repository.bzl%prebuilt_toolchains_repository", + "attributes": { + "repos": { + "cmake-3.23.2-linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux" + ], + "cmake-3.23.2-linux-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux" + ], + "cmake-3.23.2-macos-universal": [ + "@platforms//os:macos" + ], + "cmake-3.23.2-windows-i386": [ + "@platforms//cpu:x86_32", + "@platforms//os:windows" + ], + "cmake-3.23.2-windows-x86_64": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows" + ] + }, + "tool": "cmake" + } + }, + "ninja_1.12.1_linux": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip" + ], + "sha256": "6f98805688d19672bd699fbbfa2c2cf0fc054ac3df1f0e6a47664d963d530255", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "ninja_1.12.1_linux-aarch64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux-aarch64.zip" + ], + "sha256": "5c25c6570b0155e95fce5918cb95f1ad9870df5768653afe128db822301a05a1", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "ninja_1.12.1_mac": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-mac.zip" + ], + "sha256": "89a287444b5b3e98f88a945afa50ce937b8ffd1dcc59c555ad9b1baf855298c9", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "ninja_1.12.1_mac_aarch64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-mac.zip" + ], + "sha256": "89a287444b5b3e98f88a945afa50ce937b8ffd1dcc59c555ad9b1baf855298c9", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "ninja_1.12.1_win": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "urls": [ + "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" + ], + "sha256": "f550fec705b6d6ff58f2db3c374c2277a37691678d6aba463adcbb129108467a", + "strip_prefix": "", + "build_file_content": "load(\"@rules_foreign_cc//toolchains/native_tools:native_tools_toolchain.bzl\", \"native_tool_toolchain\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"ninja_bin\",\n srcs = [\"ninja.exe\"],\n)\n\nnative_tool_toolchain(\n name = \"ninja_tool\",\n env = {\"NINJA\": \"$(execpath :ninja_bin)\"},\n path = \"$(execpath :ninja_bin)\",\n target = \":ninja_bin\",\n)\n" + } + }, + "ninja_1.12.1_toolchains": { + "repoRuleId": "@@rules_foreign_cc+//toolchains:prebuilt_toolchains_repository.bzl%prebuilt_toolchains_repository", + "attributes": { + "repos": { + "ninja_1.12.1_linux": [ + "@platforms//cpu:x86_64", + "@platforms//os:linux" + ], + "ninja_1.12.1_linux-aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:linux" + ], + "ninja_1.12.1_mac": [ + "@platforms//cpu:x86_64", + "@platforms//os:macos" + ], + "ninja_1.12.1_mac_aarch64": [ + "@platforms//cpu:aarch64", + "@platforms//os:macos" + ], + "ninja_1.12.1_win": [ + "@platforms//cpu:x86_64", + "@platforms//os:windows" + ] + }, + "tool": "ninja" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_foreign_cc+", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_foreign_cc+", + "rules_foreign_cc", + "rules_foreign_cc+" + ] + ] + } + }, + "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { + "general": { + "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", + "usagesDigest": "jTQDdLDxsS43zuRmg1faAjIEPWdLAbDAowI1pInQSoo=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "compatibility_proxy": { + "repoRuleId": "@@rules_java+//java:rules_java_deps.bzl%_compatibility_proxy_repo_rule", + "attributes": {} + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "sFhcgPbDQehmbD1EOXzX4H1q/CD5df8zwG4kp4jbvr8=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin+", + "bazel_tools", + "bazel_tools" + ] + ] + } + } + } +} diff --git a/utils/bazel/WORKSPACE b/utils/bazel/WORKSPACE index eeb1c692ac871..800a956f92a83 100644 --- a/utils/bazel/WORKSPACE +++ b/utils/bazel/WORKSPACE @@ -43,7 +43,7 @@ maybe( maybe( http_archive, - name = "llvm_zlib", + name = "zlib-ng", build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD", sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731", strip_prefix = "zlib-ng-2.0.7", @@ -71,13 +71,13 @@ maybe( ) http_archive( - name = "build_bazel_apple_support", + name = "apple_support", sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2346adf66a80", url = "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz", ) load( - "@build_bazel_apple_support//lib:repositories.bzl", + "@apple_support//lib:repositories.bzl", "apple_support_dependencies", ) @@ -137,7 +137,7 @@ maybe( maybe( http_archive, - name = "llvm_zstd", + name = "zstd", build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD", sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0", strip_prefix = "zstd-1.5.2", @@ -157,7 +157,7 @@ maybe( maybe( http_archive, - name = "robin_map", + name = "robin-map", build_file = "@llvm-raw//utils/bazel/third_party_build:robin_map.BUILD", sha256 = "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236", strip_prefix = "robin-map-1.3.0", diff --git a/utils/bazel/configure.bzl b/utils/bazel/configure.bzl index c5da28845eccf..dfcda3f6b4d07 100644 --- a/utils/bazel/configure.bzl +++ b/utils/bazel/configure.bzl @@ -31,10 +31,10 @@ DEFAULT_TARGETS = [ ] def _overlay_directories(repository_ctx): - src_path = repository_ctx.path(Label("@llvm-raw//:WORKSPACE")).dirname - bazel_path = src_path.get_child("utils").get_child("bazel") - overlay_path = bazel_path.get_child("llvm-project-overlay") - script_path = bazel_path.get_child("overlay_directories.py") + workspace_path = repository_ctx.path(Label("@llvm-raw//utils/bazel:WORKSPACE")).dirname + src_path = workspace_path.get_child("../..") + overlay_path = workspace_path.get_child("llvm-project-overlay") + script_path = workspace_path.get_child("overlay_directories.py") python_bin = repository_ctx.which("python3") if not python_bin: @@ -81,7 +81,7 @@ def _extract_cmake_settings(repository_ctx, llvm_cmake): # It would be easier to use external commands like sed(1) and python. # For portability, the parser should run on Starlark. - llvm_cmake_path = repository_ctx.path(Label("//:" + llvm_cmake)) + llvm_cmake_path = repository_ctx.path(Label("@llvm-raw//:" + llvm_cmake)) for line in repository_ctx.read(llvm_cmake_path).splitlines(): # Extract "set ( FOO bar ... " setfoo = line.partition("(") diff --git a/utils/bazel/examples/bzlmod-archive/MODULE.bazel b/utils/bazel/examples/bzlmod-archive/MODULE.bazel new file mode 100644 index 0000000000000..32ecce51093a2 --- /dev/null +++ b/utils/bazel/examples/bzlmod-archive/MODULE.bazel @@ -0,0 +1,58 @@ +module( + name = "bzlmod-example", + version = "0.0.0", + compatibility_level = 0, +) + +bazel_dep(name = "llvm-raw", version = "main") + +LLVM_COMMIT="0000000000000000000000000000000000000000" + +# Add the dependencies from "utils/bazel/MODULE.bazel" but name the module +# "llvm-raw". This way you don't need to fetch the llvm sources twice and retain +# compatibility for third-party dependents as module overrides are ignored in +# non-root modules. +archive_override( + module_name = "llvm-raw", + strip_prefix = "llvm-project-{}".format(LLVM_COMMIT), + patch_cmds = [ + '''printf 'module(name=\"llvm-raw\") +bazel_dep(name = "apple_support", version = "1.17.1") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "robin-map", version = "1.3.0") +bazel_dep(name = "rules_cc", version = "0.0.17") +bazel_dep(name = "rules_foreign_cc", version = "0.13.0") +bazel_dep(name = "rules_python", version = "1.1.0") +bazel_dep(name = "zlib-ng", version = "2.0.7") +bazel_dep(name = "zstd", version = "1.5.6")' > MODULE.bazel''' + ], + build_file_content = "# Empty.", + integrity = "sha256-0000000000000000000000000000000000000000000=", + urls = [ + "https://github.com/llvm/llvm-project/archive/{}.zip".format( + LLVM_COMMIT, + ), + ], +) + +llvm_project_overlay = use_extension( + "@llvm-raw//utils/bazel:extensions.bzl", + "llvm_project_overlay", +) + +llvm_project_overlay.configure() + +use_repo( + llvm_project_overlay, + "llvm-project", + + # Vendored. + "vulkan_headers", + "vulkan_sdk", + "gmp", + "mpfr", + "pfm", + "pybind11", + "nanobind", +) diff --git a/utils/bazel/examples/bzlmod-submodule-and-directories/MODULE.bazel b/utils/bazel/examples/bzlmod-submodule-and-directories/MODULE.bazel new file mode 100644 index 0000000000000..29228e9b6774b --- /dev/null +++ b/utils/bazel/examples/bzlmod-submodule-and-directories/MODULE.bazel @@ -0,0 +1,75 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +# Since the llvm project doesn't have `MODULE.bazel` and `BUILD.bazel` files in +# its root directory you need to create an override for the `llvm-raw` sources +# and then inject it into the `llvm-project-overlay` module extension. + +module( + name = "bzlmod-example", + version = "0.0.0", + compatibility_level = 0, +) + +new_local_repository = use_repo_rule( + "@bazel_tools//tools/build_defs/repo:local.bzl", + "new_local_repository", +) + +# WARNING: This is not a module override. If a third party depends on your +# repository this repository will get lifted to the root module and +# treated as if it was in the third party module. +# +# This means that if your repo is the top level module this behaves as +# you'd expect, but third parties need to create another +# repository in conjunction with a `repo_override` so that the `path` +# attribute doesn't point to unexpected locations. +# +# See: https://bazel.build/rules/lib/repo/local#new_local_repository +# https://bazel.build/rules/lib/repo/http#http_archive +# https://bazel.build/rules/lib/globals/module#override_repo +new_local_repository( + name = "llvm-raw", + path = "third_party/llvm-project", + build_file_content = "# Empty.", +) + +bazel_dep(name = "llvm-project-overlay", version = "main") + +# WARNING: Sice this is a module override it'll be ignored if a third party +# depends on your project. +# +# This means that if your repo is the top level module this behaves as +# you'd expect, but third parties need to create a new module override +# as described in https://bazel.build/rules/lib/globals/module. +local_path_override( + module_name = "llvm-project-overlay", + path = "third_party/llvm-project/utils/bazel", +) + +llvm_project_overlay = use_extension( + "@llvm-project-overlay//:extensions.bzl", + "llvm_project_overlay", +) + +inject_repo( + llvm_project_overlay, + "llvm-raw", +) + +llvm_project_overlay.configure() + +use_repo( + llvm_project_overlay, + "llvm-project", + + # Vendored. + "vulkan_headers", + "vulkan_sdk", + "gmp", + "mpfr", + "pfm", + "pybind11", + "nanobind", +) diff --git a/utils/bazel/extensions.bzl b/utils/bazel/extensions.bzl new file mode 100644 index 0000000000000..fc369483a8c99 --- /dev/null +++ b/utils/bazel/extensions.bzl @@ -0,0 +1,127 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository") +load(":vulkan_sdk.bzl", "vulkan_sdk_setup") +load(":configure.bzl", "llvm_configure", "DEFAULT_TARGETS") + +def _llvm_configure_extension_impl(ctx): + targets = [] + + # Aggregate targets across imports. + targets.extend([ + target + for module in ctx.modules + for config in module.tags.configure + for target in config.targets + if target not in targets + ]) + + # Fall back to the default targets if all configurations of this extension + # omit the `target` attribute. + if targets == []: + targets = DEFAULT_TARGETS + + llvm_configure(name = "llvm-project", targets = targets) + + # Deliberately omit the "llvm-raw" directory if we're not in the utils/bazel + # directory. + # + # In downstream repos this intentionally causes the extension to immediately + # error out if "llvm-raw" wasn't injected explicitly. + # + # We can't add this repo to the utils/bazel/MODULE.bazel as it would cause + # submodule imports to resolve the new_local_repository at wrong paths. + [ + new_local_repository( + name = "llvm-raw", + path = "../..", + build_file_content = "# Empty." + ) + for module in ctx.modules + if module.name == "llvm-project-overlay" and module.is_root + ] + + http_archive( + name = "vulkan_headers", + build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD", + sha256 = "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895", + strip_prefix = "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378", + urls = [ + "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz", + ], + ) + + vulkan_sdk_setup(name = "vulkan_sdk") + + http_archive( + name = "gmp", + build_file = "@llvm-raw//utils/bazel/third_party_build:gmp.BUILD", + sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2", + strip_prefix = "gmp-6.2.1", + urls = [ + "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz", + "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz", + ], + ) + + # https://www.mpfr.org/mpfr-current/ + # + # When updating to a newer version, don't use URLs with "mpfr-current" in them. + # Instead, find a stable URL like the one used currently. + http_archive( + name = "mpfr", + build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD", + sha256 = "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7", + strip_prefix = "mpfr-4.1.1", + urls = ["https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz"], + ) + + http_archive( + name = "pfm", + build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD", + sha256 = "d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1", + strip_prefix = "libpfm-4.13.0", + urls = ["https://versaweb.dl.sourceforge.net/project/perfmon2/libpfm4/libpfm-4.13.0.tar.gz"], + ) + + http_archive( + name = "pybind11", + build_file = "@llvm-raw//utils/bazel/third_party_build:pybind.BUILD", + sha256 = "201966a61dc826f1b1879a24a3317a1ec9214a918c8eb035be2f30c3e9cfbdcb", + strip_prefix = "pybind11-2.10.3", + url = "https://github.com/pybind/pybind11/archive/v2.10.3.zip", + ) + + # TODO: This exists in the BCR, but that implementation doesn't let us set + # `NB_BUILD=1` and `NB_SHARED=1`, so we use a custom variant here. + # Make `NB_BUILD` and `NB_SHARED` configurable upstream so that we can + # import this as a `bazel_dep` in `MODULE.bazel`. + # + # See: https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/nanobind/2.4.0/patches/add_build_file.patch + http_archive( + name = "nanobind", + build_file = "@llvm-raw//utils/bazel/third_party_build:nanobind.BUILD", + sha256 = "bb35deaed7efac5029ed1e33880a415638352f757d49207a8e6013fefb6c49a7", + strip_prefix = "nanobind-2.4.0", + url = "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz", + ) + + +llvm_project_overlay = module_extension( + doc = """Configure the llvm-project. + + Tags: + targets: List of targets which Clang should support. + """, + implementation = _llvm_configure_extension_impl, + tag_classes = { + "configure": tag_class( + attrs = { + "targets": attr.string_list(), + }, + ), + }, +) diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel index e3b20e43dd220..0600fe324368a 100644 --- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@rules_python//python:defs.bzl", "py_binary") load( "//:vars.bzl", @@ -13,6 +15,16 @@ load( load("//:workspace_root.bzl", "workspace_root") load("//llvm:binary_alias.bzl", "binary_alias") load("//llvm:cc_plugin_library.bzl", "cc_plugin_library") +load( + "//config:cmakehelpers.bzl", + "cmakedefine", + "cmakedefine01_off", + "cmakedefine01_on", + "cmakedefine_sunset", + "cmakedefine_unset", + "cmakedefine_vset", + "cmakedefine_vunset", +) load("//llvm:driver.bzl", "llvm_driver_cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") @@ -614,6 +626,49 @@ genrule( ), ) +expand_template( + name = "config_h", + out = "include/clang/Config/config.h", + substitutions = ( + {"${BUG_REPORT_URL}": "https://github.com/llvm/llvm-project/issues/"} | + cmakedefine01_on("CLANG_DEFAULT_PIE_ON_LINUX") | + { + "${CLANG_DEFAULT_LINKER}": "", + "${CLANG_DEFAULT_CXX_STDLIB}": "", + "${CLANG_DEFAULT_RTLIB}": "", + "${CLANG_DEFAULT_UNWINDLIB}": "", + "${CLANG_DEFAULT_OBJCOPY}": "objcopy", + "${CLANG_DEFAULT_OPENMP_RUNTIME}": "libomp", + "${CLANG_SYSTEMZ_DEFAULT_ARCH}": "z10", + "${CLANG_INSTALL_LIBDIR_BASENAME}": "lib", + "${CLANG_RESOURCE_DIR}": "", + "${C_INCLUDE_DIRS}": "", + } | + cmakedefine_sunset("CLANG_CONFIG_FILE_SYSTEM_DIR") | + cmakedefine_sunset("CLANG_CONFIG_FILE_USER_DIR") | + { + "${DEFAULT_SYSROOT}": "", + "${GCC_INSTALL_PREFIX}": "", + } | + cmakedefine_vunset("CLANG_HAVE_LIBXML") | + cmakedefine( + "CLANG_HAVE_RLIMITS", + disable = "@platforms//os:windows", + ) | + cmakedefine_vset("CLANG_HAVE_DLFCN_H") | + cmakedefine_vset("CLANG_HAVE_DLADDR") | + cmakedefine_sunset("HOST_LINK_VERSION") | + cmakedefine_unset("ENABLE_LINKER_BUILD_ID") | + cmakedefine01_on("ENABLE_X86_RELAX_RELOCATIONS") | + cmakedefine01_off("PPC_LINUX_DEFAULT_IEEELONGDOUBLE") | + cmakedefine01_off("CLANG_ENABLE_OBJC_REWRITER") | + cmakedefine01_on("CLANG_ENABLE_STATIC_ANALYZER") | + cmakedefine01_off("CLANG_SPAWN_CC1") | + cmakedefine01_off("CLANG_ENABLE_CIR") + ), + template = "include/clang/Config/config.h.cmake", +) + cc_library( name = "config", hdrs = [ diff --git a/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h b/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h deleted file mode 100644 index fd26489ffd5a8..0000000000000 --- a/utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h +++ /dev/null @@ -1,115 +0,0 @@ -/*===------- clang/Config/config.h - llvm configuration -----------*- C -*-===*/ -/* */ -/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ -/* Exceptions. */ -/* See https://llvm.org/LICENSE.txt for license information. */ -/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This is a manual port of config.h.cmake for the symbols that do not change - based on platform. Those that do change should not be defined here and - instead use Bazel cc_library defines. Some attempt has been made to extract - such symbols that do vary based on platform (for the platforms we care about) - into Bazel defines, but it is by no means complete, so if you see something - that looks wrong, it probably is. */ - -#ifdef CLANG_CONFIG_H -#error config.h can only be included once -#else -#define CLANG_CONFIG_H - -/* Bug report URL. */ -#define BUG_REPORT_URL "https://github.com/llvm/llvm-project/issues/" - -/* Default to -fPIE and -pie on Linux. */ -#define CLANG_DEFAULT_PIE_ON_LINUX 1 - -/* Default linker to use. */ -#define CLANG_DEFAULT_LINKER "" - -/* Default C++ stdlib to use. */ -#define CLANG_DEFAULT_CXX_STDLIB "" - -/* Default runtime library to use. */ -#define CLANG_DEFAULT_RTLIB "" - -/* Default unwind library to use. */ -#define CLANG_DEFAULT_UNWINDLIB "" - -/* Default objcopy to use */ -#define CLANG_DEFAULT_OBJCOPY "objcopy" - -/* Default OpenMP runtime used by -fopenmp. */ -#define CLANG_DEFAULT_OPENMP_RUNTIME "libomp" - -/* Default architecture for SystemZ. */ -#define CLANG_SYSTEMZ_DEFAULT_ARCH "z10" - -/* Multilib basename for libdir. */ -#define CLANG_INSTALL_LIBDIR_BASENAME "lib" - -/* Relative directory for resource files */ -#define CLANG_RESOURCE_DIR "" - -/* Directories clang will search for headers */ -#define C_INCLUDE_DIRS "" - -/* Directories clang will search for configuration files */ -/* #undef CLANG_CONFIG_FILE_SYSTEM_DIR */ -/* #undef CLANG_CONFIG_FILE_USER_DIR */ - -/* Default to all compiler invocations for --sysroot=. */ -#define DEFAULT_SYSROOT "" - -/* Directory where gcc is installed. */ -#define GCC_INSTALL_PREFIX "" - -/* Define if we have libxml2 */ -/* #undef CLANG_HAVE_LIBXML */ - -/* Define if we have sys/resource.h (rlimits) */ -/* CLANG_HAVE_RLIMITS defined conditionally below */ - -/* Define if we have dlfcn.h */ -#define CLANG_HAVE_DLFCN_H 1 - -/* Define if dladdr() is available on this platform. */ -#define CLANG_HAVE_DLADDR 1 - -/* Linker version detected at compile time. */ -/* #undef HOST_LINK_VERSION */ - -/* pass --build-id to ld */ -/* #undef ENABLE_LINKER_BUILD_ID */ - -/* enable x86 relax relocations by default */ -#define ENABLE_X86_RELAX_RELOCATIONS 1 - -/* enable IEEE binary128 as default long double format on PowerPC Linux. */ -#define PPC_LINUX_DEFAULT_IEEELONGDOUBLE 0 - -/* Enable the experimental new pass manager by default */ -#define ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER 0 - -/* Enable each functionality of modules */ -#define CLANG_ENABLE_OBJC_REWRITER 0 -#define CLANG_ENABLE_STATIC_ANALYZER 1 - -/* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */ -#define CLANG_SPAWN_CC1 0 - -/* Whether to enable opaque pointers by default */ -#define CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL 1 - -/* Directly provide definitions here behind platform preprocessor definitions. - * The preprocessor conditions are sufficient to handle all of the configuration - * on platforms targeted by Bazel, and defining these here more faithfully - * matches how the users of this header expect things to work with CMake. - */ - -#ifndef _WIN32 -#define CLANG_HAVE_RLIMITS 1 -#endif - -#endif diff --git a/utils/bazel/llvm-project-overlay/config/BUILD.bazel b/utils/bazel/llvm-project-overlay/config/BUILD.bazel new file mode 100644 index 0000000000000..be6e6b589fc0b --- /dev/null +++ b/utils/bazel/llvm-project-overlay/config/BUILD.bazel @@ -0,0 +1,174 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +"""Configurable build attributes for the overlay. + +To view the configurable build attributes in this file: + + bazel query 'kind(".*_flag", @llvm-project//config:all)' +""" + +load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") + +# Common config settings mapping to platform triples. +# +# See also: //platform:BUILD.bazel. +# +# TODO(aaronmondal): Add triples for more useful configurations as per +# `llvm/include/llvm/TargetParser/Triple.h`. + +selects.config_setting_group( + name = "aarch64-unknown-linux-gnu", + match_all = [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], +) + +selects.config_setting_group( + name = "arm64-apple-darwin", + match_all = [ + "@platforms//cpu:arm64", + "@platforms//os:macos", + ], +) + +selects.config_setting_group( + name = "powerpc64le-unknown-linux-gnu", + match_all = [ + "@platforms//cpu:ppc64le", + "@platforms//os:linux", + ], +) + +selects.config_setting_group( + name = "systemz-unknown-linux_gnu", + match_all = [ + "@platforms//cpu:s390x", + "@platforms//os:linux", + ], +) + +selects.config_setting_group( + name = "x86_64-pc-win32", + match_all = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], +) + +selects.config_setting_group( + name = "x86_64-unknown-darwin", + match_all = [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + ], +) + +selects.config_setting_group( + name = "x86_64-unknown-linux-gnu", + match_all = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], +) + +# Useful helpers. + +selects.config_setting_group( + name = "posix", + match_any = [ + "@platforms//os:linux", + "@platforms//os:macos", + "@platforms//os:freebsd", + ], +) + +# Configurable build attributes for llvm. + +# These map to CMake `option` fields on a best-effort basis. The default maps to +# CMake's `ON` or `OFF` value. +[ + ( + bool_flag( + name = option, + build_setting_default = default, + ), + # Only define the opposite of the default value to reduce target count + # and prevent accidental default redeclarations. + # + # This also acts as a failsafe to prevent drift if a default is flipped + # as a changed default triggers straightfoward errors in all places + # where no longer existing config_settings need to be adjusted. + ( + config_setting( + name = "{}_enabled".format(option), + flag_values = {":{}".format(option): "true"}, + ) if not default else config_setting( + name = "{}_disabled".format(option), + flag_values = {":{}".format(option): "false"}, + ) + ), + ) + for option, default in [ + ("LLVM_ENABLE_BACKTRACES", True), + ("LLVM_ENABLE_CRASH_OVERRIDES", True), + ("LLVM_ENABLE_CRASH_DUMPS", False), + + # These deviate slightly from CMake in that we use a boolean rather than + # ON/OFF/FORCE_ON since in Bazel ON collapses into FORCE_ON anyways. + ("LLVM_ENABLE_ZLIB", True), + ("LLVM_ENABLE_ZSTD", True), + ("LLVM_HAS_LOGF128", False), + ] +] + +# This doesn't have a common default as most builds expect this to be disabled +# by default but MinGW builds expect it enabled by default. +bool_flag( + name = "LLVM_WINDOWS_PREFER_FORWARD_SLASH", + build_setting_default = False, +) + +config_setting( + name = "LLVM_WINDOWS_PREFER_FORWARD_SLASH_enabled", + flag_values = {":LLVM_WINDOWS_PREFER_FORWARD_SLASH": "true"}, +) + +config_setting( + name = "LLVM_WINDOWS_PREFER_FORWARD_SLASH_disabled", + flag_values = {":LLVM_WINDOWS_PREFER_FORWARD_SLASH": "false"}, +) + +string_flag( + name = "LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING", + build_setting_default = "DISABLED", + values = [ + "COVERAGE", + "DISABLED", + ], +) + +config_setting( + name = "LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING_coverage", + flag_values = {":LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING": "COVERAGE"}, +) + +bool_flag( + name = "LLVM_ENABLE_PLUGINS", + # TODO(aaronmondal): This should be enabled by default, but that currently + # breaks @llvm-project//llvm/unittests:analysis_tests. + build_setting_default = False, +) + +config_setting( + name = "LLVM_ENABLE_PLUGINS_enabled", + flag_values = {":LLVM_ENABLE_PLUGINS": "true"}, +) + +config_setting( + name = "LLVM_ENABLE_PLUGINS_disabled", + flag_values = {":LLVM_ENABLE_PLUGINS": "false"}, +) diff --git a/utils/bazel/llvm-project-overlay/config/cmakehelpers.bzl b/utils/bazel/llvm-project-overlay/config/cmakehelpers.bzl new file mode 100644 index 0000000000000..b60b807da7c48 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/config/cmakehelpers.bzl @@ -0,0 +1,195 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +"""Helper functions to resolve CMake templates.""" + +load("@bazel_skylib//lib:selects.bzl", "selects") + +def cmakedefine_sset(define, value): + """Translate `#cmakedefine DEFINE "${DEFINE}"` to `#define DEFINE "VALUE"`. + + Args: + define: The string of a configurable define that may be set to a string + value. + + Returns: + A dict like + `{'#cmakedefine DEFINE "${DEFINE}"': '#define DEFINE "VALUE"'}`. + """ + return { + '#cmakedefine {} "${{{}}}"'.format( + define, + define, + ): '#define {} "{}"'.format(define, value), + } + +def cmakedefine_sunset(define): + """Translate `#cmakedefine DEFINE "${DEFINE}"` to `/* #undef DEFINE */`. + + Args: + define: The string of a configurable define that may be set to a string + value. + + Returns: + A dict like + `{'#cmakedefine DEFINE "${DEFINE}"': "/* #undef DEFINE */"}`. + """ + return { + '#cmakedefine {} "${{{}}}"'.format( + define, + define, + ): "/* #undef {} */".format(define), + } + +def cmakedefine_vset(define): + """Translate `#cmakedefine DEFINE ${DEFINE}` to `#define DEFINE 1`. + + Args: + define: The string of a configurable define that may be set to 1. + + Returns: + A dict like `{"#cmakedefine DEFINE ${DEFINE}": "#define DEFINE 1"}`. + """ + + return { + "#cmakedefine {} ${{{}}}".format( + define, + define, + ): "#define {} 1".format(define), + } + +def cmakedefine_vunset(define): + """Translate `#cmakedefine DEFINE ${DEFINE}` to `/* #undef DEFINE */`. + + Args: + define: The string of a configurable define that may be set to a value. + + Returns: + A dict like `{"#cmakedefine DEFINE ${DEFINE}": "/* #undef DEFINE */"}`. + """ + return { + "#cmakedefine {} ${{{}}}".format( + define, + define, + ): "/* #undef {} */".format(define), + } + +def cmakedefine_set(define): + """Translate `#cmakedefine DEFINE` to `#define DEFINE 1`. + + Args: + define: The string of a configurable define that may be set or unset. + + Returns: + A dict like `{"#cmakedefine DEFINE": "#define DEFINE 1"}`. + """ + return { + "#cmakedefine {}".format( + define, + ): "#define {} 1".format(define), + } + +def cmakedefine_unset(define): + """Translate `#cmakedefine DEFINE` to `/* #undef DEFINE */`. + + Args: + define: The string of a configurable define that may be set or unset. + + Returns: + A dict like `{"#cmakedefine DEFINE": "/* #undef DEFINE */"}`. + """ + return { + "#cmakedefine {}".format( + define, + ): "/* #undef {} */".format(define), + } + +def cmakedefine( + define, + enable = "//conditions:default", + disable = "//conditions:default"): + """Translate `#cmakedefine DEFINE ${DEFINE}` to `#define DEFINE 1` or + `/* #undef DEFINE */`. + + Args: + define: The string of a configurable define that may be unset or set to + a value. + enable: A `Label` or tuple of `Labels` declaring conditions that set + the define to 1. Defaults to `//conditions:default`. + disable: A `Label` or tuple of `Labels` declaring conditions that leave + the define undefined. Defaults to `//conditions:default`. + + Returns: + A `selects.with_or` of the structure: + + selects.with_or({ + enable: { + "#cmakedefine DEFINE ${DEFINE}": "#define DEFINE 1", + }, + disable: { + "#cmakedefine DEFINE ${DEFINE}": "/* #undef DEFINE */", + }, + }) + + Raises an error if `enable` and `disable` are both left at their defaults. + """ + return selects.with_or({ + enable: cmakedefine_vset(define), + disable: cmakedefine_vunset(define), + }) + +def cmakedefine01_on(define): + """Translate `#cmakedefine01 DEFINE` to `#define DEFINE 1`. + + Args: + define: The string of a configurable define that may be 0 or 1. + + Returns: + A dict like `{"#cmakedefine01 DEFINE": "#define DEFINE 1"}`. + """ + return { + "#cmakedefine01 {}".format(define): "#define {} 1".format(define), + } + +def cmakedefine01_off(define): + """Translate `#cmakedefine01 DEFINE` to `#define DEFINE 0`. + + Args: + define: The string of a configurable define that may be 0 or 1. + + Returns: + A dict like `{"#cmakedefine01 DEFINE": "#define DEFINE 0"}`. + """ + return { + "#cmakedefine01 {}".format(define): "#define {} 0".format(define), + } + +def cmakedefine01( + define, + enable = "//conditions:default", + disable = "//conditions:default"): + """Translate `#cmakedefine01 DEFINE` to `#define DEFINE 1` or + `#define DEFINE 0`. + + Args: + define: The string of a configurable define that may be set to 0 or 1. + enable: A `Label` or tuple of `Labels` declaring conditions that set + the define to 1. Defaults to `//conditions:default`. + disable: A `Label` or tuple of `Labels` declaring conditions that set + the define to 0. Defaults to `//conditions:default`. + + Returns: + A `selects.with_or` of the structure: + + selects.with_or({ + enable: {"#cmakedefine01 DEFINE": "#define DEFINE 1"}, + disable: {"#cmakedefine01 DEFINE": "#define DEFINE 0"}, + }) + + Raises an error if `enable` and `disable` are both left at their defaults. + """ + return selects.with_or({ + enable: cmakedefine01_on(define), + disable: cmakedefine01_off(define), + }) diff --git a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel index 94bcf68896615..5b05b3d5f82e7 100644 --- a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel @@ -111,9 +111,13 @@ cc_library( "//llvm:TargetParser", "//llvm:TransformUtils", "//llvm:config", - "@llvm_zlib//:zlib", - "@llvm_zstd//:zstd", - ], + ] + select({ + "//config:LLVM_ENABLE_ZLIB_disabled": [], + "//conditions:default": ["@zlib-ng"], + }) + select({ + "//config:LLVM_ENABLE_ZSTD_disabled": [], + "//conditions:default": ["@zstd"], + }), ) gentbl( diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel index 374c93600ccee..a8af1ad69520d 100644 --- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel @@ -5,7 +5,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") -load("@build_bazel_apple_support//rules:apple_genrule.bzl", "apple_genrule") +load("@apple_support//rules:apple_genrule.bzl", "apple_genrule") load("@rules_python//python:defs.bzl", "py_binary") load("//:vars.bzl", "LLVM_VERSION_MAJOR", "LLVM_VERSION_MINOR", "LLVM_VERSION_PATCH", "LLVM_VERSION_SUFFIX", "PACKAGE_VERSION") load("//lldb/source/Plugins:plugin_config.bzl", "DEFAULT_PLUGINS", "DEFAULT_SCRIPT_PLUGINS", "OBJCPP_COPTS") diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel index c4775dffca260..4c5bc64bbab64 100644 --- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel @@ -493,8 +493,10 @@ cc_library( "//llvm:Support", "//llvm:TargetParser", "//llvm:config", - "@llvm_zlib//:zlib", - ], + ] + select({ + "//config:LLVM_ENABLE_ZLIB_disabled": [], + "//conditions:default": ["@zlib-ng"], + }), ) cc_library( @@ -1416,8 +1418,10 @@ cc_library( "//lldb:Utility", "//llvm:Support", "//llvm:config", - "@llvm_zlib//:zlib", - ], + ] + select({ + "//config:LLVM_ENABLE_ZLIB_disabled": [], + "//conditions:default": ["@zlib-ng"], + }), ) cc_library( diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel index dfed324a9cb49..fcf3919794896 100644 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -2,12 +2,16 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -load("@bazel_skylib//rules:common_settings.bzl", "string_flag") +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@rules_python//python:defs.bzl", "py_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_filegroup", "td_library") load(":binary_alias.bzl", "binary_alias") -load(":config.bzl", "llvm_config_defines") +load( + ":config.bzl", + "CONFIG_H_SUBSTITUTIONS", + "LLVM_CONFIG_H_SUBSTITUTIONS", +) load(":driver.bzl", "generate_driver_selects", "generate_driver_tools_def", "llvm_driver_cc_binary", "select_driver_tools") load(":enum_targets_gen.bzl", "enum_targets_gen") load(":targets.bzl", "llvm_targets") @@ -153,13 +157,6 @@ expand_template( template = "include/llvm/Config/abi-breaking.h.cmake", ) -# To enable diff testing out of tree -exports_files([ - "include/llvm/Config/config.h.cmake", - "include/llvm/Config/llvm-config.h.cmake", - "include/llvm/Config/abi-breaking.h.cmake", -]) - td_library( name = "OptParserTdFiles", srcs = ["include/llvm/Option/OptParser.td"], @@ -171,14 +168,52 @@ llvm_config_target_defines = [ for t in llvm_targets ] +expand_template( + name = "config_h", + out = "include/llvm/Config/config.h", + substitutions = CONFIG_H_SUBSTITUTIONS, + template = "include/llvm/Config/config.h.cmake", +) + +expand_template( + name = "llvm-config_h", + out = "include/llvm/Config/llvm-config.h", + substitutions = LLVM_CONFIG_H_SUBSTITUTIONS, + template = "include/llvm/Config/llvm-config.h.cmake", +) + cc_library( name = "config", hdrs = [ "include/llvm/Config/abi-breaking.h", + "include/llvm/Config/config.h", "include/llvm/Config/llvm-config.h", ], copts = llvm_copts, - defines = llvm_config_defines + llvm_config_target_defines, + defines = select({ + "@platforms//os:windows": [ + "_CRT_SECURE_NO_DEPRECATE", + "_CRT_SECURE_NO_WARNINGS", + "_CRT_NONSTDC_NO_DEPRECATE", + "_CRT_NONSTDC_NO_WARNINGS", + "_SCL_SECURE_NO_DEPRECATE", + "_SCL_SECURE_NO_WARNINGS", + "UNICODE", + "_UNICODE", + ], + "//conditions:default": [ + "_GNU_SOURCE", + ], + }) + [ + # These shouldn't be needed by the C++11 standard, but are for some + # platforms (e.g. glibc < 2.18. See + # https://sourceware.org/bugzilla/show_bug.cgi?id=15366). These are also + # included unconditionally in the CMake build: + # https://github.com/llvm/llvm-project/blob/cd0dd8ece8e/llvm/cmake/modules/HandleLLVMOptions.cmake#L907-L909 + "__STDC_LIMIT_MACROS", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + ], includes = ["include"], textual_hdrs = [ "include/llvm/Config/AsmParsers.def", @@ -316,17 +351,15 @@ cc_library( "include/llvm/Support/*.def", ]), deps = [ - ":config", ":Demangle", - # We unconditionally depend on the custom LLVM zlib wrapper. This will - # be an empty library unless zlib is enabled, in which case it will - # both provide the necessary dependencies and configuration defines. - "@llvm_zlib//:zlib", - # We unconditionally depend on the custom LLVM zstd wrapper. This will - # be an empty library unless zstd is enabled, in which case it will - # both provide the necessary dependencies and configuration defines. - "@llvm_zstd//:zstd", - ], + ":config", + ] + select({ + "//config:LLVM_ENABLE_ZLIB_disabled": [], + "//conditions:default": ["@zlib-ng"], + }) + select({ + "//config:LLVM_ENABLE_ZSTD_disabled": [], + "//conditions:default": ["@zstd"], + }), ) # Note: although FileCheck (the binary) is a test utility, some non-test diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl index 6e703d22e7756..8b5db1c914a6f 100644 --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -2,8 +2,9 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -"""Defines variables that use selects to configure LLVM based on platform.""" +"""Substitutions for use in templates related to the LLVM configuration.""" +load("@bazel_skylib//lib:selects.bzl", "selects") load( "//:vars.bzl", "LLVM_VERSION_MAJOR", @@ -11,109 +12,316 @@ load( "LLVM_VERSION_PATCH", "PACKAGE_VERSION", ) +load("//llvm:targets.bzl", "llvm_targets") +load( + "//config:cmakehelpers.bzl", + "cmakedefine", + "cmakedefine01", + "cmakedefine01_off", + "cmakedefine01_on", + "cmakedefine_set", + "cmakedefine_sset", + "cmakedefine_sunset", + "cmakedefine_unset", + "cmakedefine_vset", + "cmakedefine_vunset", +) -def native_arch_defines(arch, triple): - return [ - r'LLVM_NATIVE_ARCH=\"{}\"'.format(arch), - "LLVM_NATIVE_ASMPARSER=LLVMInitialize{}AsmParser".format(arch), - "LLVM_NATIVE_ASMPRINTER=LLVMInitialize{}AsmPrinter".format(arch), - "LLVM_NATIVE_DISASSEMBLER=LLVMInitialize{}Disassembler".format(arch), - "LLVM_NATIVE_TARGET=LLVMInitialize{}Target".format(arch), - "LLVM_NATIVE_TARGETINFO=LLVMInitialize{}TargetInfo".format(arch), - "LLVM_NATIVE_TARGETMC=LLVMInitialize{}TargetMC".format(arch), - "LLVM_NATIVE_TARGETMCA=LLVMInitialize{}TargetMCA".format(arch), - r'LLVM_HOST_TRIPLE=\"{}\"'.format(triple), - r'LLVM_DEFAULT_TARGET_TRIPLE=\"{}\"'.format(triple), - ] - -posix_defines = [ - "LLVM_ON_UNIX=1", - "HAVE_BACKTRACE=1", - "BACKTRACE_HEADER=", - r'LTDL_SHLIB_EXT=\".so\"', - r'LLVM_PLUGIN_EXT=\".so\"', - "LLVM_ENABLE_THREADS=1", - "HAVE_DEREGISTER_FRAME=1", - "HAVE_LIBPTHREAD=1", - "HAVE_PTHREAD_GETNAME_NP=1", - "HAVE_PTHREAD_H=1", - "HAVE_PTHREAD_SETNAME_NP=1", - "HAVE_REGISTER_FRAME=1", - "HAVE_SETENV_R=1", - "HAVE_STRERROR_R=1", - "HAVE_SYSEXITS_H=1", - "HAVE_UNISTD_H=1", -] - -linux_defines = posix_defines + [ - "_GNU_SOURCE", - "HAVE_MALLINFO=1", - "HAVE_SBRK=1", - "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", -] - -macos_defines = posix_defines + [ - "HAVE_MACH_MACH_H=1", - "HAVE_MALLOC_MALLOC_H=1", - "HAVE_MALLOC_ZONE_STATISTICS=1", - "HAVE_PROC_PID_RUSAGE=1", - "HAVE_UNW_ADD_DYNAMIC_FDE=1", -] - -win32_defines = [ - # Windows system library specific defines. - "_CRT_SECURE_NO_DEPRECATE", - "_CRT_SECURE_NO_WARNINGS", - "_CRT_NONSTDC_NO_DEPRECATE", - "_CRT_NONSTDC_NO_WARNINGS", - "_SCL_SECURE_NO_DEPRECATE", - "_SCL_SECURE_NO_WARNINGS", - "UNICODE", - "_UNICODE", +CONFIG_H_SUBSTITUTIONS = ( + {"${BUG_REPORT_URL}": "https://github.com/llvm/llvm-project/issues/"} | + cmakedefine01( + "ENABLE_BACKTRACES", + disable = "//config:LLVM_ENABLE_BACKTRACES_disabled", + ) | + cmakedefine01( + "ENABLE_CRASH_OVERRIDES", + disable = "//config:LLVM_ENABLE_CRASH_OVERRIDES_disabled", + ) | + cmakedefine01( + "LLVM_ENABLE_CRASH_DUMPS", + enable = "//config:LLVM_ENABLE_CRASH_DUMPS_enabled", + ) | + cmakedefine01( + "ENABLE_DEBUGLOC_COVERAGE_TRACKING", + enable = "//config:LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING_coverage", + ) | + cmakedefine01( + "LLVM_WINDOWS_PREFER_FORWARD_SLASH", + enable = ( + "@bazel_tools//tools/cpp:mingw", + "//config:LLVM_WINDOWS_PREFER_FORWARD_SLASH_enabled", + ), + disable = ( + "//config:LLVM_WINDOWS_PREFER_FORWARD_SLASH_disabled", + "//conditions:default", + ), + ) | + cmakedefine("HAVE_BACKTRACE", enable = "//config:posix") | + {"${BACKTRACE_HEADER}": "execinfo.h"} | + cmakedefine_unset("HAVE_CRASHREPORTERCLIENT_H") | + cmakedefine01_off("HAVE_CRASHREPORTER_INFO") | + cmakedefine01_off("HAVE_DECL_ARC4RANDOM") | + cmakedefine01_on("HAVE_DECL_FE_ALL_EXCEPT") | + cmakedefine01_on("HAVE_DECL_FE_INEXACT") | + cmakedefine01_off("HAVE_DECL_STRERROR_S") | + cmakedefine_vset("HAVE_DLOPEN") | + cmakedefine("HAVE_REGISTER_FRAME", enable = "//config:posix") | + cmakedefine("HAVE_DEREGISTER_FRAME", enable = "//config:posix") | + cmakedefine("HAVE_UNW_ADD_DYNAMIC_FDE", enable = "@platforms//os:macos") | + cmakedefine_vunset("HAVE_FFI_CALL") | + cmakedefine_vunset("HAVE_FFI_FFI_H") | + cmakedefine_vunset("HAVE_FFI_H") | + cmakedefine_vset("HAVE_FUTIMENS") | + cmakedefine_vset("HAVE_FUTIMES") | + cmakedefine_vset("HAVE_GETPAGESIZE") | + cmakedefine_vset("HAVE_GETRUSAGE") | + {"#cmakedefine HAVE_ISATTY 1": "#define HAVE_ISATTY 1"} | + cmakedefine_vunset("HAVE_LIBEDIT") | + # TODO: Wire this up Exegesis and remove custom logic. + cmakedefine_vunset("HAVE_LIBPFM") | + cmakedefine_vunset("LIBPFM_HAS_FIELD_CYCLES") | + cmakedefine_vunset("HAVE_LIBPSAPI") | + cmakedefine("HAVE_LIBPTHREAD", enable = "//config:posix") | + cmakedefine("HAVE_PTHREAD_GETNAME_NP", enable = "//config:posix") | + cmakedefine("HAVE_PTHREAD_SETNAME_NP", enable = "//config:posix") | + cmakedefine_vunset("HAVE_PTHREAD_GET_NAME_NP") | # TODO: Likely wrong? + cmakedefine_vunset("HAVE_PTHREAD_SET_NAME_NP") | # TODO: Likely wrong? + cmakedefine("HAVE_MACH_MACH_H", enable = "@platforms//os:macos") | + cmakedefine_vunset("HAVE_MALLCTL") | + cmakedefine("HAVE_MALLINFO", enable = "@platforms//os:linux") | + # TODO(aaronmondal): Make configurable and enable by default. + cmakedefine_vunset("HAVE_MALLINFO2") | + cmakedefine("HAVE_MALLOC_MALLOC_H", enable = "@platforms//os:macos") | + cmakedefine( + "HAVE_MALLOC_ZONE_STATISTICS", + enable = "@platforms//os:macos", + ) | + cmakedefine_vset("HAVE_POSIX_SPAWN") | + cmakedefine_vset("HAVE_PREAD") | + cmakedefine("HAVE_PTHREAD_H", enable = "//config:posix") | + cmakedefine_vset("HAVE_PTHREAD_MUTEX_LOCK") | + cmakedefine_vset("HAVE_PTHREAD_RWLOCK_INIT") | + cmakedefine("HAVE_SBRK", enable = "@platforms//os:linux") | + cmakedefine("HAVE_SETENV", enable = "//config:posix") | + cmakedefine_vset("HAVE_SIGALTSTACK") | + cmakedefine("HAVE_STRERROR_R", enable = "//config:posix") | + cmakedefine_vset("HAVE_SYSCONF") | + cmakedefine_vset("HAVE_SYS_MMAN_H") | + cmakedefine_vunset("HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC") | + cmakedefine( + "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC", + enable = "@platforms//os:linux", + ) | + cmakedefine("HAVE_UNISTD_H", enable = "//config:posix") | + cmakedefine_vunset("HAVE_VALGRIND_VALGRIND_H") | + cmakedefine_vunset("HAVE__ALLOCA") | + cmakedefine_vunset("HAVE__CHSIZE_S") | + cmakedefine_vset("HAVE__UNWIND_BACKTRACE") | + cmakedefine_vunset("HAVE___ALLOCA") | + cmakedefine_vunset("HAVE___ASHLDI3") | + cmakedefine_vunset("HAVE___ASHRDI3") | + cmakedefine_vunset("HAVE___CHKSTK") | + cmakedefine_vunset("HAVE___CHKSTK_MS") | + cmakedefine_vunset("HAVE___CMPDI2") | + cmakedefine_vunset("HAVE___DIVDI3") | + cmakedefine_vunset("HAVE___FIXDFDI") | + cmakedefine_vunset("HAVE___FIXSFDI") | + cmakedefine_vunset("HAVE___FLOATDIDF") | + cmakedefine_vunset("HAVE___LSHRDI3") | + cmakedefine_vunset("HAVE___MAIN") | + cmakedefine_vunset("HAVE___MODDI3") | + cmakedefine_vunset("HAVE___UDIVDI3") | + cmakedefine_vunset("HAVE___UMODDI3") | + cmakedefine_vunset("HAVE____CHKSTK") | + cmakedefine_vunset("HAVE____CHKSTK_MS") | + cmakedefine_sunset("HOST_LINK_VERSION") | + cmakedefine_sunset("LLVM_TARGET_TRIPLE_ENV") | + cmakedefine01_on("LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO") | + cmakedefine01_on("LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG") | + cmakedefine_vunset("LLVM_ENABLE_LIBXML2") | + select({ + "@platforms//os:windows": cmakedefine_sset("LTDL_SHLIB_EXT", ".dll"), + "@platforms//os:macos": cmakedefine_sset("LTDL_SHLIB_EXT", ".dylib"), + "//conditions:default": cmakedefine_sset("LTDL_SHLIB_EXT", ".so"), + }) | + select({ + "@platforms//os:windows": cmakedefine_sset("LLVM_PLUGIN_EXT", ".dll"), + "@platforms//os:macos": cmakedefine_sset("LLVM_PLUGIN_EXT", ".dylib"), + "//conditions:default": cmakedefine_sset("LLVM_PLUGIN_EXT", ".so"), + }) | + cmakedefine_sset( + "PACKAGE_BUGREPORT", + "https://github.com/llvm/llvm-project/issues/", + ) | + cmakedefine_sset("PACKAGE_NAME", "LLVM") | + cmakedefine_sset( + "PACKAGE_STRING", + 'PACKAGE_NAME " " LLVM_VERSION_STRING', + ) | + cmakedefine_sset("PACKAGE_VERSION", "LLVM_VERSION_STRING") | + cmakedefine_sunset("PACKAGE_VENDOR") | + select({ + "@platforms//os:windows": cmakedefine_sset("stricmp", "_stricmp"), + "//conditions:default": cmakedefine_vunset("stricmp"), + }) | + select({ + "@platforms//os:windows": cmakedefine_sset("strdup", "_strdup"), + "//conditions:default": cmakedefine_vunset("strdup"), + }) | + cmakedefine01_off("LLVM_GISEL_COV_ENABLED") | + cmakedefine_sunset("LLVM_GISEL_COV_PREFIX") | + cmakedefine01_off("LLVM_SUPPORT_XCODE_SIGNPOSTS") | + select({ + "@platforms//os:macos": { + "#cmakedefine HAVE_PROC_PID_RUSAGE 1": "#define HAVE_PROC_PID_RUSAGE 1", + }, + "//conditions:default": { + "#cmakedefine HAVE_PROC_PID_RUSAGE 1": "/* undef HAVE_PROC_PID_RUSAGE */", + }, + }) | + cmakedefine( + "HAVE_BUILTIN_THREAD_POINTER", + enable = "@platforms//os:linux", + disable = ( + # HAVE_BUILTIN_THREAD_POINTER is true for on Linux outside of ppc64 + # for all recent toolchains. + "//config:powerpc64le-unknown-linux-gnu", + "//conditions:default", + ), + ) | + cmakedefine_vset("HAVE_GETAUXVAL") +) - # LLVM features - r'LTDL_SHLIB_EXT=\".dll\"', - r'LLVM_PLUGIN_EXT=\".dll\"', +# TODO(aaronmondal): Consider reimplementing `@platforms` in a way that +# bidirectionally maps to llvm/TargetParser/Triple.h. +TRIPLES = [ + "aarch64-unknown-linux-gnu", + "arm64-apple-darwin", + "powerpc64le-unknown-linux-gnu", + "systemz-unknown-linux_gnu", + "x86_64-pc-win32", + "x86_64-unknown-darwin", + "x86_64-unknown-linux-gnu", ] -# TODO: We should switch to platforms-based config settings to make this easier -# to express. -os_defines = select({ - "@bazel_tools//src/conditions:windows": win32_defines, - "@bazel_tools//src/conditions:darwin": macos_defines, - "@bazel_tools//src/conditions:freebsd": posix_defines, - "//conditions:default": linux_defines, -}) - -# HAVE_BUILTIN_THREAD_POINTER is true for on Linux (outside of ppc64) for -# all recent toolchains. Add it here by default on Linux as we can't perform a -# configure time check. -builtin_thread_pointer = select({ - "@bazel_tools//src/conditions:linux_ppc64le": [], - "@bazel_tools//src/conditions:linux": ["HAVE_BUILTIN_THREAD_POINTER"], - "//conditions:default": [], -}) - -# TODO: We should split out host vs. target here. -llvm_config_defines = os_defines + builtin_thread_pointer + select({ - "@bazel_tools//src/conditions:windows": native_arch_defines("X86", "x86_64-pc-win32"), - "@bazel_tools//src/conditions:darwin_arm64": native_arch_defines("AArch64", "arm64-apple-darwin"), - "@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"), - "@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"), - "@bazel_tools//src/conditions:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"), - "@bazel_tools//src/conditions:linux_s390x": native_arch_defines("SystemZ", "systemz-unknown-linux_gnu"), - "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"), -}) + [ - "LLVM_VERSION_MAJOR={}".format(LLVM_VERSION_MAJOR), - "LLVM_VERSION_MINOR={}".format(LLVM_VERSION_MINOR), - "LLVM_VERSION_PATCH={}".format(LLVM_VERSION_PATCH), - r'LLVM_VERSION_STRING=\"{}\"'.format(PACKAGE_VERSION), - # These shouldn't be needed by the C++11 standard, but are for some - # platforms (e.g. glibc < 2.18. See - # https://sourceware.org/bugzilla/show_bug.cgi?id=15366). These are also - # included unconditionally in the CMake build: - # https://github.com/llvm/llvm-project/blob/cd0dd8ece8e/llvm/cmake/modules/HandleLLVMOptions.cmake#L907-L909 - "__STDC_LIMIT_MACROS", - "__STDC_CONSTANT_MACROS", - "__STDC_FORMAT_MACROS", -] +LLVM_CONFIG_H_SUBSTITUTIONS = ( + cmakedefine_unset("LLVM_ENABLE_DUMP") | + # TODO(aaronmondal): Make this independent of the host triple. + select({ + "//config:{}".format(triple): {"${LLVM_DEFAULT_TARGET_TRIPLE}": triple} + for triple in TRIPLES + }) | + cmakedefine01_on("LLVM_ENABLE_THREADS") | + cmakedefine01_on("LLVM_HAS_ATOMICS") | + select({ + "//config:{}".format(triple): cmakedefine_sset( + "LLVM_HOST_TRIPLE", + triple, + ) + for triple in TRIPLES + }) | + select({ + "@platforms//cpu:{}".format(cpu): { + "#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}": "#define LLVM_NATIVE_ARCH {}".format(arch), + "#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser": "#define LLVM_NATIVE_ASMPARSER LLVMInitialize{}AsmParser".format(arch), + "#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter": "#define LLVM_NATIVE_ASMPRINTER LLVMInitialize{}AsmPrinter".format(arch), + "#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler": "#define LLVM_NATIVE_DISASSEMBLER LLVMInitialize{}Disassembler".format(arch), + "#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target": "#define LLVM_NATIVE_TARGET LLVMInitialize{}Target".format(arch), + "#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo": "#define LLVM_NATIVE_TARGETINFO LLVMInitialize{}TargetInfo".format(arch), + "#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC": "#define LLVM_NATIVE_TARGETMC LLVMInitialize{}TargetMC".format(arch), + "#cmakedefine LLVM_NATIVE_TARGETMCA LLVMInitialize${LLVM_NATIVE_ARCH}TargetMCA": "#define LLVM_NATIVE_TARGETMCA LLVMInitialize{}TargetMCA".format(arch), + } + for (cpu, arch) in [ + ("x86_64", "X86"), + ("aarch64", "AArch64"), + ("ppc64le", "PowerPC"), + ("s390x", "SystemZ"), + ] + }) | + { + "#cmakedefine01 LLVM_HAS_{}_TARGET".format( + target, + ): "#define LLVM_HAS_{}_TARGET {}".format( + target, + 1 if target in llvm_targets else 0, + ) + for target in [ + "AARCH64", + "AMDGPU", + "ARC", + "ARM", + "AVR", + "BPF", + "CSKY", + "DIRECTX", + "HEXAGON", + "LANAI", + "LOONGARCH", + "M68K", + "MIPS", + "MSP430", + "NVPTX", + "POWERPC", + "RISCV", + "SPARC", + "SPIRV", + "SYSTEMZ", + "VE", + "WEBASSEMBLY", + "X86", + "XCORE", + "XTENSA", + ] + } | + cmakedefine("LLVM_ON_UNIX", enable = "//config:posix") | + cmakedefine01_off("LLVM_USE_INTEL_JITEVENTS") | + cmakedefine01_off("LLVM_USE_OPROFILE") | + cmakedefine01_off("LLVM_USE_PERF") | + { + "${LLVM_VERSION_MAJOR}": LLVM_VERSION_MAJOR, + "${LLVM_VERSION_MINOR}": LLVM_VERSION_MINOR, + "${LLVM_VERSION_PATCH}": LLVM_VERSION_PATCH, + "${PACKAGE_VERSION}": PACKAGE_VERSION, + } | + cmakedefine01_off("LLVM_FORCE_ENABLE_STATS") | + cmakedefine_vunset("LLVM_WITH_Z3") | + cmakedefine_vunset("LLVM_ENABLE_CURL") | + cmakedefine_vunset("LLVM_ENABLE_HTTPLIB") | + cmakedefine01( + "LLVM_ENABLE_ZLIB", + disable = "//config:LLVM_ENABLE_ZLIB_disabled", + ) | + cmakedefine01( + "LLVM_ENABLE_ZSTD", + disable = "//config:LLVM_ENABLE_ZSTD_disabled", + ) | + cmakedefine_unset("LLVM_HAVE_TFLITE") | + cmakedefine("HAVE_SYSEXITS_H", enable = "//config:posix") | + cmakedefine_unset("LLVM_BUILD_LLVM_DYLIB") | + cmakedefine_unset("LLVM_BUILD_SHARED_LIBS") | + cmakedefine_vunset("LLVM_FORCE_USE_OLD_TOOLCHAIN") | + cmakedefine01_on("LLVM_UNREACHABLE_OPTIMIZE") | + cmakedefine01_off("LLVM_ENABLE_DIA_SDK") | + selects.with_or({ + # Note: Technically enabled for dynamic builds on Windows, but that's + # currently disabled globally in Bazel. + ( + "@platforms//os:windows", + "//config:LLVM_ENABLE_PLUGINS_disabled", + ): + cmakedefine_unset("LLVM_ENABLE_PLUGINS"), + # TODO(aaronmondal): The CMake build seems to have a slightly different + # intention for "OS390" but that doesn't seem to be a + # valid CMake option. Fix or clarify this in CMake. + ( + "//conditions:default", + "//config:LLVM_ENABLE_PLUGINS_enabled", + ): + cmakedefine_set("LLVM_ENABLE_PLUGINS") + }) | + select({ + "//config:LLVM_HAS_LOGF128_enabled": cmakedefine_set("LLVM_HAS_LOGF128"), + "//conditions:default": cmakedefine_unset("LLVM_HAS_LOGF128"), + }) | + cmakedefine_vunset("LLVM_BUILD_TELEMETRY") +) diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h deleted file mode 100644 index 93695f8e26d27..0000000000000 --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h +++ /dev/null @@ -1,314 +0,0 @@ -/*===------- llvm/Config/config.h - llvm configuration ------------*- C -*-===*/ -/* */ -/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ -/* Exceptions. */ -/* See https://llvm.org/LICENSE.txt for license information. */ -/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This is a manual port of config.h.cmake for the symbols that do not change - based on platform. Those that do change should not be defined here and - instead use Bazel cc_library defines. Some attempt has been made to extract - such symbols that do vary based on platform (for the platforms we care about) - into Bazel defines, but it is by no means complete, so if you see something - that looks wrong, it probably is. */ - -#ifndef CONFIG_H -#define CONFIG_H - -// Include this header only under the llvm source tree. -// This is a private header. - -/* Exported configuration */ -#include "llvm/Config/llvm-config.h" - -/* Bug report URL. */ -#define BUG_REPORT_URL "https://github.com/llvm/llvm-project/issues/" - -/* Define to 1 to enable backtraces, and to 0 otherwise. */ -#define ENABLE_BACKTRACES 1 - -/* Define to 1 to enable crash overrides, and to 0 otherwise. */ -#define ENABLE_CRASH_OVERRIDES 1 - -/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ -#define LLVM_ENABLE_CRASH_DUMPS 0 - -/* Define to 1 to prefer forward slashes on Windows, and to 0 prefer - backslashes. */ -#define LLVM_WINDOWS_PREFER_FORWARD_SLASH 0 - -/* Define to 1 if you have the `backtrace' function. */ -/* HAVE_BACKTRACE defined in Bazel */ - -/* BACKTRACE_HEADER defined in Bazel */ - -/* Define to 1 if you have the header file. */ -/* HAVE_CRASHREPORTERCLIENT_H defined in Bazel */ - -/* can use __crashreporter_info__ */ -/* HAVE_CRASHREPORTER_INFO defined in Bazel */ - -/* Define to 1 if you have the declaration of `arc4random', and to 0 if you - don't. */ -#define HAVE_DECL_ARC4RANDOM 0 - -/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you - don't. */ -#define HAVE_DECL_FE_ALL_EXCEPT 1 - -/* Define to 1 if you have the declaration of `FE_INEXACT', and to 0 if you - don't. */ -#define HAVE_DECL_FE_INEXACT 1 - -/* Define to 1 if you have the declaration of `strerror_s', and to 0 if you - don't. */ -#define HAVE_DECL_STRERROR_S 0 - -/* Define if dlopen() is available on this platform. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if we can register EH frames on this platform. */ -/* HAVE_REGISTER_FRAME defined in Bazel*/ - -/* Define to 1 if we can deregister EH frames on this platform. */ -/* HAVE_DEREGISTER_FRAME defined in Bazel*/ - -/* Define if __unw_add_dynamic_fde() is available on this platform. */ -/* HAVE_UNW_ADD_DYNAMIC_FDE defined in Bazel */ - -/* Define if libffi is available on this platform. */ -/* #undef HAVE_FFI_CALL */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_FFI_FFI_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_FFI_H */ - -/* Define to 1 if you have the `futimens' function. */ -#define HAVE_FUTIMENS 1 - -/* Define to 1 if you have the `futimes' function. */ -#define HAVE_FUTIMES 1 - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define to 1 if you have the `getrusage' function. */ -#define HAVE_GETRUSAGE 1 - -/* Define to 1 if you have the `isatty' function. */ -#define HAVE_ISATTY 1 - -/* Define to 1 if you have the `edit' library (-ledit). */ -/* #undef HAVE_LIBEDIT */ - -/* Define to 1 if you have the `pfm' library (-lpfm). */ -/* #undef HAVE_LIBPFM */ - -/* Define to 1 if the `perf_branch_entry' struct has field cycles. */ -/* #undef LIBPFM_HAS_FIELD_CYCLES */ - -/* Define to 1 if you have the `psapi' library (-lpsapi). */ -/* #undef HAVE_LIBPSAPI */ - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#define HAVE_LIBPTHREAD 1 - -/* Define to 1 if you have the `pthread_getname_np' function. */ -#define HAVE_PTHREAD_GETNAME_NP 1 - -/* Define to 1 if you have the `pthread_setname_np' function. */ -#define HAVE_PTHREAD_SETNAME_NP 1 - -/* Define to 1 if you have the header file. */ -/* HAVE_MACH_MACH_H defined in Bazel */ - -/* Define to 1 if you have the `mallctl' function. */ -/* #undef HAVE_MALLCTL */ - -/* Define to 1 if you have the `mallinfo' function. */ -/* HAVE_MALLINFO defined in Bazel */ - -/* Define to 1 if you have the header file. */ -/* HAVE_MALLOC_MALLOC_H defined in Bazel */ - -/* Define to 1 if you have the `malloc_zone_statistics' function. */ -/* HAVE_MALLOC_ZONE_STATISTICS defined in Bazel */ - -/* Define to 1 if you have the `posix_spawn' function. */ -#define HAVE_POSIX_SPAWN 1 - -/* Define to 1 if you have the `pread' function. */ -#define HAVE_PREAD 1 - -/* Define to 1 if you have the header file. */ -/* HAVE_PTHREAD_H defined in Bazel */ - -/* Have pthread_mutex_lock */ -#define HAVE_PTHREAD_MUTEX_LOCK 1 - -/* Have pthread_rwlock_init */ -#define HAVE_PTHREAD_RWLOCK_INIT 1 - -/* Define to 1 if you have the `sbrk' function. */ -/* HAVE_SBRK defined in Bazel */ - -/* Define to 1 if you have the `setenv' function. */ -/* HAVE_SETENV defined in Bazel */ - -/* Define to 1 if you have the `sigaltstack' function. */ -#define HAVE_SIGALTSTACK 1 - -/* Define to 1 if you have the `strerror_r' function. */ -/* HAVE_STRERROR_R defined in Bazel */ - -/* Define to 1 if you have the `sysconf' function. */ -#define HAVE_SYSCONF 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_MMAN_H 1 - -/* Define to 1 if stat struct has st_mtimespec member .*/ -/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC */ - -/* Define to 1 if stat struct has st_mtim member. */ -/* HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC defined in Bazel */ - -/* Define to 1 if you have the header file. */ -/* HAVE_UNISTD_H defined in Bazel */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_VALGRIND_VALGRIND_H */ - -/* Have host's _alloca */ -/* #undef HAVE__ALLOCA */ - -/* Define to 1 if you have the `_chsize_s' function. */ -/* #undef HAVE__CHSIZE_S */ - -/* Define to 1 if you have the `_Unwind_Backtrace' function. */ -#define HAVE__UNWIND_BACKTRACE 1 - -/* Have host's __alloca */ -/* #undef HAVE___ALLOCA */ - -/* Have host's __ashldi3 */ -/* #undef HAVE___ASHLDI3 */ - -/* Have host's __ashrdi3 */ -/* #undef HAVE___ASHRDI3 */ - -/* Have host's __chkstk */ -/* #undef HAVE___CHKSTK */ - -/* Have host's __chkstk_ms */ -/* #undef HAVE___CHKSTK_MS */ - -/* Have host's __cmpdi2 */ -/* #undef HAVE___CMPDI2 */ - -/* Have host's __divdi3 */ -/* #undef HAVE___DIVDI3 */ - -/* Have host's __fixdfdi */ -/* #undef HAVE___FIXDFDI */ - -/* Have host's __fixsfdi */ -/* #undef HAVE___FIXSFDI */ - -/* Have host's __floatdidf */ -/* #undef HAVE___FLOATDIDF */ - -/* Have host's __lshrdi3 */ -/* #undef HAVE___LSHRDI3 */ - -/* Have host's __main */ -/* #undef HAVE___MAIN */ - -/* Have host's __moddi3 */ -/* #undef HAVE___MODDI3 */ - -/* Have host's __udivdi3 */ -/* #undef HAVE___UDIVDI3 */ - -/* Have host's __umoddi3 */ -/* #undef HAVE___UMODDI3 */ - -/* Have host's ___chkstk */ -/* #undef HAVE____CHKSTK */ - -/* Have host's ___chkstk_ms */ -/* #undef HAVE____CHKSTK_MS */ - -/* Linker version detected at compile time. */ -/* #undef HOST_LINK_VERSION */ - -/* Define if zlib compression is available */ -/* LLVM_ENABLE_ZLIB defined in Bazel */ - -/* Define if overriding target triple is enabled */ -/* #undef LLVM_TARGET_TRIPLE_ENV */ - -/* Whether tools show host and target info when invoked with --version */ -#define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1 - -/* Whether tools show optional build config flags when invoked with --version */ -#define LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG 1 - -/* Define if libxml2 is supported on this platform. */ -/* #undef LLVM_ENABLE_LIBXML2 */ - -/* Define to the extension used for shared libraries, say, ".so". */ -/* LTDL_SHLIB_EXT defined in Bazel */ - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "https://github.com/llvm/llvm-project/issues/" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "LLVM" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING PACKAGE_NAME " " LLVM_VERSION_STRING - -/* Define to the version of this package. */ -#define PACKAGE_VERSION LLVM_VERSION_STRING - -/* Define to the vendor of this package. */ -/* #undef PACKAGE_VENDOR */ - -/* Define to a function implementing stricmp */ -/* stricmp defined conditionally below. */ - -/* Define to a function implementing strdup */ -/* strdup defined conditionally below. */ - -/* Whether GlobalISel rule coverage is being collected */ -#define LLVM_GISEL_COV_ENABLED 0 - -/* Define to the default GlobalISel coverage file prefix */ -/* #undef LLVM_GISEL_COV_PREFIX */ - -/* Whether Timers signpost passes in Xcode Instruments */ -#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0 - -/* HAVE_PROC_PID_RUSAGE defined in Bazel */ - -#define HAVE_GETAUXVAL 1 - -/* Directly provide definitions here behind platform preprocessor definitions. - * The preprocessor conditions are sufficient to handle all of the configuration - * on platforms targeted by Bazel, and defining these here more faithfully - * matches how the users of this header expect things to work with CMake. - * FIXME: We should consider moving other platform defines to use this technique - * as well. - */ - -#ifdef _WIN32 -#define stricmp _stricmp -#define strdup _strdup -#endif - -#endif diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h deleted file mode 100644 index 5240b8299c109..0000000000000 --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/llvm-config.h +++ /dev/null @@ -1,127 +0,0 @@ -/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/ -/* */ -/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ -/* Exceptions. */ -/* See https://llvm.org/LICENSE.txt for license information. */ -/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This is a manual port of config.h.cmake for the symbols that do not change - based on platform. Those that do change should not be defined here and - instead use Bazel cc_library defines. Some attempt has been made to extract - such symbols that do vary based on platform (for the platforms we care about) - into Bazel defines, but it is by no means complete, so if you see something - that looks wrong, it probably is. */ - - -/* This file enumerates variables from the LLVM configuration so that they - can be in exported headers and won't override package specific directives. - This is a C header that can be included in the llvm-c headers. */ - -#ifndef LLVM_CONFIG_H -#define LLVM_CONFIG_H - -/* Define if LLVM_ENABLE_DUMP is enabled */ -/* #undef LLVM_ENABLE_DUMP */ - -/* Target triple LLVM will generate code for by default */ -/* LLVM_DEFAULT_TARGET_TRIPLE defined in Bazel */ - -/* Define if threads enabled */ -#define LLVM_ENABLE_THREADS 1 - -/* Has gcc/MSVC atomic intrinsics */ -#define LLVM_HAS_ATOMICS 1 - -/* Host triple LLVM will be executed on */ -/* LLVM_HOST_TRIPLE defined in Bazel */ - -/* LLVM architecture name for the native architecture, if available */ -/* LLVM_NATIVE_ARCH defined in Bazel */ - -/* LLVM name for the native AsmParser init function, if available */ -/* LLVM_NATIVE_ASMPARSER defined in Bazel */ - -/* LLVM name for the native AsmPrinter init function, if available */ -/* LLVM_NATIVE_ASMPRINTER defined in Bazel */ - -/* LLVM name for the native Disassembler init function, if available */ -/* LLVM_NATIVE_DISASSEMBLER defined in Bazel */ - -/* LLVM name for the native Target init function, if available */ -/* LLVM_NATIVE_TARGET defined in Bazel */ - -/* LLVM name for the native TargetInfo init function, if available */ -/* LLVM_NATIVE_TARGETINFO defined in Bazel */ - -/* LLVM name for the native target MC init function, if available */ -/* LLVM_NATIVE_TARGETMC defined in Bazel */ - -/* LLVM name for the native target MCA init function, if available */ -/* LLVM_NATIVE_TARGETMCA defined in Bazel */ - -/* Define if this is Unixish platform */ -/* LLVM_ON_UNIX defined in Bazel */ - -/* Define if we have the Intel JIT API runtime support library */ -#define LLVM_USE_INTEL_JITEVENTS 0 - -/* Define if we have the oprofile JIT-support library */ -#define LLVM_USE_OPROFILE 0 - -/* Define if we have the perf JIT-support library */ -#define LLVM_USE_PERF 0 - -/* Major version of the LLVM API */ -/* #undef LLVM_VERSION_MAJOR */ - -/* Minor version of the LLVM API */ -/* #undef LLVM_VERSION_MINOR */ - -/* Patch version of the LLVM API */ -/* #undef LLVM_VERSION_PATCH */ - -/* LLVM version string */ -/* #undef LLVM_VERSION_STRING */ - -/* Whether LLVM records statistics for use with GetStatistics(), - * PrintStatistics() or PrintStatisticsJSON() - */ -#define LLVM_FORCE_ENABLE_STATS 0 - -/* Define if we have z3 and want to build it */ -/* #undef LLVM_WITH_Z3 */ - -/* Define if we have curl and want to use it */ -/* #undef LLVM_ENABLE_CURL */ - -/* Define if we have cpp-httplib and want to use it */ -/* #undef LLVM_ENABLE_HTTPLIB */ - -/* Define if LLVM was built with a dependency to the tensorflow compiler */ -/* #undef LLVM_HAVE_TF_AOT */ - -/* Define to 1 if you have the header file. */ -/* HAVE_SYSEXITS_H defined in Bazel */ - -/* Define if the xar_open() function is supported this platform. */ -/* #undef HAVE_LIBXAR */ - -/* Define if building libLLVM shared library */ -/* #undef LLVM_BUILD_LLVM_DYLIB */ - -/* Define if building LLVM with BUILD_SHARED_LIBS */ -/* #undef LLVM_BUILD_SHARED_LIBS */ - -/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */ -/* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN ${LLVM_FORCE_USE_OLD_TOOLCHAIN} */ - -/* Define if llvm_unreachable should be optimized with undefined behavior - * in non assert builds */ -#define LLVM_UNREACHABLE_OPTIMIZE 1 - -/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */ -#define LLVM_ENABLE_DIA_SDK 0 - -#endif diff --git a/utils/bazel/llvm-project-overlay/platform/BUILD.bazel b/utils/bazel/llvm-project-overlay/platform/BUILD.bazel new file mode 100644 index 0000000000000..80b73f79ca572 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/platform/BUILD.bazel @@ -0,0 +1,64 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +"""Targetable platforms for the Bazel build.""" + +# TODO(aaronmondal): Add triples for more useful platforms as per +# `llvm/include/llvm/TargetParser/Triple.h`. + +platform( + name = "aarch64-unknown-linux-gnu", + constraint_values = [ + "@platforms//cpu:aarch64", + "@platforms//os:linux", + ], +) + +platform( + name = "arm64-apple-darwin", + constraint_values = [ + "@platforms//cpu:arm64", + "@platforms//os:macos", + ], +) + +platform( + name = "powerpc64le-unknown-linux-gnu", + constraint_values = [ + "@platforms//cpu:ppc64le", + "@platforms//os:linux", + ], +) + +platform( + name = "systemz-unknown-linux_gnu", + constraint_values = [ + "@platforms//cpu:s390x", + "@platforms//os:linux", + ], +) + +platform( + name = "x86_64-pc-win32", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], +) + +platform( + name = "x86_64-unknown-darwin", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:macos", + ], +) + +platform( + name = "x86_64-unknown-linux-gnu", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], +) diff --git a/utils/bazel/llvm_configs/BUILD.bazel b/utils/bazel/llvm_configs/BUILD.bazel deleted file mode 100644 index 5a4f9970c0636..0000000000000 --- a/utils/bazel/llvm_configs/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -# These diff tests ensure that the current Bazel configuration does not drift -# from the configuration in the .cmake files, since we don't alway use them -# directly (and even if we did we wouldn't necessarily pick up changes there). -# These are literal change-detector tests. We perform diff testing here since -# it isn't really part of building LLVM and we don't want to include the config -# copies in the workspace used by dependent projects. - -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") - -diff_test( - name = "diff_config.h.cmake", - file1 = "@llvm-project//llvm:include/llvm/Config/config.h.cmake", - file2 = "config.h.cmake", -) - -diff_test( - name = "diff_llvm-config.h.cmake", - file1 = "@llvm-project//llvm:include/llvm/Config/llvm-config.h.cmake", - file2 = "llvm-config.h.cmake", -) - -diff_test( - name = "diff_abi-breaking.h.cmake", - file1 = "@llvm-project//llvm:include/llvm/Config/abi-breaking.h.cmake", - file2 = "abi-breaking.h.cmake", -) diff --git a/utils/bazel/llvm_configs/abi-breaking.h.cmake b/utils/bazel/llvm_configs/abi-breaking.h.cmake deleted file mode 100644 index 2d27e02b1d545..0000000000000 --- a/utils/bazel/llvm_configs/abi-breaking.h.cmake +++ /dev/null @@ -1,62 +0,0 @@ -/*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/ -/* */ -/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ -/* Exceptions. */ -/* See https://llvm.org/LICENSE.txt for license information. */ -/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This file controls the C++ ABI break introduced in LLVM public header. */ - -#ifndef LLVM_ABI_BREAKING_CHECKS_H -#define LLVM_ABI_BREAKING_CHECKS_H - -/* Define to enable checks that alter the LLVM C++ ABI */ -#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS - -/* Define to enable reverse iteration of unordered llvm containers */ -#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION - -/* Allow selectively disabling link-time mismatch checking so that header-only - ADT content from LLVM can be used without linking libSupport. */ -#if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING - -// ABI_BREAKING_CHECKS protection: provides link-time failure when clients build -// mismatch with LLVM -#if defined(_MSC_VER) -// Use pragma with MSVC -#define LLVM_XSTR(s) LLVM_STR(s) -#define LLVM_STR(s) #s -#pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS)) -#undef LLVM_XSTR -#undef LLVM_STR -#elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch -// FIXME: Implement checks without weak. -#elif defined(__cplusplus) -#if !(defined(_AIX) && defined(__GNUC__) && !defined(__clang__)) -#define LLVM_HIDDEN_VISIBILITY __attribute__ ((visibility("hidden"))) -#else -// GCC on AIX does not support visibility attributes. Symbols are not -// exported by default on AIX. -#define LLVM_HIDDEN_VISIBILITY -#endif -namespace llvm { -#if LLVM_ENABLE_ABI_BREAKING_CHECKS -extern int EnableABIBreakingChecks; -LLVM_HIDDEN_VISIBILITY -__attribute__((weak)) int *VerifyEnableABIBreakingChecks = - &EnableABIBreakingChecks; -#else -extern int DisableABIBreakingChecks; -LLVM_HIDDEN_VISIBILITY -__attribute__((weak)) int *VerifyDisableABIBreakingChecks = - &DisableABIBreakingChecks; -#endif -} -#undef LLVM_HIDDEN_VISIBILITY -#endif // _MSC_VER - -#endif // LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING - -#endif diff --git a/utils/bazel/llvm_configs/config.h.cmake b/utils/bazel/llvm_configs/config.h.cmake deleted file mode 100644 index 835201f2a45b0..0000000000000 --- a/utils/bazel/llvm_configs/config.h.cmake +++ /dev/null @@ -1,300 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -// Include this header only under the llvm source tree. -// This is a private header. - -/* Exported configuration */ -#include "llvm/Config/llvm-config.h" - -/* Bug report URL. */ -#define BUG_REPORT_URL "${BUG_REPORT_URL}" - -/* Define to 1 to enable backtraces, and to 0 otherwise. */ -#cmakedefine01 ENABLE_BACKTRACES - -/* Define to 1 to enable crash overrides, and to 0 otherwise. */ -#cmakedefine01 ENABLE_CRASH_OVERRIDES - -/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ -#cmakedefine01 LLVM_ENABLE_CRASH_DUMPS - -/* Define to 1 to enable expensive checks for debug location coverage checking, - and to 0 otherwise. */ -#cmakedefine01 ENABLE_DEBUGLOC_COVERAGE_TRACKING - -/* Define to 1 to prefer forward slashes on Windows, and to 0 prefer - backslashes. */ -#cmakedefine01 LLVM_WINDOWS_PREFER_FORWARD_SLASH - -/* Define to 1 if you have the `backtrace' function. */ -#cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE} - -#define BACKTRACE_HEADER <${BACKTRACE_HEADER}> - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_CRASHREPORTERCLIENT_H - -/* can use __crashreporter_info__ */ -#cmakedefine01 HAVE_CRASHREPORTER_INFO - -/* Define to 1 if you have the declaration of `arc4random', and to 0 if you - don't. */ -#cmakedefine01 HAVE_DECL_ARC4RANDOM - -/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you - don't. */ -#cmakedefine01 HAVE_DECL_FE_ALL_EXCEPT - -/* Define to 1 if you have the declaration of `FE_INEXACT', and to 0 if you - don't. */ -#cmakedefine01 HAVE_DECL_FE_INEXACT - -/* Define to 1 if you have the declaration of `strerror_s', and to 0 if you - don't. */ -#cmakedefine01 HAVE_DECL_STRERROR_S - -/* Define if dlopen() is available on this platform. */ -#cmakedefine HAVE_DLOPEN ${HAVE_DLOPEN} - -/* Define to 1 if we can register EH frames on this platform. */ -#cmakedefine HAVE_REGISTER_FRAME ${HAVE_REGISTER_FRAME} - -/* Define to 1 if we can deregister EH frames on this platform. */ -#cmakedefine HAVE_DEREGISTER_FRAME ${HAVE_DEREGISTER_FRAME} - -/* Define if __unw_add_dynamic_fde() is available on this platform. */ -#cmakedefine HAVE_UNW_ADD_DYNAMIC_FDE ${HAVE_UNW_ADD_DYNAMIC_FDE} - -/* Define if libffi is available on this platform. */ -#cmakedefine HAVE_FFI_CALL ${HAVE_FFI_CALL} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_FFI_FFI_H ${HAVE_FFI_FFI_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_FFI_H ${HAVE_FFI_H} - -/* Define to 1 if you have the `futimens' function. */ -#cmakedefine HAVE_FUTIMENS ${HAVE_FUTIMENS} - -/* Define to 1 if you have the `futimes' function. */ -#cmakedefine HAVE_FUTIMES ${HAVE_FUTIMES} - -/* Define to 1 if you have the `getpagesize' function. */ -#cmakedefine HAVE_GETPAGESIZE ${HAVE_GETPAGESIZE} - -/* Define to 1 if you have the `getrusage' function. */ -#cmakedefine HAVE_GETRUSAGE ${HAVE_GETRUSAGE} - -/* Define to 1 if you have the `isatty' function. */ -#cmakedefine HAVE_ISATTY 1 - -/* Define to 1 if you have the `edit' library (-ledit). */ -#cmakedefine HAVE_LIBEDIT ${HAVE_LIBEDIT} - -/* Define to 1 if you have the `pfm' library (-lpfm). */ -#cmakedefine HAVE_LIBPFM ${HAVE_LIBPFM} - -/* Define to 1 if the `perf_branch_entry' struct has field cycles. */ -#cmakedefine LIBPFM_HAS_FIELD_CYCLES ${LIBPFM_HAS_FIELD_CYCLES} - -/* Define to 1 if you have the `psapi' library (-lpsapi). */ -#cmakedefine HAVE_LIBPSAPI ${HAVE_LIBPSAPI} - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#cmakedefine HAVE_LIBPTHREAD ${HAVE_LIBPTHREAD} - -/* Define to 1 if you have the `pthread_getname_np' function. */ -#cmakedefine HAVE_PTHREAD_GETNAME_NP ${HAVE_PTHREAD_GETNAME_NP} - -/* Define to 1 if you have the `pthread_setname_np' function. */ -#cmakedefine HAVE_PTHREAD_SETNAME_NP ${HAVE_PTHREAD_SETNAME_NP} - -/* Define to 1 if you have the `pthread_get_name_np' function. */ -#cmakedefine HAVE_PTHREAD_GET_NAME_NP ${HAVE_PTHREAD_GET_NAME_NP} - -/* Define to 1 if you have the `pthread_set_name_np' function. */ -#cmakedefine HAVE_PTHREAD_SET_NAME_NP ${HAVE_PTHREAD_SET_NAME_NP} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H} - -/* Define to 1 if you have the `mallctl' function. */ -#cmakedefine HAVE_MALLCTL ${HAVE_MALLCTL} - -/* Define to 1 if you have the `mallinfo' function. */ -#cmakedefine HAVE_MALLINFO ${HAVE_MALLINFO} - -/* Define to 1 if you have the `mallinfo2' function. */ -#cmakedefine HAVE_MALLINFO2 ${HAVE_MALLINFO2} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MALLOC_MALLOC_H ${HAVE_MALLOC_MALLOC_H} - -/* Define to 1 if you have the `malloc_zone_statistics' function. */ -#cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} - -/* Define to 1 if you have the `posix_spawn' function. */ -#cmakedefine HAVE_POSIX_SPAWN ${HAVE_POSIX_SPAWN} - -/* Define to 1 if you have the `pread' function. */ -#cmakedefine HAVE_PREAD ${HAVE_PREAD} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_PTHREAD_H ${HAVE_PTHREAD_H} - -/* Have pthread_mutex_lock */ -#cmakedefine HAVE_PTHREAD_MUTEX_LOCK ${HAVE_PTHREAD_MUTEX_LOCK} - -/* Have pthread_rwlock_init */ -#cmakedefine HAVE_PTHREAD_RWLOCK_INIT ${HAVE_PTHREAD_RWLOCK_INIT} - -/* Define to 1 if you have the `sbrk' function. */ -#cmakedefine HAVE_SBRK ${HAVE_SBRK} - -/* Define to 1 if you have the `setenv' function. */ -#cmakedefine HAVE_SETENV ${HAVE_SETENV} - -/* Define to 1 if you have the `sigaltstack' function. */ -#cmakedefine HAVE_SIGALTSTACK ${HAVE_SIGALTSTACK} - -/* Define to 1 if you have the `strerror_r' function. */ -#cmakedefine HAVE_STRERROR_R ${HAVE_STRERROR_R} - -/* Define to 1 if you have the `sysconf' function. */ -#cmakedefine HAVE_SYSCONF ${HAVE_SYSCONF} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_MMAN_H ${HAVE_SYS_MMAN_H} - -/* Define to 1 if stat struct has st_mtimespec member .*/ -#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC ${HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC} - -/* Define to 1 if stat struct has st_mtim member. */ -#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC ${HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H} - -/* Have host's _alloca */ -#cmakedefine HAVE__ALLOCA ${HAVE__ALLOCA} - -/* Define to 1 if you have the `_chsize_s' function. */ -#cmakedefine HAVE__CHSIZE_S ${HAVE__CHSIZE_S} - -/* Define to 1 if you have the `_Unwind_Backtrace' function. */ -#cmakedefine HAVE__UNWIND_BACKTRACE ${HAVE__UNWIND_BACKTRACE} - -/* Have host's __alloca */ -#cmakedefine HAVE___ALLOCA ${HAVE___ALLOCA} - -/* Have host's __ashldi3 */ -#cmakedefine HAVE___ASHLDI3 ${HAVE___ASHLDI3} - -/* Have host's __ashrdi3 */ -#cmakedefine HAVE___ASHRDI3 ${HAVE___ASHRDI3} - -/* Have host's __chkstk */ -#cmakedefine HAVE___CHKSTK ${HAVE___CHKSTK} - -/* Have host's __chkstk_ms */ -#cmakedefine HAVE___CHKSTK_MS ${HAVE___CHKSTK_MS} - -/* Have host's __cmpdi2 */ -#cmakedefine HAVE___CMPDI2 ${HAVE___CMPDI2} - -/* Have host's __divdi3 */ -#cmakedefine HAVE___DIVDI3 ${HAVE___DIVDI3} - -/* Have host's __fixdfdi */ -#cmakedefine HAVE___FIXDFDI ${HAVE___FIXDFDI} - -/* Have host's __fixsfdi */ -#cmakedefine HAVE___FIXSFDI ${HAVE___FIXSFDI} - -/* Have host's __floatdidf */ -#cmakedefine HAVE___FLOATDIDF ${HAVE___FLOATDIDF} - -/* Have host's __lshrdi3 */ -#cmakedefine HAVE___LSHRDI3 ${HAVE___LSHRDI3} - -/* Have host's __main */ -#cmakedefine HAVE___MAIN ${HAVE___MAIN} - -/* Have host's __moddi3 */ -#cmakedefine HAVE___MODDI3 ${HAVE___MODDI3} - -/* Have host's __udivdi3 */ -#cmakedefine HAVE___UDIVDI3 ${HAVE___UDIVDI3} - -/* Have host's __umoddi3 */ -#cmakedefine HAVE___UMODDI3 ${HAVE___UMODDI3} - -/* Have host's ___chkstk */ -#cmakedefine HAVE____CHKSTK ${HAVE____CHKSTK} - -/* Have host's ___chkstk_ms */ -#cmakedefine HAVE____CHKSTK_MS ${HAVE____CHKSTK_MS} - -/* Linker version detected at compile time. */ -#cmakedefine HOST_LINK_VERSION "${HOST_LINK_VERSION}" - -/* Define if overriding target triple is enabled */ -#cmakedefine LLVM_TARGET_TRIPLE_ENV "${LLVM_TARGET_TRIPLE_ENV}" - -/* Whether tools show host and target info when invoked with --version */ -#cmakedefine01 LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO - -/* Whether tools show optional build config flags when invoked with --version */ -#cmakedefine01 LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG - -/* Define if libxml2 is supported on this platform. */ -#cmakedefine LLVM_ENABLE_LIBXML2 ${LLVM_ENABLE_LIBXML2} - -/* Define to the extension used for shared libraries, say, ".so". */ -#cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}" - -/* Define to the extension used for plugin libraries, say, ".so". */ -#cmakedefine LLVM_PLUGIN_EXT "${LLVM_PLUGIN_EXT}" - -/* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}" - -/* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}" - -/* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "${PACKAGE_STRING}" - -/* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}" - -/* Define to the vendor of this package. */ -#cmakedefine PACKAGE_VENDOR "${PACKAGE_VENDOR}" - -/* Define to a function implementing stricmp */ -#cmakedefine stricmp ${stricmp} - -/* Define to a function implementing strdup */ -#cmakedefine strdup ${strdup} - -/* Whether GlobalISel rule coverage is being collected */ -#cmakedefine01 LLVM_GISEL_COV_ENABLED - -/* Define to the default GlobalISel coverage file prefix */ -#cmakedefine LLVM_GISEL_COV_PREFIX "${LLVM_GISEL_COV_PREFIX}" - -/* Whether Timers signpost passes in Xcode Instruments */ -#cmakedefine01 LLVM_SUPPORT_XCODE_SIGNPOSTS - -#cmakedefine HAVE_PROC_PID_RUSAGE 1 - -#cmakedefine HAVE_BUILTIN_THREAD_POINTER ${HAVE_BUILTIN_THREAD_POINTER} - -#cmakedefine HAVE_GETAUXVAL ${HAVE_GETAUXVAL} - -#endif diff --git a/utils/bazel/llvm_configs/llvm-config.h.cmake b/utils/bazel/llvm_configs/llvm-config.h.cmake deleted file mode 100644 index 239f9dd3f38db..0000000000000 --- a/utils/bazel/llvm_configs/llvm-config.h.cmake +++ /dev/null @@ -1,207 +0,0 @@ -/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/ -/* */ -/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ -/* Exceptions. */ -/* See https://llvm.org/LICENSE.txt for license information. */ -/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This file enumerates variables from the LLVM configuration so that they - can be in exported headers and won't override package specific directives. - This is a C header that can be included in the llvm-c headers. */ - -#ifndef LLVM_CONFIG_H -#define LLVM_CONFIG_H - -/* Define if LLVM_ENABLE_DUMP is enabled */ -#cmakedefine LLVM_ENABLE_DUMP - -/* Target triple LLVM will generate code for by default */ -/* Doesn't use `cmakedefine` because it is allowed to be empty. */ -#define LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}" - -/* Define if threads enabled */ -#cmakedefine01 LLVM_ENABLE_THREADS - -/* Has gcc/MSVC atomic intrinsics */ -#cmakedefine01 LLVM_HAS_ATOMICS - -/* Host triple LLVM will be executed on */ -#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}" - -/* LLVM architecture name for the native architecture, if available */ -#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH} - -/* LLVM name for the native AsmParser init function, if available */ -#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser - -/* LLVM name for the native AsmPrinter init function, if available */ -#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter - -/* LLVM name for the native Disassembler init function, if available */ -#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler - -/* LLVM name for the native Target init function, if available */ -#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target - -/* LLVM name for the native TargetInfo init function, if available */ -#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo - -/* LLVM name for the native target MC init function, if available */ -#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC - -/* LLVM name for the native target MCA init function, if available */ -#cmakedefine LLVM_NATIVE_TARGETMCA LLVMInitialize${LLVM_NATIVE_ARCH}TargetMCA - -/* Define if the AArch64 target is built in */ -#cmakedefine01 LLVM_HAS_AARCH64_TARGET - -/* Define if the AMDGPU target is built in */ -#cmakedefine01 LLVM_HAS_AMDGPU_TARGET - -/* Define if the ARC target is built in */ -#cmakedefine01 LLVM_HAS_ARC_TARGET - -/* Define if the ARM target is built in */ -#cmakedefine01 LLVM_HAS_ARM_TARGET - -/* Define if the AVR target is built in */ -#cmakedefine01 LLVM_HAS_AVR_TARGET - -/* Define if the BPF target is built in */ -#cmakedefine01 LLVM_HAS_BPF_TARGET - -/* Define if the CSKY target is built in */ -#cmakedefine01 LLVM_HAS_CSKY_TARGET - -/* Define if the DirectX target is built in */ -#cmakedefine01 LLVM_HAS_DIRECTX_TARGET - -/* Define if the Hexagon target is built in */ -#cmakedefine01 LLVM_HAS_HEXAGON_TARGET - -/* Define if the Lanai target is built in */ -#cmakedefine01 LLVM_HAS_LANAI_TARGET - -/* Define if the LoongArch target is built in */ -#cmakedefine01 LLVM_HAS_LOONGARCH_TARGET - -/* Define if the M68k target is built in */ -#cmakedefine01 LLVM_HAS_M68K_TARGET - -/* Define if the Mips target is built in */ -#cmakedefine01 LLVM_HAS_MIPS_TARGET - -/* Define if the MSP430 target is built in */ -#cmakedefine01 LLVM_HAS_MSP430_TARGET - -/* Define if the NVPTX target is built in */ -#cmakedefine01 LLVM_HAS_NVPTX_TARGET - -/* Define if the PowerPC target is built in */ -#cmakedefine01 LLVM_HAS_POWERPC_TARGET - -/* Define if the RISCV target is built in */ -#cmakedefine01 LLVM_HAS_RISCV_TARGET - -/* Define if the Sparc target is built in */ -#cmakedefine01 LLVM_HAS_SPARC_TARGET - -/* Define if the SPIRV target is built in */ -#cmakedefine01 LLVM_HAS_SPIRV_TARGET - -/* Define if the SystemZ target is built in */ -#cmakedefine01 LLVM_HAS_SYSTEMZ_TARGET - -/* Define if the VE target is built in */ -#cmakedefine01 LLVM_HAS_VE_TARGET - -/* Define if the WebAssembly target is built in */ -#cmakedefine01 LLVM_HAS_WEBASSEMBLY_TARGET - -/* Define if the X86 target is built in */ -#cmakedefine01 LLVM_HAS_X86_TARGET - -/* Define if the XCore target is built in */ -#cmakedefine01 LLVM_HAS_XCORE_TARGET - -/* Define if the Xtensa target is built in */ -#cmakedefine01 LLVM_HAS_XTENSA_TARGET - -/* Define if this is Unixish platform */ -#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX} - -/* Define if we have the Intel JIT API runtime support library */ -#cmakedefine01 LLVM_USE_INTEL_JITEVENTS - -/* Define if we have the oprofile JIT-support library */ -#cmakedefine01 LLVM_USE_OPROFILE - -/* Define if we have the perf JIT-support library */ -#cmakedefine01 LLVM_USE_PERF - -/* Major version of the LLVM API */ -#define LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR} - -/* Minor version of the LLVM API */ -#define LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR} - -/* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH} - -/* LLVM version string */ -#define LLVM_VERSION_STRING "${PACKAGE_VERSION}" - -/* Whether LLVM records statistics for use with GetStatistics(), - * PrintStatistics() or PrintStatisticsJSON() - */ -#cmakedefine01 LLVM_FORCE_ENABLE_STATS - -/* Define if we have z3 and want to build it */ -#cmakedefine LLVM_WITH_Z3 ${LLVM_WITH_Z3} - -/* Define if we have curl and want to use it */ -#cmakedefine LLVM_ENABLE_CURL ${LLVM_ENABLE_CURL} - -/* Define if we have cpp-httplib and want to use it */ -#cmakedefine LLVM_ENABLE_HTTPLIB ${LLVM_ENABLE_HTTPLIB} - -/* Define if zlib compression is available */ -#cmakedefine01 LLVM_ENABLE_ZLIB - -/* Define if zstd compression is available */ -#cmakedefine01 LLVM_ENABLE_ZSTD - -/* Define if LLVM is using tflite */ -#cmakedefine LLVM_HAVE_TFLITE - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H} - -/* Define if building libLLVM shared library */ -#cmakedefine LLVM_BUILD_LLVM_DYLIB - -/* Define if building LLVM with BUILD_SHARED_LIBS */ -#cmakedefine LLVM_BUILD_SHARED_LIBS - -/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */ -#cmakedefine LLVM_FORCE_USE_OLD_TOOLCHAIN ${LLVM_FORCE_USE_OLD_TOOLCHAIN} - -/* Define if llvm_unreachable should be optimized with undefined behavior - * in non assert builds */ -#cmakedefine01 LLVM_UNREACHABLE_OPTIMIZE - -/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */ -#cmakedefine01 LLVM_ENABLE_DIA_SDK - -/* Define if plugins enabled */ -#cmakedefine LLVM_ENABLE_PLUGINS - -/* Define if logf128 is available */ -#cmakedefine LLVM_HAS_LOGF128 - -/* Define if building LLVM with LLVM_BUILD_TELEMETRY */ -#cmakedefine LLVM_BUILD_TELEMETRY ${LLVM_BUILD_TELEMETRY} - -#endif diff --git a/utils/bazel/overlay_directories.py b/utils/bazel/overlay_directories.py index 526a78e978e5d..53933ce54bcfa 100755 --- a/utils/bazel/overlay_directories.py +++ b/utils/bazel/overlay_directories.py @@ -86,12 +86,15 @@ def main(args): os.path.join(args.overlay, relpath), os.path.join(args.target, relpath) ) - for src_entry in os.listdir(os.path.join(args.src, rel_root)): - if src_entry not in dirs: - relpath = os.path.join(rel_root, src_entry) - _symlink_abs( - os.path.join(args.src, relpath), os.path.join(args.target, relpath) - ) + src_path = os.path.join(args.src, rel_root) + if os.path.isdir(src_path): + for src_entry in os.listdir(src_path): + if src_entry not in dirs: + relpath = os.path.join(rel_root, src_entry) + _symlink_abs( + os.path.join(args.src, relpath), + os.path.join(args.target, relpath), + ) if __name__ == "__main__": diff --git a/utils/bazel/third_party_build/nanobind.BUILD b/utils/bazel/third_party_build/nanobind.BUILD index 262d14a040b87..88c0c534f1f08 100644 --- a/utils/bazel/third_party_build/nanobind.BUILD +++ b/utils/bazel/third_party_build/nanobind.BUILD @@ -19,7 +19,7 @@ cc_library( ), visibility = ["//visibility:public"], deps = [ - "@robin_map", + "@robin-map", "@rules_python//python/cc:current_py_cc_headers", ], ) diff --git a/utils/bazel/third_party_build/robin_map.BUILD b/utils/bazel/third_party_build/robin_map.BUILD index b8d04beaed81f..cd68a84f5569a 100644 --- a/utils/bazel/third_party_build/robin_map.BUILD +++ b/utils/bazel/third_party_build/robin_map.BUILD @@ -1,5 +1,5 @@ cc_library( - name = "robin_map", + name = "robin-map", hdrs = [ "include/tsl/robin_growth_policy.h", "include/tsl/robin_hash.h", diff --git a/utils/bazel/third_party_build/zlib-ng.BUILD b/utils/bazel/third_party_build/zlib-ng.BUILD index 055261acb0f69..eee89f2695294 100644 --- a/utils/bazel/third_party_build/zlib-ng.BUILD +++ b/utils/bazel/third_party_build/zlib-ng.BUILD @@ -10,16 +10,6 @@ package( licenses = ["notice"], ) -bool_flag( - name = "llvm_enable_zlib", - build_setting_default = True, -) - -config_setting( - name = "llvm_zlib_enabled", - flag_values = {":llvm_enable_zlib": "true"}, -) - genrule( # The input template is identical to the CMake output. name = "zconf_gen", @@ -29,62 +19,56 @@ genrule( ) cc_library( - name = "zlib", - srcs = select({ - ":llvm_zlib_enabled": [ - "adler32.c", - "adler32_p.h", - "chunkset.c", - "chunkset_tpl.h", - "compare258.c", - "compress.c", - "crc32.c", - "crc32_comb.c", - "crc32_comb_tbl.h", - "crc32_p.h", - "crc32_tbl.h", - "deflate.c", - "deflate.h", - "deflate_fast.c", - "deflate_medium.c", - "deflate_p.h", - "deflate_quick.c", - "deflate_slow.c", - "fallback_builtins.h", - "functable.c", - "functable.h", - "infback.c", - "inffast.c", - "inffast.h", - "inffixed_tbl.h", - "inflate.c", - "inflate.h", - "inflate_p.h", - "inftrees.c", - "inftrees.h", - "insert_string.c", - "insert_string_tpl.h", - "match_tpl.h", - "trees.c", - "trees.h", - "trees_emit.h", - "trees_tbl.h", - "uncompr.c", - "zbuild.h", - "zendian.h", - "zutil.c", - "zutil.h", - "zutil_p.h", - ], - "//conditions:default": [], - }), - hdrs = select({ - ":llvm_zlib_enabled": [ - "zlib.h", - ":zconf_gen", - ], - "//conditions:default": [], - }), + name = "zlib-ng", + srcs = [ + "adler32.c", + "adler32_p.h", + "chunkset.c", + "chunkset_tpl.h", + "compare258.c", + "compress.c", + "crc32.c", + "crc32_comb.c", + "crc32_comb_tbl.h", + "crc32_p.h", + "crc32_tbl.h", + "deflate.c", + "deflate.h", + "deflate_fast.c", + "deflate_medium.c", + "deflate_p.h", + "deflate_quick.c", + "deflate_slow.c", + "fallback_builtins.h", + "functable.c", + "functable.h", + "infback.c", + "inffast.c", + "inffast.h", + "inffixed_tbl.h", + "inflate.c", + "inflate.h", + "inflate_p.h", + "inftrees.c", + "inftrees.h", + "insert_string.c", + "insert_string_tpl.h", + "match_tpl.h", + "trees.c", + "trees.h", + "trees_emit.h", + "trees_tbl.h", + "uncompr.c", + "zbuild.h", + "zendian.h", + "zutil.c", + "zutil.h", + "zutil_p.h", + ], + hdrs = [ + "zlib.h", + ":zconf_gen", + ], copts = [ "-std=c11", "-DZLIB_COMPAT", @@ -95,12 +79,6 @@ cc_library( # here to improve performance. Native instructions aren't enabled in # the default config for reproducibility. ], - defines = select({ - ":llvm_zlib_enabled": [ - "LLVM_ENABLE_ZLIB=1", - ], - "//conditions:default": [], - }), # Clang includes zlib with angled instead of quoted includes, so we need # strip_include_prefix here. strip_include_prefix = ".", diff --git a/utils/bazel/third_party_build/zstd.BUILD b/utils/bazel/third_party_build/zstd.BUILD index 7d022d4226de1..4f760272c26a5 100644 --- a/utils/bazel/third_party_build/zstd.BUILD +++ b/utils/bazel/third_party_build/zstd.BUILD @@ -9,46 +9,26 @@ package( licenses = ["notice"], ) -bool_flag( - name = "llvm_enable_zstd", - build_setting_default = True, -) - -config_setting( - name = "llvm_zstd_enabled", - flag_values = {":llvm_enable_zstd": "true"}, -) - cc_library( name = "zstd", - srcs = select({ - ":llvm_zstd_enabled": glob([ - "lib/common/*.c", - "lib/common/*.h", - "lib/compress/*.c", - "lib/compress/*.h", - "lib/decompress/*.c", - "lib/decompress/*.h", - "lib/decompress/*.S", - "lib/dictBuilder/*.c", - "lib/dictBuilder/*.h", - ]), - "//conditions:default": [], - }), - hdrs = select({ - ":llvm_zstd_enabled": [ - "lib/zdict.h", - "lib/zstd.h", - "lib/zstd_errors.h", - ], - "//conditions:default": [], - }), - defines = select({ - ":llvm_zstd_enabled": [ - "LLVM_ENABLE_ZSTD=1", - "ZSTD_MULTITHREAD", - ], - "//conditions:default": [], - }), + srcs = glob([ + "lib/common/*.c", + "lib/common/*.h", + "lib/compress/*.c", + "lib/compress/*.h", + "lib/decompress/*.c", + "lib/decompress/*.h", + "lib/decompress/*.S", + "lib/dictBuilder/*.c", + "lib/dictBuilder/*.h", + ]), + hdrs = [ + "lib/zdict.h", + "lib/zstd.h", + "lib/zstd_errors.h", + ], + defines = [ + "ZSTD_MULTITHREAD", + ], strip_include_prefix = "lib", )