diff --git a/MODULE.bazel b/MODULE.bazel index db81e949..8dddf3bf 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -34,14 +34,13 @@ llvm_project_overlay = use_extension( "llvm_project_overlay", ) llvm_project_overlay.configure( - commit = "ffa7c7897c14223c591249dde41f33ecb3c4c148", + commit = "7378fb30645ad5398491acea3960a8115d1b171c", patches = [ "@rules_ll//patches:mallinfo2_patch.diff", "@rules_ll//patches:rules_ll_overlay_patch.diff", - "@rules_ll//patches:llvm-project-fix-bazel-7.diff", "@rules_ll//patches:llvm-project-fix-zlib-includes.diff", ], - sha256 = "c515f808ee7984294c315e3f04a232609e08b6bc168502dc2db329b1c4aca1ec", + sha256 = "8b6a6edc4d651e280ac2e52cb693df1ab13739e2ba38076fb7cd5be1d5623b50", targets = [ "AMDGPU", "NVPTX", @@ -63,9 +62,8 @@ rules_ll_dependencies = use_extension( use_repo( rules_ll_dependencies, "clr", - "comgr", "hip", - "rocm-device-libs", + "llvm-project-rocm", "rocr", "roct", "zlib-ng", diff --git a/ll/BUILD.bazel b/ll/BUILD.bazel index c2a02f70..dc7058e1 100644 --- a/ll/BUILD.bazel +++ b/ll/BUILD.bazel @@ -92,16 +92,16 @@ ll_toolchain( address_sanitizer = select({ ":bootstrap": [], "//conditions:default": [ - "@llvm-project//compiler-rt/lib/asan:clang_rt.asan", - "@llvm-project//compiler-rt/lib/asan:clang_rt.asan_static", - "@llvm-project//compiler-rt/lib/asan:clang_rt.asan_cxx", + "@llvm-project//compiler-rt:clang_rt.asan", + "@llvm-project//compiler-rt:clang_rt.asan_static", + "@llvm-project//compiler-rt:clang_rt.asan_cxx", ], }), compiler_runtime = select({ ":bootstrap": [], "//conditions:default": [ "@llvm-project//compiler-rt:libll_compiler-rt", - "@llvm-project//compiler-rt/lib/builtins:crt", + "@llvm-project//compiler-rt:crt", ], }), cpp_abihdrs = select({ @@ -143,7 +143,7 @@ ll_toolchain( leak_sanitizer = select({ ":bootstrap": [], "//conditions:default": [ - "@llvm-project//compiler-rt/lib/lsan:clang_rt.lsan", + "@llvm-project//compiler-rt:clang_rt.lsan", ], }), libomp = select({ @@ -153,8 +153,8 @@ ll_toolchain( memory_sanitizer = select({ ":bootstrap": [], "//conditions:default": [ - "@llvm-project//compiler-rt/lib/msan:clang_rt.msan", - "@llvm-project//compiler-rt/lib/msan:clang_rt.msan_cxx", + "@llvm-project//compiler-rt:clang_rt.msan", + "@llvm-project//compiler-rt:clang_rt.msan_cxx", ], }), omp_header = select({ @@ -163,24 +163,24 @@ ll_toolchain( }), profile = select({ ":bootstrap": None, - "//conditions:default": "@llvm-project//compiler-rt/lib/profile:clang_rt.profile", + "//conditions:default": "@llvm-project//compiler-rt:clang_rt.profile", }), rocm_device_libs = select({ - ":hip_amdgpu": "@rocm-device-libs//:rocm-device-libs", + ":hip_amdgpu": "@llvm-project-rocm//:rocm-device-libs", "//conditions:default": None, }), thread_sanitizer = select({ ":bootstrap": None, "//conditions:default": [ - "@llvm-project//compiler-rt/lib/tsan:clang_rt.tsan", - "@llvm-project//compiler-rt/lib/tsan:clang_rt.tsan_cxx", + "@llvm-project//compiler-rt:clang_rt.tsan", + "@llvm-project//compiler-rt:clang_rt.tsan_cxx", ], }), undefined_behavior_sanitizer = select({ ":bootstrap": [], "//conditions:default": [ - "@llvm-project//compiler-rt/lib/ubsan:clang_rt.ubsan_standalone", - "@llvm-project//compiler-rt/lib/ubsan:clang_rt.ubsan_standalone_cxx", + "@llvm-project//compiler-rt:clang_rt.ubsan_standalone", + "@llvm-project//compiler-rt:clang_rt.ubsan_standalone_cxx", ], }), unwind_library = select({ diff --git a/ll/init.bzl b/ll/init.bzl index cc6aaeb9..ac09cd1f 100644 --- a/ll/init.bzl +++ b/ll/init.bzl @@ -84,27 +84,17 @@ def _initialize_rules_ll_impl(_): patch_args = ["-p1"], ) - http_archive( - name = "comgr", - build_file = "@rules_ll//third-party-overlays:comgr.BUILD.bazel", - strip_prefix = "ROCm-CompilerSupport-8c0f3bc3e1ad6d6f693c066a9ab96e612f86e606", - integrity = "sha256-uUqfGHJV3aV3uUNDwsjj4sG9Ds/47ksX6cs6DQgTgyQ=", - urls = [ - "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/8c0f3bc3e1ad6d6f693c066a9ab96e612f86e606.zip", - ], - patches = [ - "@rules_ll//patches:comgr_bc2h.diff", - ], - patch_args = ["-p1"], - ) + # This commit needs further treatment. It changes the default code object + # version from 4 to 5 which appears to cause segfaults. + # clr_commit = "2eab055436e4ccda8b52ad801bfaa44adfda885c" http_archive( name = "clr", build_file = "@rules_ll//third-party-overlays:clr.BUILD.bazel", - strip_prefix = "clr-6e86d29a582e28d40d6d8acd55b9f4c32e974e87", - integrity = "sha256-pL0EV8AXK5NsLJGoyNJCEaUlOSmK/uy9qXwX6JHmd18=", + strip_prefix = "clr-8c8c00f64c4fa860f75b713d338edd364229326f", + integrity = "sha256-+7BpjDZqUrjZONoqaesYF6UvOvcj+H7iWMKlH5OIwec=", urls = [ - "https://github.com/ROCm/clr/archive/6e86d29a582e28d40d6d8acd55b9f4c32e974e87.zip", + "https://github.com/ROCm/clr/archive/8c8c00f64c4fa860f75b713d338edd364229326f.zip", ], patches = [ "@rules_ll//patches:hipamd_deprecate_fix.diff", @@ -118,13 +108,17 @@ def _initialize_rules_ll_impl(_): ) http_archive( - name = "rocm-device-libs", - build_file = "@rules_ll//third-party-overlays:rocm-device-libs.BUILD.bazel", - integrity = "sha256-Q2GrctM0GQjAnWDlFeiQXVIBHWS1xtzP+k9OWtgqGMM=", - strip_prefix = "ROCm-Device-Libs-rocm-6.0.2", + name = "llvm-project-rocm", + build_file = "@rules_ll//third-party-overlays:llvm-project-rocm.BUILD.bazel", + integrity = "sha256-wPNx2by33XA4kDw2xUADzI9xpTqqGukH7qhZG9BbYUU=", + strip_prefix = "llvm-project-e80d300ecf0c235948345e81264af62adb479f02", urls = [ - "https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/refs/tags/rocm-6.0.2.zip", + "https://github.com/ROCm/llvm-project/archive/e80d300ecf0c235948345e81264af62adb479f02.zip", + ], + patches = [ + "@rules_ll//patches:comgr_bc2h.diff", ], + patch_args = ["-p1"], ) rules_ll_dependencies = module_extension( diff --git a/ll/llvm_project_deps.bzl b/ll/llvm_project_deps.bzl index 0f926f00..b3275b9d 100644 --- a/ll/llvm_project_deps.bzl +++ b/ll/llvm_project_deps.bzl @@ -6,6 +6,7 @@ Targets from the `llvm-project-overlay` used in `depends_on_llvm`. LLVM_PROJECT_DEPS = [ # Clang libraries. "@llvm-project//clang:analysis", + "@llvm-project//clang:apinotes", "@llvm-project//clang:arc_migrate", "@llvm-project//clang:ast", "@llvm-project//clang:ast-diff", @@ -78,9 +79,12 @@ LLVM_PROJECT_DEPS = [ "@llvm-project//llvm:ExecutionEngine", # "@llvm-project//llvm:Exegesis", # Not working properly. "@llvm-project//llvm:FileCheckLib", + "@llvm-project//llvm:FrontendDriver", "@llvm-project//llvm:FrontendHLSL", + "@llvm-project//llvm:FrontendOffloading", "@llvm-project//llvm:FrontendOpenACC", "@llvm-project//llvm:FrontendOpenMP", + "@llvm-project//llvm:HipStdPar", "@llvm-project//llvm:IPO", "@llvm-project//llvm:IRPrinter", "@llvm-project//llvm:IRReader", diff --git a/llvm-project-overlay/compiler-rt/BUILD.bazel b/llvm-project-overlay/compiler-rt/BUILD.bazel index 635ef6e8..6c987eb2 100644 --- a/llvm-project-overlay/compiler-rt/BUILD.bazel +++ b/llvm-project-overlay/compiler-rt/BUILD.bazel @@ -13,7 +13,1194 @@ ll_library( compilation_mode = "bootstrap", visibility = ["//visibility:public"], deps = [ - "//compiler-rt/lib/builtins", - "//compiler-rt/lib/builtins:crt", + ":builtins", + ":crt", + ], +) + +filegroup( + name = "asan_headers", + srcs = [ + "lib/asan/asan_activation.h", + "lib/asan/asan_activation_flags.inc", + "lib/asan/asan_allocator.h", + "lib/asan/asan_descriptions.h", + "lib/asan/asan_errors.h", + "lib/asan/asan_fake_stack.h", + "lib/asan/asan_flags.h", + "lib/asan/asan_flags.inc", + "lib/asan/asan_init_version.h", + "lib/asan/asan_interceptors.h", + "lib/asan/asan_interceptors_memintrinsics.h", + "lib/asan/asan_interface.inc", + "lib/asan/asan_interface_internal.h", + "lib/asan/asan_internal.h", + "lib/asan/asan_mapping.h", + "lib/asan/asan_poisoning.h", + "lib/asan/asan_premap_shadow.h", + "lib/asan/asan_report.h", + "lib/asan/asan_scariness_score.h", + "lib/asan/asan_stack.h", + "lib/asan/asan_stats.h", + "lib/asan/asan_suppressions.h", + "lib/asan/asan_thread.h", + ], +) + +filegroup( + name = "asan_sources", + srcs = [ + "lib/asan/asan_activation.cpp", + "lib/asan/asan_allocator.cpp", + "lib/asan/asan_debugging.cpp", + "lib/asan/asan_descriptions.cpp", + "lib/asan/asan_errors.cpp", + "lib/asan/asan_fake_stack.cpp", + "lib/asan/asan_flags.cpp", + "lib/asan/asan_fuchsia.cpp", + "lib/asan/asan_globals.cpp", + "lib/asan/asan_globals_win.cpp", + "lib/asan/asan_interceptors.cpp", + "lib/asan/asan_interceptors_memintrinsics.cpp", + "lib/asan/asan_interceptors_vfork.S", # Not Win32 and not Apple. + "lib/asan/asan_linux.cpp", + "lib/asan/asan_mac.cpp", + "lib/asan/asan_malloc_linux.cpp", + "lib/asan/asan_malloc_mac.cpp", + "lib/asan/asan_malloc_win.cpp", + "lib/asan/asan_memory_profile.cpp", + "lib/asan/asan_poisoning.cpp", + "lib/asan/asan_posix.cpp", + "lib/asan/asan_premap_shadow.cpp", + "lib/asan/asan_report.cpp", + "lib/asan/asan_rtl.cpp", + "lib/asan/asan_shadow_setup.cpp", + "lib/asan/asan_stack.cpp", + "lib/asan/asan_stats.cpp", + "lib/asan/asan_suppressions.cpp", + "lib/asan/asan_thread.cpp", + "lib/asan/asan_win.cpp", + ], +) + +filegroup( + name = "asan_cxx_sources", + srcs = [ + "lib/asan/asan_new_delete.cpp", + ], +) + +filegroup( + name = "asan_static_sources", + srcs = [ + "lib/asan/asan_rtl_static.cpp", + "lib/asan/asan_rtl_x86_64.S", # Not Win32 and not Apple. + ], +) + +filegroup( + name = "asan_preinit_sources", + srcs = [ + "lib/asan/asan_preinit.cpp", + ], +) + +ll_library( + name = "RTAsan_dynamic", + srcs = [ + ":asan_cxx_sources", + ":asan_sources", + ], + hdrs = [ + ":asan_headers", + ":interception_headers", + ":lsan_headers", + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ + "-fvisibility=hidden", + ], + defines = ["ASAN_DYNAMIC=1"], + emit = ["objects"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTAsan", + srcs = [ + ":asan_sources", + ], + hdrs = [ + ":asan_headers", + ":interception_headers", + ":lsan_headers", + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTAsan_cxx", + srcs = [ + ":asan_cxx_sources", + ], + hdrs = [ + ":asan_headers", + ":interception_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTAsan_static", + srcs = [ + "lib/asan/asan_rtl_static.cpp", + "lib/asan/asan_rtl_x86_64.S", # Not Win32 and not Apple. + ], + hdrs = [ + ":asan_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTAsan_preinit", + srcs = [ + ":asan_preinit_sources", + ], + hdrs = [ + ":asan_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "clang_rt.asan", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":RTAsan", + ":RTAsan_preinit", + ":RTInterception", + ":RTLSanCommon", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ], +) + +ll_library( + # We want the output library to be named libasan.so. Otherwise it will not + # be recognized by IsDynamicRTName in asan_linux.cpp. + name = "libasan", + compilation_mode = "bootstrap", + emit = ["shared_object"], + shared_object_link_flags = [ + "--eh-frame-hdr", + ], + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_dynamic", + ":RTInterception", + ":RTLSanCommon", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ":RTUbsan_cxx", + ], +) + +ll_library( + name = "clang_rt.asan_cxx", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_cxx", + ":RTUbsan_cxx", + ], +) + +ll_library( + name = "clang_rt.asan_static", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_static", + ], +) + +ll_library( + name = "clang_rt.asan-preinit", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_preinit", + ], +) + +GENERIC_SOURCES = [ + "lib/builtins/absvdi2.c", + "lib/builtins/absvsi2.c", + "lib/builtins/absvti2.c", + "lib/builtins/adddf3.c", + "lib/builtins/addsf3.c", + "lib/builtins/addvdi3.c", + "lib/builtins/addvsi3.c", + "lib/builtins/addvti3.c", + "lib/builtins/apple_versioning.c", + "lib/builtins/ashldi3.c", + "lib/builtins/ashlti3.c", + "lib/builtins/ashrdi3.c", + "lib/builtins/ashrti3.c", + "lib/builtins/bswapdi2.c", + "lib/builtins/bswapsi2.c", + "lib/builtins/clzdi2.c", + "lib/builtins/clzsi2.c", + "lib/builtins/clzti2.c", + "lib/builtins/cmpdi2.c", + "lib/builtins/cmpti2.c", + "lib/builtins/comparedf2.c", + "lib/builtins/comparesf2.c", + "lib/builtins/ctzdi2.c", + "lib/builtins/ctzsi2.c", + "lib/builtins/ctzti2.c", + "lib/builtins/divdc3.c", + "lib/builtins/divdf3.c", + "lib/builtins/divdi3.c", + "lib/builtins/divmoddi4.c", + "lib/builtins/divmodsi4.c", + "lib/builtins/divmodti4.c", + "lib/builtins/divsc3.c", + "lib/builtins/divsf3.c", + "lib/builtins/divsi3.c", + "lib/builtins/divti3.c", + "lib/builtins/extendsfdf2.c", + "lib/builtins/extendhfsf2.c", + "lib/builtins/ffsdi2.c", + "lib/builtins/ffssi2.c", + "lib/builtins/ffsti2.c", + "lib/builtins/fixdfdi.c", + "lib/builtins/fixdfsi.c", + "lib/builtins/fixdfti.c", + "lib/builtins/fixsfdi.c", + "lib/builtins/fixsfsi.c", + "lib/builtins/fixsfti.c", + "lib/builtins/fixunsdfdi.c", + "lib/builtins/fixunsdfsi.c", + "lib/builtins/fixunsdfti.c", + "lib/builtins/fixunssfdi.c", + "lib/builtins/fixunssfsi.c", + "lib/builtins/fixunssfti.c", + "lib/builtins/floatdidf.c", + "lib/builtins/floatdisf.c", + "lib/builtins/floatsidf.c", + "lib/builtins/floatsisf.c", + "lib/builtins/floattidf.c", + "lib/builtins/floattisf.c", + "lib/builtins/floatundidf.c", + "lib/builtins/floatundisf.c", + "lib/builtins/floatunsidf.c", + "lib/builtins/floatunsisf.c", + "lib/builtins/floatuntidf.c", + "lib/builtins/floatuntisf.c", + "lib/builtins/fp_mode.c", + "lib/builtins/int_util.c", + "lib/builtins/lshrdi3.c", + "lib/builtins/lshrti3.c", + "lib/builtins/moddi3.c", + "lib/builtins/modsi3.c", + "lib/builtins/modti3.c", + "lib/builtins/muldc3.c", + "lib/builtins/muldf3.c", + "lib/builtins/muldi3.c", + "lib/builtins/mulodi4.c", + "lib/builtins/mulosi4.c", + "lib/builtins/muloti4.c", + "lib/builtins/mulsc3.c", + "lib/builtins/mulsf3.c", + "lib/builtins/multi3.c", + "lib/builtins/mulvdi3.c", + "lib/builtins/mulvsi3.c", + "lib/builtins/mulvti3.c", + "lib/builtins/negdf2.c", + "lib/builtins/negdi2.c", + "lib/builtins/negsf2.c", + "lib/builtins/negti2.c", + "lib/builtins/negvdi2.c", + "lib/builtins/negvsi2.c", + "lib/builtins/negvti2.c", + "lib/builtins/os_version_check.c", + "lib/builtins/paritydi2.c", + "lib/builtins/paritysi2.c", + "lib/builtins/parityti2.c", + "lib/builtins/popcountdi2.c", + "lib/builtins/popcountsi2.c", + "lib/builtins/popcountti2.c", + "lib/builtins/powidf2.c", + "lib/builtins/powisf2.c", + "lib/builtins/subdf3.c", + "lib/builtins/subsf3.c", + "lib/builtins/subvdi3.c", + "lib/builtins/subvsi3.c", + "lib/builtins/subvti3.c", + "lib/builtins/trampoline_setup.c", + "lib/builtins/truncdfhf2.c", + "lib/builtins/truncdfsf2.c", + "lib/builtins/truncsfhf2.c", + "lib/builtins/ucmpdi2.c", + "lib/builtins/ucmpti2.c", + "lib/builtins/udivdi3.c", + "lib/builtins/udivmoddi4.c", + "lib/builtins/udivmodsi4.c", + "lib/builtins/udivmodti4.c", + "lib/builtins/udivsi3.c", + "lib/builtins/udivti3.c", + "lib/builtins/umoddi3.c", + "lib/builtins/umodsi3.c", + "lib/builtins/umodti3.c", + + # Not Fuchsia and not a bare-metal build. + "lib/builtins/emutls.c", + "lib/builtins/enable_execute_stack.c", + "lib/builtins/eprintf.c", + + # Not sure whether we want atomic in this or separately. + "lib/builtins/atomic.c", + + # Not sure whether this is for libunwind or gcc_s. gotta check. + "lib/builtins/gcc_personality_v0.c", + + # Not Fuchsia. + "lib/builtins/clear_cache.c", +] + +GENERIC_TF_SOURCES = [ + "lib/builtins/addtf3.c", + "lib/builtins/comparetf2.c", + "lib/builtins/divtc3.c", + "lib/builtins/divtf3.c", + "lib/builtins/extenddftf2.c", + "lib/builtins/extendhftf2.c", + "lib/builtins/extendsftf2.c", + "lib/builtins/fixtfdi.c", + "lib/builtins/fixtfsi.c", + "lib/builtins/fixtfti.c", + "lib/builtins/fixunstfdi.c", + "lib/builtins/fixunstfsi.c", + "lib/builtins/fixunstfti.c", + "lib/builtins/floatditf.c", + "lib/builtins/floatsitf.c", + "lib/builtins/floattitf.c", + "lib/builtins/floatunditf.c", + "lib/builtins/floatunsitf.c", + "lib/builtins/floatuntitf.c", + "lib/builtins/multc3.c", + "lib/builtins/multf3.c", + "lib/builtins/powitf2.c", + "lib/builtins/subtf3.c", + "lib/builtins/trunctfdf2.c", + "lib/builtins/trunctfhf2.c", + "lib/builtins/trunctfsf2.c", +] + +X86_ARCH_SOURCES = [ + "lib/builtins/cpu_model/x86.c", + "lib/builtins/i386/fp_mode.c", # Used on 64-bit as well. +] + +X86_80_BIT_SOURCES = [ + "lib/builtins/divxc3.c", + "lib/builtins/extendxftf2.c", + "lib/builtins/fixxfdi.c", + "lib/builtins/fixxfti.c", + "lib/builtins/fixunsxfdi.c", + "lib/builtins/fixunsxfsi.c", + "lib/builtins/fixunsxfti.c", + "lib/builtins/floatdixf.c", + "lib/builtins/floattixf.c", + "lib/builtins/floatundixf.c", + "lib/builtins/floatuntixf.c", + "lib/builtins/mulxc3.c", + "lib/builtins/powixf2.c", + "lib/builtins/trunctfxf2.c", +] + +X86_64_SOURCES = GENERIC_SOURCES + GENERIC_TF_SOURCES + X86_ARCH_SOURCES + X86_80_BIT_SOURCES + [ + "lib/builtins/x86_64/floatdidf.c", + "lib/builtins/x86_64/floatdisf.c", + "lib/builtins/x86_64/floatundidf.S", + "lib/builtins/x86_64/floatundisf.S", + "lib/builtins/x86_64/floatdixf.c", + "lib/builtins/x86_64/floatundixf.S", +] + +ll_library( + name = "builtins", + srcs = X86_64_SOURCES, + hdrs = [ + "lib/builtins/assembly.h", + "lib/builtins/cpu_model/cpu_model.h", + "lib/builtins/fp_add_impl.inc", + "lib/builtins/fp_compare_impl.inc", + "lib/builtins/fp_div_impl.inc", + "lib/builtins/fp_extend.h", + "lib/builtins/fp_extend_impl.inc", + "lib/builtins/fp_fixint_impl.inc", + "lib/builtins/fp_fixuint_impl.inc", + "lib/builtins/fp_lib.h", + "lib/builtins/fp_mode.h", + "lib/builtins/fp_mul_impl.inc", + "lib/builtins/fp_trunc.h", + "lib/builtins/fp_trunc_impl.inc", + "lib/builtins/int_div_impl.inc", + "lib/builtins/int_endianness.h", + "lib/builtins/int_lib.h", + "lib/builtins/int_math.h", + "lib/builtins/int_mulo_impl.inc", + "lib/builtins/int_mulv_impl.inc", + "lib/builtins/int_to_fp.h", + "lib/builtins/int_to_fp_impl.inc", + "lib/builtins/int_types.h", + "lib/builtins/int_util.h", + ], + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], +) + +ll_library( + name = "crtbegin", + srcs = ["lib/builtins/crtbegin.c"], + compilation_mode = "bootstrap", + defines = ["EH_USE_FRAME_REGISTRY"], + emit = ["objects"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "crtend", + srcs = ["lib/builtins/crtend.c"], + compilation_mode = "bootstrap", + emit = ["objects"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "crt", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":crtbegin", + ":crtend", + ], +) + +filegroup( + name = "interception_headers", + srcs = [ + "lib/interception/interception.h", + "lib/interception/interception_linux.h", + "lib/interception/interception_mac.h", + "lib/interception/interception_win.h", + ], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTInterception", + srcs = [ + "lib/interception/interception_linux.cpp", + "lib/interception/interception_mac.cpp", + "lib/interception/interception_type_test.cpp", + "lib/interception/interception_win.cpp", + ], + hdrs = [ + ":interception_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +filegroup( + name = "lsan_headers", + srcs = [ + "lib/lsan/lsan.h", + "lib/lsan/lsan_allocator.h", + "lib/lsan/lsan_common.h", + "lib/lsan/lsan_flags.inc", + "lib/lsan/lsan_posix.h", # Missing in CMake. + "lib/lsan/lsan_thread.h", + ], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTLSanCommon", + srcs = [ + "lib/lsan/lsan_common.cpp", + "lib/lsan/lsan_common_fuchsia.cpp", + "lib/lsan/lsan_common_linux.cpp", + "lib/lsan/lsan_common_mac.cpp", + ], + hdrs = [ + ":lsan_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "clang_rt.lsan", + srcs = [ + "lib/lsan/lsan.cpp", + "lib/lsan/lsan_allocator.cpp", + "lib/lsan/lsan_fuchsia.cpp", + "lib/lsan/lsan_interceptors.cpp", + "lib/lsan/lsan_linux.cpp", + "lib/lsan/lsan_mac.cpp", + "lib/lsan/lsan_malloc_mac.cpp", + "lib/lsan/lsan_posix.cpp", + "lib/lsan/lsan_preinit.cpp", + "lib/lsan/lsan_thread.cpp", + ], + hdrs = [ + ":interception_headers", + ":lsan_headers", + ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTInterception", + ":RTLSanCommon", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ], +) + +filegroup( + name = "msan_headers", + srcs = [ + "lib/msan/msan.h", + "lib/msan/msan_allocator.h", + "lib/msan/msan_chained_origin_depot.h", + "lib/msan/msan_dl.h", + "lib/msan/msan_flags.h", + "lib/msan/msan_flags.inc", + "lib/msan/msan_interface_internal.h", + "lib/msan/msan_origin.h", + "lib/msan/msan_poisoning.h", + "lib/msan/msan_report.h", + "lib/msan/msan_thread.h", + ], + visibility = ["//visibility:public"], +) + +ll_library( + name = "clang_rt.msan", + srcs = [ + "lib/msan/msan.cpp", + "lib/msan/msan_allocator.cpp", + "lib/msan/msan_chained_origin_depot.cpp", + "lib/msan/msan_dl.cpp", + "lib/msan/msan_interceptors.cpp", + "lib/msan/msan_linux.cpp", + "lib/msan/msan_poisoning.cpp", + "lib/msan/msan_report.cpp", + "lib/msan/msan_thread.cpp", + ], + hdrs = [ + ":interception_headers", + ":msan_headers", + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ + "-ffreestanding", + ], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTInterception", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ], +) + +ll_library( + name = "clang_rt.msan_cxx", + srcs = [ + "lib/msan/msan_new_delete.cpp", + ], + hdrs = [ + ":interception_headers", + ":msan_headers", + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ + "-ffreestanding", + ], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTUbsan_cxx", + ], +) + +ll_library( + name = "clang_rt.profile", + srcs = [ + "lib/profile/GCDAProfiling.c", + "lib/profile/InstrProfiling.c", + "lib/profile/InstrProfilingBuffer.c", + "lib/profile/InstrProfilingFile.c", + "lib/profile/InstrProfilingInternal.c", + "lib/profile/InstrProfilingMerge.c", + "lib/profile/InstrProfilingMergeFile.c", + "lib/profile/InstrProfilingNameVar.c", + "lib/profile/InstrProfilingPlatformDarwin.c", + "lib/profile/InstrProfilingPlatformFuchsia.c", + "lib/profile/InstrProfilingPlatformLinux.c", + "lib/profile/InstrProfilingPlatformOther.c", + "lib/profile/InstrProfilingPlatformWindows.c", + "lib/profile/InstrProfilingRuntime.cpp", + "lib/profile/InstrProfilingUtil.c", + "lib/profile/InstrProfilingValue.c", + "lib/profile/InstrProfilingVersionVar.c", + "lib/profile/InstrProfilingWriter.c", + ], + hdrs = [ + "lib/profile/InstrProfiling.h", + "lib/profile/InstrProfilingInternal.h", + "lib/profile/InstrProfilingPort.h", + "lib/profile/InstrProfilingUtil.h", + "lib/profile/WindowsMMap.h", + ], + compilation_mode = "bootstrap", + defines = [ + "COMPILER_RT_HAS_UNAME=1", + "COMPILER_RT_HAS_FCNTL_LCK=1", + "COMPILER_RT_HAS_ATOMICS=1", + ], + includes = [ + "compiler-rt/include", + "compiler-rt/lib", + ], + visibility = ["//visibility:public"], + deps = [":compiler_rt_hdrs"], +) + +filegroup( + name = "sanitizer_impl_headers", + srcs = [ + "lib/sanitizer_common/sancov_flags.h", + "lib/sanitizer_common/sancov_flags.inc", + "lib/sanitizer_common/sanitizer_addrhashmap.h", + "lib/sanitizer_common/sanitizer_allocator.h", + "lib/sanitizer_common/sanitizer_allocator_checks.h", + "lib/sanitizer_common/sanitizer_allocator_combined.h", + "lib/sanitizer_common/sanitizer_allocator_dlsym.h", + "lib/sanitizer_common/sanitizer_allocator_interface.h", + "lib/sanitizer_common/sanitizer_allocator_internal.h", + "lib/sanitizer_common/sanitizer_allocator_local_cache.h", + "lib/sanitizer_common/sanitizer_allocator_primary32.h", + "lib/sanitizer_common/sanitizer_allocator_primary64.h", + "lib/sanitizer_common/sanitizer_allocator_report.h", + "lib/sanitizer_common/sanitizer_allocator_secondary.h", + "lib/sanitizer_common/sanitizer_allocator_size_class_map.h", + "lib/sanitizer_common/sanitizer_allocator_stats.h", + "lib/sanitizer_common/sanitizer_array_ref.h", + "lib/sanitizer_common/sanitizer_asm.h", + "lib/sanitizer_common/sanitizer_atomic.h", + "lib/sanitizer_common/sanitizer_atomic_clang.h", + "lib/sanitizer_common/sanitizer_atomic_clang_mips.h", + "lib/sanitizer_common/sanitizer_atomic_clang_other.h", + "lib/sanitizer_common/sanitizer_atomic_clang_x86.h", + "lib/sanitizer_common/sanitizer_atomic_msvc.h", + "lib/sanitizer_common/sanitizer_bitvector.h", + "lib/sanitizer_common/sanitizer_bvgraph.h", + "lib/sanitizer_common/sanitizer_chained_origin_depot.h", + "lib/sanitizer_common/sanitizer_common.h", + "lib/sanitizer_common/sanitizer_common_interceptors.inc", + "lib/sanitizer_common/sanitizer_common_interceptors_format.inc", + "lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc", + "lib/sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc", + "lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc", # Missing in CMake. + + # Always linux. Missing in CMake. + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_aarch64.inc.S", + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_arm.inc.S", + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S", + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S", + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_riscv64.inc.S", + "lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S", + "lib/sanitizer_common/sanitizer_common_interface.inc", + "lib/sanitizer_common/sanitizer_common_interface_posix.inc", + "lib/sanitizer_common/sanitizer_common_syscalls.inc", + "lib/sanitizer_common/sanitizer_coverage_interface.inc", + "lib/sanitizer_common/sanitizer_dbghelp.h", + "lib/sanitizer_common/sanitizer_deadlock_detector.h", + "lib/sanitizer_common/sanitizer_deadlock_detector_interface.h", + "lib/sanitizer_common/sanitizer_dense_map.h", + "lib/sanitizer_common/sanitizer_dense_map_info.h", + "lib/sanitizer_common/sanitizer_dl.h", + "lib/sanitizer_common/sanitizer_errno.h", + "lib/sanitizer_common/sanitizer_errno_codes.h", + "lib/sanitizer_common/sanitizer_file.h", + "lib/sanitizer_common/sanitizer_flag_parser.h", + "lib/sanitizer_common/sanitizer_flags.h", + "lib/sanitizer_common/sanitizer_flags.inc", + "lib/sanitizer_common/sanitizer_flat_map.h", + "lib/sanitizer_common/sanitizer_fuchsia.h", + "lib/sanitizer_common/sanitizer_getauxval.h", + "lib/sanitizer_common/sanitizer_glibc_version.h", # Missing in CMake. + "lib/sanitizer_common/sanitizer_hash.h", + "lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc", + "lib/sanitizer_common/sanitizer_interface_internal.h", + "lib/sanitizer_common/sanitizer_internal_defs.h", + "lib/sanitizer_common/sanitizer_leb128.h", + "lib/sanitizer_common/sanitizer_lfstack.h", + "lib/sanitizer_common/sanitizer_libc.h", + "lib/sanitizer_common/sanitizer_libignore.h", + "lib/sanitizer_common/sanitizer_linux.h", + "lib/sanitizer_common/sanitizer_list.h", + "lib/sanitizer_common/sanitizer_local_address_space_view.h", + "lib/sanitizer_common/sanitizer_lzw.h", + "lib/sanitizer_common/sanitizer_mac.h", + "lib/sanitizer_common/sanitizer_mallinfo.h", + "lib/sanitizer_common/sanitizer_malloc_mac.inc", + "lib/sanitizer_common/sanitizer_mutex.h", + "lib/sanitizer_common/sanitizer_placement_new.h", + "lib/sanitizer_common/sanitizer_platform.h", + "lib/sanitizer_common/sanitizer_platform_interceptors.h", + "lib/sanitizer_common/sanitizer_platform_limits_freebsd.h", # Missing in CMake. + "lib/sanitizer_common/sanitizer_platform_limits_netbsd.h", + "lib/sanitizer_common/sanitizer_platform_limits_posix.h", + "lib/sanitizer_common/sanitizer_platform_limits_solaris.h", + "lib/sanitizer_common/sanitizer_posix.h", + "lib/sanitizer_common/sanitizer_procmaps.h", + "lib/sanitizer_common/sanitizer_ptrauth.h", + "lib/sanitizer_common/sanitizer_quarantine.h", + "lib/sanitizer_common/sanitizer_range.h", + "lib/sanitizer_common/sanitizer_redefine_builtins.h", + "lib/sanitizer_common/sanitizer_report_decorator.h", + "lib/sanitizer_common/sanitizer_ring_buffer.h", + "lib/sanitizer_common/sanitizer_signal_interceptors.inc", + "lib/sanitizer_common/sanitizer_solaris.h", + "lib/sanitizer_common/sanitizer_stack_store.h", + "lib/sanitizer_common/sanitizer_stackdepot.h", + "lib/sanitizer_common/sanitizer_stackdepotbase.h", + "lib/sanitizer_common/sanitizer_stacktrace.h", + "lib/sanitizer_common/sanitizer_stacktrace_printer.h", + "lib/sanitizer_common/sanitizer_stoptheworld.h", + "lib/sanitizer_common/sanitizer_suppressions.h", + "lib/sanitizer_common/sanitizer_symbolizer.h", + "lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h", + "lib/sanitizer_common/sanitizer_symbolizer_internal.h", + "lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h", + "lib/sanitizer_common/sanitizer_symbolizer_mac.h", + "lib/sanitizer_common/sanitizer_symbolizer_markup.h", + "lib/sanitizer_common/sanitizer_syscall_generic.inc", + "lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc", + "lib/sanitizer_common/sanitizer_syscall_linux_arm.inc", + "lib/sanitizer_common/sanitizer_syscall_linux_riscv64.inc", + "lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc", + "lib/sanitizer_common/sanitizer_syscalls_netbsd.inc", + "lib/sanitizer_common/sanitizer_thread_arg_retval.h", + "lib/sanitizer_common/sanitizer_thread_registry.h", + "lib/sanitizer_common/sanitizer_thread_safety.h", + "lib/sanitizer_common/sanitizer_tls_get_addr.h", + "lib/sanitizer_common/sanitizer_type_traits.h", # Missing in CMake. + "lib/sanitizer_common/sanitizer_vector.h", + "lib/sanitizer_common/sanitizer_win.h", + "lib/sanitizer_common/sanitizer_win_defs.h", + "lib/sanitizer_common/sanitizer_win_dll_thunk.h", + "lib/sanitizer_common/sanitizer_win_weak_interception.h", + ], + visibility = ["//visibility:public"], +) + +# TODO: Architecture-specific names as in CMake. +ll_library( + name = "RTSanitizerCommon", + srcs = [ + "lib/sanitizer_common/sanitizer_allocator.cpp", + "lib/sanitizer_common/sanitizer_common.cpp", + "lib/sanitizer_common/sanitizer_deadlock_detector1.cpp", + "lib/sanitizer_common/sanitizer_deadlock_detector2.cpp", + "lib/sanitizer_common/sanitizer_errno.cpp", + "lib/sanitizer_common/sanitizer_file.cpp", + "lib/sanitizer_common/sanitizer_flags.cpp", + "lib/sanitizer_common/sanitizer_flag_parser.cpp", + "lib/sanitizer_common/sanitizer_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_libc.cpp", + "lib/sanitizer_common/sanitizer_libignore.cpp", + "lib/sanitizer_common/sanitizer_linux.cpp", + "lib/sanitizer_common/sanitizer_linux_s390.cpp", + "lib/sanitizer_common/sanitizer_mac.cpp", + "lib/sanitizer_common/sanitizer_mutex.cpp", + "lib/sanitizer_common/sanitizer_netbsd.cpp", + "lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp", + "lib/sanitizer_common/sanitizer_platform_limits_linux.cpp", + "lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp", + "lib/sanitizer_common/sanitizer_platform_limits_posix.cpp", + "lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp", + "lib/sanitizer_common/sanitizer_posix.cpp", + "lib/sanitizer_common/sanitizer_printf.cpp", + "lib/sanitizer_common/sanitizer_procmaps_common.cpp", + "lib/sanitizer_common/sanitizer_procmaps_bsd.cpp", + "lib/sanitizer_common/sanitizer_procmaps_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_procmaps_linux.cpp", + "lib/sanitizer_common/sanitizer_procmaps_mac.cpp", + "lib/sanitizer_common/sanitizer_procmaps_solaris.cpp", + "lib/sanitizer_common/sanitizer_range.cpp", + "lib/sanitizer_common/sanitizer_solaris.cpp", + "lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_stoptheworld_mac.cpp", + "lib/sanitizer_common/sanitizer_stoptheworld_win.cpp", + "lib/sanitizer_common/sanitizer_suppressions.cpp", + "lib/sanitizer_common/sanitizer_tls_get_addr.cpp", + "lib/sanitizer_common/sanitizer_thread_arg_retval.cpp", + "lib/sanitizer_common/sanitizer_thread_registry.cpp", + "lib/sanitizer_common/sanitizer_type_traits.cpp", + "lib/sanitizer_common/sanitizer_win.cpp", + + # Always termination. + "lib/sanitizer_common/sanitizer_termination.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTSanitizerCommonNoLibc", + srcs = [ + "lib/sanitizer_common/sanitizer_common_nolibc.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTSanitizerCommonLibc", + srcs = [ + "lib/sanitizer_common/sanitizer_allocator_checks.cpp", + "lib/sanitizer_common/sanitizer_common_libcdep.cpp", + "lib/sanitizer_common/sanitizer_dl.cpp", + "lib/sanitizer_common/sanitizer_linux_libcdep.cpp", + "lib/sanitizer_common/sanitizer_mac_libcdep.cpp", + "lib/sanitizer_common/sanitizer_posix_libcdep.cpp", + "lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp", + "lib/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTSanitizerCommonCoverage", + srcs = [ + "lib/sanitizer_common/sancov_flags.cpp", + "lib/sanitizer_common/sanitizer_coverage_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp", + "lib/sanitizer_common/sanitizer_coverage_win_sections.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTSanitizerCommonSymbolizer", + srcs = [ + "lib/sanitizer_common/sanitizer_allocator_report.cpp", + "lib/sanitizer_common/sanitizer_chained_origin_depot.cpp", + "lib/sanitizer_common/sanitizer_stack_store.cpp", + "lib/sanitizer_common/sanitizer_stackdepot.cpp", + "lib/sanitizer_common/sanitizer_stacktrace.cpp", + "lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp", + "lib/sanitizer_common/sanitizer_stacktrace_printer.cpp", + "lib/sanitizer_common/sanitizer_stacktrace_sparc.cpp", + "lib/sanitizer_common/sanitizer_symbolizer.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_mac.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_markup.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_markup_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_report.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_report_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_symbolizer_win.cpp", + "lib/sanitizer_common/sanitizer_unwind_fuchsia.cpp", + "lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp", + "lib/sanitizer_common/sanitizer_unwind_win.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +filegroup( + name = "tsan_headers", + srcs = [ + "lib/tsan/rtl/tsan_defs.h", + "lib/tsan/rtl/tsan_dense_alloc.h", + "lib/tsan/rtl/tsan_fd.h", + "lib/tsan/rtl/tsan_flags.h", + "lib/tsan/rtl/tsan_flags.inc", + "lib/tsan/rtl/tsan_ignoreset.h", + "lib/tsan/rtl/tsan_ilist.h", + "lib/tsan/rtl/tsan_interceptors.h", + "lib/tsan/rtl/tsan_interface.h", + "lib/tsan/rtl/tsan_interface.inc", + "lib/tsan/rtl/tsan_interface_ann.h", + "lib/tsan/rtl/tsan_interface_java.h", + "lib/tsan/rtl/tsan_mman.h", + "lib/tsan/rtl/tsan_mutexset.h", + "lib/tsan/rtl/tsan_platform.h", + "lib/tsan/rtl/tsan_ppc_regs.h", + "lib/tsan/rtl/tsan_report.h", + "lib/tsan/rtl/tsan_rtl.h", + "lib/tsan/rtl/tsan_shadow.h", + "lib/tsan/rtl/tsan_stack_trace.h", + "lib/tsan/rtl/tsan_suppressions.h", + "lib/tsan/rtl/tsan_symbolize.h", + "lib/tsan/rtl/tsan_sync.h", + "lib/tsan/rtl/tsan_trace.h", + "lib/tsan/rtl/tsan_vector_clock.h", + ], +) + +ll_library( + name = "clang_rt.tsan", + srcs = [ + # TSAN_SOURCES. + "lib/tsan/rtl/tsan_debugging.cpp", + "lib/tsan/rtl/tsan_external.cpp", + "lib/tsan/rtl/tsan_fd.cpp", + "lib/tsan/rtl/tsan_flags.cpp", + "lib/tsan/rtl/tsan_ignoreset.cpp", + "lib/tsan/rtl/tsan_interceptors_memintrinsics.cpp", + "lib/tsan/rtl/tsan_interceptors_posix.cpp", + "lib/tsan/rtl/tsan_interface.cpp", + "lib/tsan/rtl/tsan_interface_ann.cpp", + "lib/tsan/rtl/tsan_interface_atomic.cpp", + "lib/tsan/rtl/tsan_interface_java.cpp", + "lib/tsan/rtl/tsan_malloc_mac.cpp", + "lib/tsan/rtl/tsan_md5.cpp", + "lib/tsan/rtl/tsan_mman.cpp", + "lib/tsan/rtl/tsan_mutexset.cpp", + "lib/tsan/rtl/tsan_report.cpp", + "lib/tsan/rtl/tsan_rtl.cpp", + "lib/tsan/rtl/tsan_rtl_access.cpp", + "lib/tsan/rtl/tsan_rtl_mutex.cpp", + "lib/tsan/rtl/tsan_rtl_proc.cpp", + "lib/tsan/rtl/tsan_rtl_report.cpp", + "lib/tsan/rtl/tsan_rtl_thread.cpp", + "lib/tsan/rtl/tsan_stack_trace.cpp", + "lib/tsan/rtl/tsan_suppressions.cpp", + "lib/tsan/rtl/tsan_symbolize.cpp", + "lib/tsan/rtl/tsan_sync.cpp", + "lib/tsan/rtl/tsan_vector_clock.cpp", + + # TSAN_ASM_SOURCES. + "lib/tsan/rtl/tsan_rtl_amd64.S", + + # TSAN_PREINIT_SOURCES. + "lib/tsan/rtl/tsan_preinit.cpp", + + # Linux sources. + "lib/tsan/rtl/tsan_platform_linux.cpp", + "lib/tsan/rtl/tsan_platform_posix.cpp", + ], + hdrs = [ + ":interception_headers", + ":sanitizer_impl_headers", + ":tsan_headers", + ":ubsan_headers", + ], + angled_includes = ["compiler-rt/lib"], + compilation_mode = "bootstrap", + compile_flags = ["-msse4.2"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTInterception", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ], +) + +ll_library( + name = "clang_rt.tsan_cxx", + srcs = [ + "lib/tsan/rtl/tsan_new_delete.cpp", + ], + hdrs = [ + ":interception_headers", + ":sanitizer_impl_headers", + ":tsan_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = ["-msse4.2"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTUbsan_cxx", + ], +) + +filegroup( + name = "ubsan_headers", + srcs = [ + "lib/ubsan/ubsan_checks.inc", + "lib/ubsan/ubsan_diag.h", + "lib/ubsan/ubsan_flags.h", + "lib/ubsan/ubsan_flags.inc", + "lib/ubsan/ubsan_handlers.h", + "lib/ubsan/ubsan_handlers_cxx.h", + "lib/ubsan/ubsan_init.h", + "lib/ubsan/ubsan_interface.inc", + "lib/ubsan/ubsan_monitor.h", + "lib/ubsan/ubsan_platform.h", + "lib/ubsan/ubsan_signals_standalone.h", + "lib/ubsan/ubsan_type_hash.h", + "lib/ubsan/ubsan_value.h", + ], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTUbsan", + srcs = [ + "lib/ubsan/ubsan_diag.cpp", + "lib/ubsan/ubsan_flags.cpp", + "lib/ubsan/ubsan_handlers.cpp", + "lib/ubsan/ubsan_init.cpp", + "lib/ubsan/ubsan_monitor.cpp", + "lib/ubsan/ubsan_value.cpp", + ], + hdrs = [ + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + defines = [ + "UBSAN_CAN_USE_CXXABI", + ], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTUbsan_cxx", + srcs = [ + "lib/ubsan/ubsan_handlers_cxx.cpp", + "lib/ubsan/ubsan_type_hash.cpp", + "lib/ubsan/ubsan_type_hash_itanium.cpp", + "lib/ubsan/ubsan_type_hash_win.cpp", + ], + hdrs = [ + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "RTUbsan_standalone", + srcs = [ + "lib/ubsan/ubsan_diag_standalone.cpp", + "lib/ubsan/ubsan_init_standalone.cpp", + "lib/ubsan/ubsan_signals_standalone.cpp", + ], + hdrs = [ + ":interception_headers", + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) + +ll_library( + name = "clang_rt.ubsan_standalone", + srcs = [ + "lib/ubsan/ubsan_init_standalone_preinit.cpp", + ], + hdrs = [ + ":sanitizer_impl_headers", + ":ubsan_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ + ":RTInterception", + ":RTSanitizerCommon", + ":RTSanitizerCommonCoverage", + ":RTSanitizerCommonLibc", + ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ":RTUbsan_standalone", + ], +) + +ll_library( + name = "clang_rt.ubsan_standalone_cxx", + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ + ":RTUbsan_cxx", ], ) diff --git a/llvm-project-overlay/compiler-rt/lib/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/BUILD.bazel deleted file mode 100644 index 1bb8bf6d..00000000 --- a/llvm-project-overlay/compiler-rt/lib/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ -# empty diff --git a/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel deleted file mode 100644 index 79b43710..00000000 --- a/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel +++ /dev/null @@ -1,245 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "asan_headers", - srcs = [ - "asan_activation.h", - "asan_activation_flags.inc", - "asan_allocator.h", - "asan_descriptions.h", - "asan_errors.h", - "asan_fake_stack.h", - "asan_flags.h", - "asan_flags.inc", - "asan_init_version.h", - "asan_interceptors.h", - "asan_interceptors_memintrinsics.h", - "asan_interface.inc", - "asan_interface_internal.h", - "asan_internal.h", - "asan_lock.h", - "asan_mapping.h", - "asan_poisoning.h", - "asan_premap_shadow.h", - "asan_report.h", - "asan_scariness_score.h", - "asan_stack.h", - "asan_stats.h", - "asan_suppressions.h", - "asan_thread.h", - ], -) - -filegroup( - name = "asan_sources", - srcs = [ - "asan_activation.cpp", - "asan_allocator.cpp", - "asan_debugging.cpp", - "asan_descriptions.cpp", - "asan_errors.cpp", - "asan_fake_stack.cpp", - "asan_flags.cpp", - "asan_fuchsia.cpp", - "asan_globals.cpp", - "asan_globals_win.cpp", - "asan_interceptors.cpp", - "asan_interceptors_memintrinsics.cpp", - "asan_interceptors_vfork.S", # Not Win32 and not Apple. - "asan_linux.cpp", - "asan_mac.cpp", - "asan_malloc_linux.cpp", - "asan_malloc_mac.cpp", - "asan_malloc_win.cpp", - "asan_memory_profile.cpp", - "asan_poisoning.cpp", - "asan_posix.cpp", - "asan_premap_shadow.cpp", - "asan_report.cpp", - "asan_rtl.cpp", - "asan_shadow_setup.cpp", - "asan_stack.cpp", - "asan_stats.cpp", - "asan_suppressions.cpp", - "asan_thread.cpp", - "asan_win.cpp", - ], -) - -filegroup( - name = "asan_cxx_sources", - srcs = [ - "asan_new_delete.cpp", - ], -) - -filegroup( - name = "asan_static_sources", - srcs = [ - "asan_rtl_static.cpp", - "asan_rtl_x86_64.S", # Not Win32 and not Apple. - ], -) - -filegroup( - name = "asan_preinit_sources", - srcs = [ - "asan_preinit.cpp", - ], -) - -ll_library( - name = "RTAsan_dynamic", - srcs = [ - ":asan_cxx_sources", - ":asan_sources", - ], - hdrs = [ - ":asan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/lsan:lsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - compilation_mode = "bootstrap", - compile_flags = [ - "-fvisibility=hidden", - ], - defines = ["ASAN_DYNAMIC=1"], - emit = ["objects"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTAsan", - srcs = [ - ":asan_sources", - ], - hdrs = [ - ":asan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/lsan:lsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - compilation_mode = "bootstrap", - emit = ["objects"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTAsan_cxx", - srcs = [ - ":asan_cxx_sources", - ], - hdrs = [ - ":asan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - emit = ["objects"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTAsan_static", - srcs = [ - "asan_rtl_static.cpp", - "asan_rtl_x86_64.S", # Not Win32 and not Apple. - ], - hdrs = [ - ":asan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - emit = ["objects"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTAsan_preinit", - srcs = [ - ":asan_preinit_sources", - ], - hdrs = [ - ":asan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - emit = ["objects"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "clang_rt.asan", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":RTAsan", - ":RTAsan_preinit", - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/lsan:RTLSanCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - "//compiler-rt/lib/ubsan:RTUbsan", - ], -) - -ll_library( - # We want the output library to be named libasan.so. Otherwise it will not - # be recognized by IsDynamicRTName in asan_linux.cpp. - name = "libasan", - compilation_mode = "bootstrap", - emit = ["shared_object"], - shared_object_link_flags = [ - "--eh-frame-hdr", - ], - visibility = ["//visibility:public"], - deps = [ - ":RTAsan_dynamic", - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/lsan:RTLSanCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - "//compiler-rt/lib/ubsan:RTUbsan", - "//compiler-rt/lib/ubsan:RTUbsan_cxx", - ], -) - -ll_library( - name = "clang_rt.asan_cxx", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":RTAsan_cxx", - "//compiler-rt/lib/ubsan:RTUbsan_cxx", - ], -) - -ll_library( - name = "clang_rt.asan_static", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":RTAsan_static", - ], -) - -ll_library( - name = "clang_rt.asan-preinit", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":RTAsan_preinit", - ], -) diff --git a/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel deleted file mode 100644 index 5e874e8f..00000000 --- a/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel +++ /dev/null @@ -1,252 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -GENERIC_SOURCES = [ - "absvdi2.c", - "absvsi2.c", - "absvti2.c", - "adddf3.c", - "addsf3.c", - "addvdi3.c", - "addvsi3.c", - "addvti3.c", - "apple_versioning.c", - "ashldi3.c", - "ashlti3.c", - "ashrdi3.c", - "ashrti3.c", - "bswapdi2.c", - "bswapsi2.c", - "clzdi2.c", - "clzsi2.c", - "clzti2.c", - "cmpdi2.c", - "cmpti2.c", - "comparedf2.c", - "comparesf2.c", - "ctzdi2.c", - "ctzsi2.c", - "ctzti2.c", - "divdc3.c", - "divdf3.c", - "divdi3.c", - "divmoddi4.c", - "divmodsi4.c", - "divmodti4.c", - "divsc3.c", - "divsf3.c", - "divsi3.c", - "divti3.c", - "extendsfdf2.c", - "extendhfsf2.c", - "ffsdi2.c", - "ffssi2.c", - "ffsti2.c", - "fixdfdi.c", - "fixdfsi.c", - "fixdfti.c", - "fixsfdi.c", - "fixsfsi.c", - "fixsfti.c", - "fixunsdfdi.c", - "fixunsdfsi.c", - "fixunsdfti.c", - "fixunssfdi.c", - "fixunssfsi.c", - "fixunssfti.c", - "floatdidf.c", - "floatdisf.c", - "floatsidf.c", - "floatsisf.c", - "floattidf.c", - "floattisf.c", - "floatundidf.c", - "floatundisf.c", - "floatunsidf.c", - "floatunsisf.c", - "floatuntidf.c", - "floatuntisf.c", - "fp_mode.c", - "int_util.c", - "lshrdi3.c", - "lshrti3.c", - "moddi3.c", - "modsi3.c", - "modti3.c", - "muldc3.c", - "muldf3.c", - "muldi3.c", - "mulodi4.c", - "mulosi4.c", - "muloti4.c", - "mulsc3.c", - "mulsf3.c", - "multi3.c", - "mulvdi3.c", - "mulvsi3.c", - "mulvti3.c", - "negdf2.c", - "negdi2.c", - "negsf2.c", - "negti2.c", - "negvdi2.c", - "negvsi2.c", - "negvti2.c", - "os_version_check.c", - "paritydi2.c", - "paritysi2.c", - "parityti2.c", - "popcountdi2.c", - "popcountsi2.c", - "popcountti2.c", - "powidf2.c", - "powisf2.c", - "subdf3.c", - "subsf3.c", - "subvdi3.c", - "subvsi3.c", - "subvti3.c", - "trampoline_setup.c", - "truncdfhf2.c", - "truncdfsf2.c", - "truncsfhf2.c", - "ucmpdi2.c", - "ucmpti2.c", - "udivdi3.c", - "udivmoddi4.c", - "udivmodsi4.c", - "udivmodti4.c", - "udivsi3.c", - "udivti3.c", - "umoddi3.c", - "umodsi3.c", - "umodti3.c", - - # Not Fuchsia and not a bare-metal build. - "emutls.c", - "enable_execute_stack.c", - "eprintf.c", - - # Not sure whether we want atomic in this or separately. - "atomic.c", - - # Not sure whether this is for libunwind or gcc_s. gotta check. - "gcc_personality_v0.c", - - # Not Fuchsia. - "clear_cache.c", -] - -GENERIC_TF_SOURCES = [ - "addtf3.c", - "comparetf2.c", - "divtc3.c", - "divtf3.c", - "extenddftf2.c", - "extendhftf2.c", - "extendsftf2.c", - "fixtfdi.c", - "fixtfsi.c", - "fixtfti.c", - "fixunstfdi.c", - "fixunstfsi.c", - "fixunstfti.c", - "floatditf.c", - "floatsitf.c", - "floattitf.c", - "floatunditf.c", - "floatunsitf.c", - "floatuntitf.c", - "multc3.c", - "multf3.c", - "powitf2.c", - "subtf3.c", - "trunctfdf2.c", - "trunctfhf2.c", - "trunctfsf2.c", -] - -X86_ARCH_SOURCES = [ - "cpu_model.c", - "i386/fp_mode.c", # Used on 64-bit as well. -] - -X86_80_BIT_SOURCES = [ - "divxc3.c", - "fixxfdi.c", - "fixxfti.c", - "fixunsxfdi.c", - "fixunsxfsi.c", - "fixunsxfti.c", - "floatdixf.c", - "floattixf.c", - "floatundixf.c", - "floatuntixf.c", - "mulxc3.c", - "powixf2.c", -] - -X86_64_SOURCES = GENERIC_SOURCES + GENERIC_TF_SOURCES + X86_ARCH_SOURCES + X86_80_BIT_SOURCES + [ - "x86_64/floatdidf.c", - "x86_64/floatdisf.c", - "x86_64/floatundidf.S", - "x86_64/floatundisf.S", - "x86_64/floatdixf.c", - "x86_64/floatundixf.S", -] - -ll_library( - name = "builtins", - srcs = X86_64_SOURCES, - hdrs = [ - "assembly.h", - "fp_add_impl.inc", - "fp_compare_impl.inc", - "fp_div_impl.inc", - "fp_extend.h", - "fp_extend_impl.inc", - "fp_fixint_impl.inc", - "fp_fixuint_impl.inc", - "fp_lib.h", - "fp_mode.h", - "fp_mul_impl.inc", - "fp_trunc.h", - "fp_trunc_impl.inc", - "int_div_impl.inc", - "int_endianness.h", - "int_lib.h", - "int_math.h", - "int_mulo_impl.inc", - "int_mulv_impl.inc", - "int_types.h", - "int_util.h", - ], - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], -) - -ll_library( - name = "crtbegin", - srcs = ["crtbegin.c"], - compilation_mode = "bootstrap", - defines = ["EH_USE_FRAME_REGISTRY"], - emit = ["objects"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "crtend", - srcs = ["crtend.c"], - compilation_mode = "bootstrap", - emit = ["objects"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "crt", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":crtbegin", - ":crtend", - ], -) diff --git a/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel deleted file mode 100644 index 4b8956e4..00000000 --- a/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel +++ /dev/null @@ -1,29 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "interception_headers", - srcs = [ - "interception.h", - "interception_linux.h", - "interception_mac.h", - "interception_win.h", - ], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTInterception", - srcs = [ - "interception_linux.cpp", - "interception_mac.cpp", - "interception_type_test.cpp", - "interception_win.cpp", - ], - hdrs = [ - ":interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) diff --git a/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel deleted file mode 100644 index 2a3ebd4f..00000000 --- a/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel +++ /dev/null @@ -1,63 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "lsan_headers", - srcs = [ - "lsan.h", - "lsan_allocator.h", - "lsan_common.h", - "lsan_flags.inc", - "lsan_posix.h", # Missing in CMake. - "lsan_thread.h", - ], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTLSanCommon", - srcs = [ - "lsan_common.cpp", - "lsan_common_fuchsia.cpp", - "lsan_common_linux.cpp", - "lsan_common_mac.cpp", - ], - hdrs = [ - ":lsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "clang_rt.lsan", - srcs = [ - "lsan.cpp", - "lsan_allocator.cpp", - "lsan_fuchsia.cpp", - "lsan_interceptors.cpp", - "lsan_linux.cpp", - "lsan_mac.cpp", - "lsan_malloc_mac.cpp", - "lsan_posix.cpp", - "lsan_preinit.cpp", - "lsan_thread.cpp", - ], - hdrs = [ - ":lsan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - ":RTLSanCommon", - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - ], -) diff --git a/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel deleted file mode 100644 index 55b96afc..00000000 --- a/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel +++ /dev/null @@ -1,76 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "msan_headers", - srcs = [ - "msan.h", - "msan_allocator.h", - "msan_chained_origin_depot.h", - "msan_dl.h", - "msan_flags.h", - "msan_flags.inc", - "msan_interface_internal.h", - "msan_origin.h", - "msan_poisoning.h", - "msan_report.h", - "msan_thread.h", - ], - visibility = ["//visibility:public"], -) - -ll_library( - name = "clang_rt.msan", - srcs = [ - "msan.cpp", - "msan_allocator.cpp", - "msan_chained_origin_depot.cpp", - "msan_dl.cpp", - "msan_interceptors.cpp", - "msan_linux.cpp", - "msan_poisoning.cpp", - "msan_report.cpp", - "msan_thread.cpp", - ], - hdrs = [ - ":msan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - compilation_mode = "bootstrap", - compile_flags = [ - "-ffreestanding", - ], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - "//compiler-rt/lib/ubsan:RTUbsan", - ], -) - -ll_library( - name = "clang_rt.msan_cxx", - srcs = [ - "msan_new_delete.cpp", - ], - hdrs = [ - ":msan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - compilation_mode = "bootstrap", - compile_flags = [ - "-ffreestanding", - ], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - "//compiler-rt/lib/ubsan:RTUbsan_cxx", - ], -) diff --git a/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel deleted file mode 100644 index 8731b402..00000000 --- a/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel +++ /dev/null @@ -1,44 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -ll_library( - name = "clang_rt.profile", - srcs = [ - "GCDAProfiling.c", - "InstrProfiling.c", - "InstrProfilingBuffer.c", - "InstrProfilingFile.c", - "InstrProfilingInternal.c", - "InstrProfilingMerge.c", - "InstrProfilingMergeFile.c", - "InstrProfilingNameVar.c", - "InstrProfilingPlatformDarwin.c", - "InstrProfilingPlatformFuchsia.c", - "InstrProfilingPlatformLinux.c", - "InstrProfilingPlatformOther.c", - "InstrProfilingPlatformWindows.c", - "InstrProfilingRuntime.cpp", - "InstrProfilingUtil.c", - "InstrProfilingValue.c", - "InstrProfilingVersionVar.c", - "InstrProfilingWriter.c", - ], - hdrs = [ - "InstrProfiling.h", - "InstrProfilingInternal.h", - "InstrProfilingPort.h", - "InstrProfilingUtil.h", - "WindowsMMap.h", - ], - compilation_mode = "bootstrap", - defines = [ - "COMPILER_RT_HAS_UNAME=1", - "COMPILER_RT_HAS_FCNTL_LCK=1", - "COMPILER_RT_HAS_ATOMICS=1", - ], - includes = [ - "compiler-rt/include", - "compiler-rt/lib", - ], - visibility = ["//visibility:public"], - deps = ["//compiler-rt:compiler_rt_hdrs"], -) diff --git a/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel deleted file mode 100644 index d25c9c97..00000000 --- a/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel +++ /dev/null @@ -1,254 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "sanitizer_impl_headers", - srcs = [ - "sancov_flags.h", - "sancov_flags.inc", - "sanitizer_addrhashmap.h", - "sanitizer_allocator.h", - "sanitizer_allocator_checks.h", - "sanitizer_allocator_combined.h", - "sanitizer_allocator_dlsym.h", - "sanitizer_allocator_interface.h", - "sanitizer_allocator_internal.h", - "sanitizer_allocator_local_cache.h", - "sanitizer_allocator_primary32.h", - "sanitizer_allocator_primary64.h", - "sanitizer_allocator_report.h", - "sanitizer_allocator_secondary.h", - "sanitizer_allocator_size_class_map.h", - "sanitizer_allocator_stats.h", - "sanitizer_array_ref.h", - "sanitizer_asm.h", - "sanitizer_atomic.h", - "sanitizer_atomic_clang.h", - "sanitizer_atomic_clang_mips.h", - "sanitizer_atomic_clang_other.h", - "sanitizer_atomic_clang_x86.h", - "sanitizer_atomic_msvc.h", - "sanitizer_bitvector.h", - "sanitizer_bvgraph.h", - "sanitizer_chained_origin_depot.h", - "sanitizer_common.h", - "sanitizer_common_interceptors.inc", - "sanitizer_common_interceptors_format.inc", - "sanitizer_common_interceptors_ioctl.inc", - "sanitizer_common_interceptors_memintrinsics.inc", - "sanitizer_common_interceptors_netbsd_compat.inc", # Missing in CMake. - - # Always linux. Missing in CMake. - "sanitizer_common_interceptors_vfork_aarch64.inc.S", - "sanitizer_common_interceptors_vfork_arm.inc.S", - "sanitizer_common_interceptors_vfork_i386.inc.S", - "sanitizer_common_interceptors_vfork_loongarch64.inc.S", - "sanitizer_common_interceptors_vfork_riscv64.inc.S", - "sanitizer_common_interceptors_vfork_x86_64.inc.S", - "sanitizer_common_interface.inc", - "sanitizer_common_interface_posix.inc", - "sanitizer_common_syscalls.inc", - "sanitizer_coverage_interface.inc", - "sanitizer_dbghelp.h", - "sanitizer_deadlock_detector.h", - "sanitizer_deadlock_detector_interface.h", - "sanitizer_dense_map.h", - "sanitizer_dense_map_info.h", - "sanitizer_errno.h", - "sanitizer_errno_codes.h", - "sanitizer_file.h", - "sanitizer_flag_parser.h", - "sanitizer_flags.h", - "sanitizer_flags.inc", - "sanitizer_flat_map.h", - "sanitizer_freebsd.h", - "sanitizer_fuchsia.h", - "sanitizer_getauxval.h", - "sanitizer_glibc_version.h", # Missing in CMake. - "sanitizer_hash.h", - "sanitizer_interceptors_ioctl_netbsd.inc", - "sanitizer_interface_internal.h", - "sanitizer_internal_defs.h", - "sanitizer_leb128.h", - "sanitizer_lfstack.h", - "sanitizer_libc.h", - "sanitizer_libignore.h", - "sanitizer_linux.h", - "sanitizer_list.h", - "sanitizer_local_address_space_view.h", - "sanitizer_lzw.h", - "sanitizer_mac.h", - "sanitizer_mallinfo.h", - "sanitizer_malloc_mac.inc", - "sanitizer_mutex.h", - "sanitizer_placement_new.h", - "sanitizer_platform.h", - "sanitizer_platform_interceptors.h", - "sanitizer_platform_limits_freebsd.h", # Missing in CMake. - "sanitizer_platform_limits_netbsd.h", - "sanitizer_platform_limits_posix.h", - "sanitizer_platform_limits_solaris.h", - "sanitizer_posix.h", - "sanitizer_procmaps.h", - "sanitizer_ptrauth.h", - "sanitizer_quarantine.h", - "sanitizer_range.h", - "sanitizer_redefine_builtins.h", - "sanitizer_report_decorator.h", - "sanitizer_ring_buffer.h", - "sanitizer_signal_interceptors.inc", - "sanitizer_solaris.h", - "sanitizer_stack_store.h", - "sanitizer_stackdepot.h", - "sanitizer_stackdepotbase.h", - "sanitizer_stacktrace.h", - "sanitizer_stacktrace_printer.h", - "sanitizer_stoptheworld.h", - "sanitizer_suppressions.h", - "sanitizer_symbolizer.h", - "sanitizer_symbolizer_fuchsia.h", - "sanitizer_symbolizer_internal.h", - "sanitizer_symbolizer_libbacktrace.h", - "sanitizer_symbolizer_mac.h", - "sanitizer_syscall_generic.inc", - "sanitizer_syscall_linux_aarch64.inc", - "sanitizer_syscall_linux_arm.inc", - "sanitizer_syscall_linux_riscv64.inc", - "sanitizer_syscall_linux_x86_64.inc", - "sanitizer_syscalls_netbsd.inc", - "sanitizer_thread_arg_retval.h", - "sanitizer_thread_registry.h", - "sanitizer_thread_safety.h", - "sanitizer_tls_get_addr.h", - "sanitizer_type_traits.h", # Missing in CMake. - "sanitizer_vector.h", - "sanitizer_win.h", - "sanitizer_win_defs.h", - "sanitizer_win_dll_thunk.h", - "sanitizer_win_weak_interception.h", - ], - visibility = ["//visibility:public"], -) - -# TODO: Architecture-specific names as in CMake. -ll_library( - name = "RTSanitizerCommon", - srcs = [ - "sanitizer_allocator.cpp", - "sanitizer_common.cpp", - "sanitizer_deadlock_detector1.cpp", - "sanitizer_deadlock_detector2.cpp", - "sanitizer_errno.cpp", - "sanitizer_file.cpp", - "sanitizer_flags.cpp", - "sanitizer_flag_parser.cpp", - "sanitizer_fuchsia.cpp", - "sanitizer_libc.cpp", - "sanitizer_libignore.cpp", - "sanitizer_linux.cpp", - "sanitizer_linux_s390.cpp", - "sanitizer_mac.cpp", - "sanitizer_mutex.cpp", - "sanitizer_netbsd.cpp", - "sanitizer_platform_limits_freebsd.cpp", - "sanitizer_platform_limits_linux.cpp", - "sanitizer_platform_limits_netbsd.cpp", - "sanitizer_platform_limits_posix.cpp", - "sanitizer_platform_limits_solaris.cpp", - "sanitizer_posix.cpp", - "sanitizer_printf.cpp", - "sanitizer_procmaps_common.cpp", - "sanitizer_procmaps_bsd.cpp", - "sanitizer_procmaps_fuchsia.cpp", - "sanitizer_procmaps_linux.cpp", - "sanitizer_procmaps_mac.cpp", - "sanitizer_procmaps_solaris.cpp", - "sanitizer_range.cpp", - "sanitizer_solaris.cpp", - "sanitizer_stoptheworld_fuchsia.cpp", - "sanitizer_stoptheworld_mac.cpp", - "sanitizer_stoptheworld_win.cpp", - "sanitizer_suppressions.cpp", - "sanitizer_tls_get_addr.cpp", - "sanitizer_thread_arg_retval.cpp", - "sanitizer_thread_registry.cpp", - "sanitizer_type_traits.cpp", - "sanitizer_win.cpp", - - # Always termination. - "sanitizer_termination.cpp", - ], - hdrs = [":sanitizer_impl_headers"], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTSanitizerCommonNoLibc", - srcs = [ - "sanitizer_common_nolibc.cpp", - ], - hdrs = [":sanitizer_impl_headers"], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTSanitizerCommonLibc", - srcs = [ - "sanitizer_allocator_checks.cpp", - "sanitizer_common_libcdep.cpp", - "sanitizer_linux_libcdep.cpp", - "sanitizer_mac_libcdep.cpp", - "sanitizer_posix_libcdep.cpp", - "sanitizer_stoptheworld_linux_libcdep.cpp", - "sanitizer_stoptheworld_netbsd_libcdep.cpp", - ], - hdrs = [":sanitizer_impl_headers"], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTSanitizerCommonCoverage", - srcs = [ - "sancov_flags.cpp", - "sanitizer_coverage_fuchsia.cpp", - "sanitizer_coverage_libcdep_new.cpp", - "sanitizer_coverage_win_sections.cpp", - ], - hdrs = [":sanitizer_impl_headers"], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTSanitizerCommonSymbolizer", - srcs = [ - "sanitizer_allocator_report.cpp", - "sanitizer_chained_origin_depot.cpp", - "sanitizer_stack_store.cpp", - "sanitizer_stackdepot.cpp", - "sanitizer_stacktrace.cpp", - "sanitizer_stacktrace_libcdep.cpp", - "sanitizer_stacktrace_printer.cpp", - "sanitizer_stacktrace_sparc.cpp", - "sanitizer_symbolizer.cpp", - "sanitizer_symbolizer_libbacktrace.cpp", - "sanitizer_symbolizer_libcdep.cpp", - "sanitizer_symbolizer_mac.cpp", - "sanitizer_symbolizer_markup.cpp", - "sanitizer_symbolizer_posix_libcdep.cpp", - "sanitizer_symbolizer_report.cpp", - "sanitizer_symbolizer_win.cpp", - "sanitizer_unwind_linux_libcdep.cpp", - "sanitizer_unwind_win.cpp", - ], - hdrs = [":sanitizer_impl_headers"], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) diff --git a/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel deleted file mode 100644 index c475c8bc..00000000 --- a/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "tsan_headers", - srcs = [ - "rtl/tsan_defs.h", - "rtl/tsan_dense_alloc.h", - "rtl/tsan_fd.h", - "rtl/tsan_flags.h", - "rtl/tsan_flags.inc", - "rtl/tsan_ignoreset.h", - "rtl/tsan_ilist.h", - "rtl/tsan_interceptors.h", - "rtl/tsan_interface.h", - "rtl/tsan_interface.inc", - "rtl/tsan_interface_ann.h", - "rtl/tsan_interface_java.h", - "rtl/tsan_mman.h", - "rtl/tsan_mutexset.h", - "rtl/tsan_platform.h", - "rtl/tsan_ppc_regs.h", - "rtl/tsan_report.h", - "rtl/tsan_rtl.h", - "rtl/tsan_shadow.h", - "rtl/tsan_stack_trace.h", - "rtl/tsan_suppressions.h", - "rtl/tsan_symbolize.h", - "rtl/tsan_sync.h", - "rtl/tsan_trace.h", - "rtl/tsan_vector_clock.h", - ], -) - -ll_library( - name = "clang_rt.tsan", - srcs = [ - # TSAN_SOURCES. - "rtl/tsan_debugging.cpp", - "rtl/tsan_external.cpp", - "rtl/tsan_fd.cpp", - "rtl/tsan_flags.cpp", - "rtl/tsan_ignoreset.cpp", - "rtl/tsan_interceptors_memintrinsics.cpp", - "rtl/tsan_interceptors_posix.cpp", - "rtl/tsan_interface.cpp", - "rtl/tsan_interface_ann.cpp", - "rtl/tsan_interface_atomic.cpp", - "rtl/tsan_interface_java.cpp", - "rtl/tsan_malloc_mac.cpp", - "rtl/tsan_md5.cpp", - "rtl/tsan_mman.cpp", - "rtl/tsan_mutexset.cpp", - "rtl/tsan_report.cpp", - "rtl/tsan_rtl.cpp", - "rtl/tsan_rtl_access.cpp", - "rtl/tsan_rtl_mutex.cpp", - "rtl/tsan_rtl_proc.cpp", - "rtl/tsan_rtl_report.cpp", - "rtl/tsan_rtl_thread.cpp", - "rtl/tsan_stack_trace.cpp", - "rtl/tsan_suppressions.cpp", - "rtl/tsan_symbolize.cpp", - "rtl/tsan_sync.cpp", - "rtl/tsan_vector_clock.cpp", - - # TSAN_ASM_SOURCES. - "rtl/tsan_rtl_amd64.S", - - # TSAN_PREINIT_SOURCES. - "rtl/tsan_preinit.cpp", - - # Linux sources. - "rtl/tsan_platform_linux.cpp", - "rtl/tsan_platform_posix.cpp", - ], - hdrs = [ - ":tsan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - angled_includes = ["compiler-rt/lib"], - compilation_mode = "bootstrap", - compile_flags = ["-msse4.2"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - "//compiler-rt/lib/ubsan:RTUbsan", - ], -) - -ll_library( - name = "clang_rt.tsan_cxx", - srcs = [ - "rtl/tsan_new_delete.cpp", - ], - hdrs = [ - ":tsan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - "//compiler-rt/lib/ubsan:ubsan_headers", - ], - compilation_mode = "bootstrap", - compile_flags = ["-msse4.2"], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - "//compiler-rt/lib/ubsan:RTUbsan_cxx", - ], -) diff --git a/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel b/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel deleted file mode 100644 index 8ad56ad4..00000000 --- a/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel +++ /dev/null @@ -1,109 +0,0 @@ -load("@rules_ll//ll:defs.bzl", "ll_library") - -filegroup( - name = "ubsan_headers", - srcs = [ - "ubsan_checks.inc", - "ubsan_diag.h", - "ubsan_flags.h", - "ubsan_flags.inc", - "ubsan_handlers.h", - "ubsan_handlers_cxx.h", - "ubsan_init.h", - "ubsan_interface.inc", - "ubsan_monitor.h", - "ubsan_platform.h", - "ubsan_signals_standalone.h", - "ubsan_type_hash.h", - "ubsan_value.h", - ], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTUbsan", - srcs = [ - "ubsan_diag.cpp", - "ubsan_flags.cpp", - "ubsan_handlers.cpp", - "ubsan_init.cpp", - "ubsan_monitor.cpp", - "ubsan_value.cpp", - ], - hdrs = [ - ":ubsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - defines = [ - "UBSAN_CAN_USE_CXXABI", - ], - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTUbsan_cxx", - srcs = [ - "ubsan_handlers_cxx.cpp", - "ubsan_type_hash.cpp", - "ubsan_type_hash_itanium.cpp", - "ubsan_type_hash_win.cpp", - ], - hdrs = [ - ":ubsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "RTUbsan_standalone", - srcs = [ - "ubsan_diag_standalone.cpp", - "ubsan_init_standalone.cpp", - "ubsan_signals_standalone.cpp", - ], - hdrs = [ - ":ubsan_headers", - "//compiler-rt/lib/interception:interception_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], -) - -ll_library( - name = "clang_rt.ubsan_standalone", - srcs = [ - "ubsan_init_standalone_preinit.cpp", - ], - hdrs = [ - ":ubsan_headers", - "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", - ], - compilation_mode = "bootstrap", - includes = ["compiler-rt/lib"], - visibility = ["//visibility:public"], - deps = [ - ":RTUbsan", - ":RTUbsan_standalone", - "//compiler-rt/lib/interception:RTInterception", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", - "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", - ], -) - -ll_library( - name = "clang_rt.ubsan_standalone_cxx", - compilation_mode = "bootstrap", - visibility = ["//visibility:public"], - deps = [ - ":RTUbsan_cxx", - ], -) diff --git a/llvm-project-overlay/libcxx/BUILD.bazel b/llvm-project-overlay/libcxx/BUILD.bazel index 21d7510a..ed6e9e47 100644 --- a/llvm-project-overlay/libcxx/BUILD.bazel +++ b/llvm-project-overlay/libcxx/BUILD.bazel @@ -1,3 +1,4 @@ +load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@rules_ll//ll:defs.bzl", "ll_library") @@ -127,6 +128,12 @@ LIBCXX_MODULE_STD_INCLUDE_SOURCES = "\n".join([ for file in LIBCXX_MODULE_STD_INCLUDE_SOURCES_FILES ]) +copy_file( + name = "__assertion_handler_gen", + src = "vendor/llvm/default_assertion_handler.in", + out = "include/__assertion_handler", +) + expand_template( name = "std.cppm", out = "modules/std.cppm", @@ -170,6 +177,8 @@ expand_template( "#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION": NO, "#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS": NO, "#cmakedefine _LIBCPP_HAS_NO_STD_MODULES": NO, + "#cmakedefine _LIBCPP_HAS_NO_TIME_ZONE_DATABASE": NO, + "#cmakedefine _LIBCPP_INSTRUMENTED_WITH_ASAN": NO, # PSTL backends. "#cmakedefine _LIBCPP_PSTL_CPU_BACKEND_SERIAL": "#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL", @@ -179,8 +188,7 @@ expand_template( # Hardening. # TODO: Evaluate performance impact of this. If it isn't noticeable for # most use-cases, enable it. - "#cmakedefine01 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT": "#define _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT 0", - "#cmakedefine01 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT": "#define _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT 0", + "#cmakedefine _LIBCPP_HARDENING_MODE_DEFAULT @_LIBCPP_HARDENING_MODE_DEFAULT@": "#define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE", "@_LIBCPP_ABI_DEFINES@": NO, "@_LIBCPP_EXTRA_SITE_DEFINES@": NO, }, @@ -192,6 +200,7 @@ filegroup( srcs = glob([ "include/**/*", ]) + [ + ":__assertion_handler_gen", ":__config_site_gen", ":module_modulemap_gen", ], @@ -210,8 +219,10 @@ ll_library( "src/algorithm.cpp", "src/any.cpp", "src/bind.cpp", + "src/call_once.cpp", "src/charconv.cpp", "src/chrono.cpp", + "src/error_category.cpp", "src/exception.cpp", "src/filesystem/filesystem_clock.cpp", "src/filesystem/filesystem_error.cpp", diff --git a/patches/hipamd_deprecate_fix.diff b/patches/hipamd_deprecate_fix.diff index 8eda4fd6..63028fb4 100644 --- a/patches/hipamd_deprecate_fix.diff +++ b/patches/hipamd_deprecate_fix.diff @@ -1,16 +1,8 @@ diff --git a/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h b/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h -index 0522cc8e..8678403b 100644 +index 36ea5ca5f..c21497664 100644 --- a/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h +++ b/hipamd/include/hip/nvidia_detail/nvidia_hip_runtime_api.h -@@ -39,6 +39,7 @@ THE SOFTWARE. - #define CUDA_11030 11030 - #define CUDA_11040 11040 - #define CUDA_11060 11060 -+#define CUDA_12000 12000 - - #ifdef __cplusplus - extern "C" { -@@ -2668,17 +2669,21 @@ inline static hipError_t hipCtxGetFlags(unsigned int* flags) { +@@ -2669,17 +2669,21 @@ inline static hipError_t hipCtxGetFlags(unsigned int* flags) { return hipCUResultTohipError(cuCtxGetFlags(flags)); } @@ -18,7 +10,7 @@ index 0522cc8e..8678403b 100644 inline static hipError_t hipCtxDetach(hipCtx_t ctx) { return hipCUResultTohipError(cuCtxDetach(ctx)); } -+#endif // CUDA_VERSION < CUDA_12000 ++#endif inline static hipError_t hipDeviceGet(hipDevice_t* device, int ordinal) { return hipCUResultTohipError(cuDeviceGet(device, ordinal)); @@ -28,11 +20,11 @@ index 0522cc8e..8678403b 100644 inline static hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device) { return hipCUResultTohipError(cuDeviceComputeCapability(major, minor, device)); } -+#endif // CUDA_VERSION < CUDA12000 ++#endif inline static hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device) { return hipCUResultTohipError(cuDeviceGetName(name, len, device)); -@@ -2742,9 +2747,11 @@ inline static hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule +@@ -2743,9 +2747,11 @@ inline static hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule return hipCUResultTohipError(cuModuleGetFunction(function, module, kname)); } @@ -40,40 +32,11 @@ index 0522cc8e..8678403b 100644 inline static hipError_t hipModuleGetTexRef(hipTexRef* pTexRef, hipModule_t hmod, const char* name){ return hipCUResultTohipError(cuModuleGetTexRef(pTexRef, hmod, name)); } -+#endif // CUDA_VERSION < CUDA_12000 ++#endif inline static hipError_t hipFuncGetAttributes(hipFuncAttributes* attr, const void* func) { return hipCUDAErrorTohipError(cudaFuncGetAttributes(attr, func)); -@@ -2792,6 +2799,7 @@ inline static hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t - return hipCUDAErrorTohipError(cudaFuncSetCacheConfig(func, cacheConfig)); - } - -+#if CUDA_VERSION < 12000 - __HIP_DEPRECATED inline static hipError_t hipBindTexture(size_t* offset, - struct textureReference* tex, - const void* devPtr, -@@ -2805,6 +2813,7 @@ __HIP_DEPRECATED inline static hipError_t hipBindTexture2D( - const hipChannelFormatDesc* desc, size_t width, size_t height, size_t pitch) { - return hipCUDAErrorTohipError(cudaBindTexture2D(offset, tex, devPtr, desc, width, height, pitch)); - } -+#endif // CUDA_VERSION <= 12000 - - inline static hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w, - hipChannelFormatKind f) { -@@ -2837,10 +2846,12 @@ inline static hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDe - return hipCUDAErrorTohipError(cudaGetTextureObjectResourceDesc( pResDesc, textureObject)); - } - -+#if CUDA_VERSION < CUDA_12000 - __HIP_DEPRECATED inline static hipError_t hipGetTextureAlignmentOffset( - size_t* offset, const struct textureReference* texref) { - return hipCUDAErrorTohipError(cudaGetTextureAlignmentOffset(offset,texref)); - } -+#endif // CUDA_VERSION < CUDA_12000 - - inline static hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array) - { -@@ -2864,6 +2875,7 @@ inline static hipError_t hipModuleLaunchCooperativeKernel(hipFunction_t f, unsig +@@ -2870,6 +2876,7 @@ inline static hipError_t hipModuleLaunchCooperativeKernel(hipFunction_t f, unsig sharedMemBytes, stream,kernelParams)); } @@ -81,7 +44,7 @@ index 0522cc8e..8678403b 100644 inline static hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList, int numDevices, unsigned int flags) { return hipCUDAErrorTohipError(cudaLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags)); -@@ -2876,6 +2888,7 @@ inline static hipError_t hipModuleLaunchCooperativeKernelMultiDevice( +@@ -2882,6 +2889,7 @@ inline static hipError_t hipModuleLaunchCooperativeKernelMultiDevice( return hipCUResultTohipError(cuLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags)); } @@ -89,35 +52,19 @@ index 0522cc8e..8678403b 100644 inline static hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t* extSem_out, const hipExternalSemaphoreHandleDesc* semHandleDesc) { -@@ -3086,6 +3099,7 @@ inline static hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( - blockSize, dynamicSMemSize, flags)); +@@ -3180,6 +3188,7 @@ __HIP_DEPRECATED inline static hipError_t hipTexRefSetFilterMode(hipTexRef hTexR + return hipCUResultTohipError(cuTexRefSetFilterMode(hTexRef,fm)); } +#if CUDA_VERSION < CUDA_12000 - template - inline static hipError_t hipBindTexture(size_t* offset, const struct texture& tex, - const void* devPtr, size_t size = UINT_MAX) { -@@ -3128,6 +3142,7 @@ __HIP_DEPRECATED inline static hipError_t hipBindTextureToArray( - struct texture& tex, hipArray_const_t array) { - return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array)); + inline static hipError_t hipTexRefSetAddress(size_t *ByteOffset, hipTexRef hTexRef, hipDeviceptr_t dptr, size_t bytes){ + return hipCUResultTohipError(cuTexRefSetAddress(ByteOffset,hTexRef,dptr,bytes)); } -+#endif // CUDA_VERSION < CUDA_12000 - - template - inline static hipChannelFormatDesc hipCreateChannelDesc() { -@@ -3164,6 +3179,7 @@ inline static hipError_t hipTexObjectGetTextureDesc(HIP_TEXTURE_DESC* pTexDesc, - return hipCUResultTohipError(cuTexObjectGetTextureDesc(pTexDesc, (CUtexObject)texObject)); +@@ -3187,6 +3196,7 @@ inline static hipError_t hipTexRefSetAddress(size_t *ByteOffset, hipTexRef hTexR + inline static hipError_t hipTexRefSetAddress2D(hipTexRef hTexRef, const CUDA_ARRAY_DESCRIPTOR *desc, hipDeviceptr_t dptr, size_t Pitch){ + return hipCUResultTohipError(cuTexRefSetAddress2D(hTexRef,desc,dptr,Pitch)); } ++#endif -+#if CUDA_VERSION < CUDA_12000 - __HIP_DEPRECATED inline static hipError_t hipTexRefSetAddressMode(hipTexRef hTexRef, int dim, hipAddress_mode am){ - return hipCUResultTohipError(cuTexRefSetAddressMode(hTexRef,dim,am)); - } -@@ -3191,6 +3207,7 @@ __HIP_DEPRECATED inline static hipError_t hipTexRefSetFlags(hipTexRef hTexRef, u - __HIP_DEPRECATED inline static hipError_t hipTexRefSetArray(hipTexRef hTexRef, hiparray hArray, unsigned int Flags){ - return hipCUResultTohipError(cuTexRefSetArray(hTexRef,hArray,Flags)); - } -+#endif // CUDA_VERSION < 12000 - - inline static hipError_t hipArrayCreate(hiparray* pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray){ - return hipCUResultTohipError(cuArrayCreate(pHandle, pAllocateArray)); + __HIP_DEPRECATED inline static hipError_t hipTexRefSetFormat(hipTexRef hTexRef, hipArray_Format fmt, int NumPackedComponents){ + return hipCUResultTohipError(cuTexRefSetFormat(hTexRef,fmt,NumPackedComponents)); diff --git a/patches/llvm-project-fix-bazel-7.diff b/patches/llvm-project-fix-bazel-7.diff deleted file mode 100644 index 27c1fa90..00000000 --- a/patches/llvm-project-fix-bazel-7.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel -index bbabc5397e9893..317863de3b36ca 100644 ---- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel -+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel -@@ -57,7 +57,7 @@ genrule( - srcs = ["misc/ConfusableTable/confusables.txt"], - outs = ["Confusables.inc"], - cmd = "$(location :confusable_table_builder) $(SRCS) $(OUTS)", -- exec_tools = [":confusable_table_builder"], -+ tools = [":confusable_table_builder"], - visibility = ["//visibility:private"], - ) - diff --git a/patches/llvm-project-fix-zlib-includes.diff b/patches/llvm-project-fix-zlib-includes.diff index 2c1d7e78..0b27b626 100644 --- a/patches/llvm-project-fix-zlib-includes.diff +++ b/patches/llvm-project-fix-zlib-includes.diff @@ -1,11 +1,11 @@ diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp -index 0b9b76e5b832..22cb971dd795 100644 +index ee9374186787..5bef0824d260 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp -@@ -22,7 +22,7 @@ - #include "llvm/Support/Path.h" - #include "llvm/Support/TimeProfiler.h" +@@ -24,7 +24,7 @@ #if LLVM_ENABLE_ZLIB + // Avoid introducing max as a macro from Windows headers. + #define NOMINMAX -#include +#include "zlib.h" #endif @@ -37,4 +37,3 @@ index 8e57ba798f52..9c460108d5bc 100644 #endif #if LLVM_ENABLE_ZSTD #include - diff --git a/patches/rules_ll_overlay_patch.diff b/patches/rules_ll_overlay_patch.diff index 5038714f..f4b749c4 100644 --- a/patches/rules_ll_overlay_patch.diff +++ b/patches/rules_ll_overlay_patch.diff @@ -1,9 +1,11 @@ diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -new file mode 100644 -index 000000000000..635ef6e8947b ---- /dev/null +index 573549781ab7..3025cde923f6 100644 +--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -@@ -0,0 +1,19 @@ +@@ -49,3 +49,1209 @@ cc_library( + ], + linkstatic = True, + ) +load("@rules_ll//ll:defs.bzl", "ll_library") + +ll_library( @@ -19,110 +21,95 @@ index 000000000000..635ef6e8947b + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], + deps = [ -+ "//compiler-rt/lib/builtins", -+ "//compiler-rt/lib/builtins:crt", ++ ":builtins", ++ ":crt", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/BUILD.bazel -new file mode 100644 -index 000000000000..1bb8bf6d7fd4 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/BUILD.bazel -@@ -0,0 +1 @@ -+# empty -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel -new file mode 100644 -index 000000000000..79b4371039c9 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/asan/BUILD.bazel -@@ -0,0 +1,245 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "asan_headers", + srcs = [ -+ "asan_activation.h", -+ "asan_activation_flags.inc", -+ "asan_allocator.h", -+ "asan_descriptions.h", -+ "asan_errors.h", -+ "asan_fake_stack.h", -+ "asan_flags.h", -+ "asan_flags.inc", -+ "asan_init_version.h", -+ "asan_interceptors.h", -+ "asan_interceptors_memintrinsics.h", -+ "asan_interface.inc", -+ "asan_interface_internal.h", -+ "asan_internal.h", -+ "asan_lock.h", -+ "asan_mapping.h", -+ "asan_poisoning.h", -+ "asan_premap_shadow.h", -+ "asan_report.h", -+ "asan_scariness_score.h", -+ "asan_stack.h", -+ "asan_stats.h", -+ "asan_suppressions.h", -+ "asan_thread.h", ++ "lib/asan/asan_activation.h", ++ "lib/asan/asan_activation_flags.inc", ++ "lib/asan/asan_allocator.h", ++ "lib/asan/asan_descriptions.h", ++ "lib/asan/asan_errors.h", ++ "lib/asan/asan_fake_stack.h", ++ "lib/asan/asan_flags.h", ++ "lib/asan/asan_flags.inc", ++ "lib/asan/asan_init_version.h", ++ "lib/asan/asan_interceptors.h", ++ "lib/asan/asan_interceptors_memintrinsics.h", ++ "lib/asan/asan_interface.inc", ++ "lib/asan/asan_interface_internal.h", ++ "lib/asan/asan_internal.h", ++ "lib/asan/asan_mapping.h", ++ "lib/asan/asan_poisoning.h", ++ "lib/asan/asan_premap_shadow.h", ++ "lib/asan/asan_report.h", ++ "lib/asan/asan_scariness_score.h", ++ "lib/asan/asan_stack.h", ++ "lib/asan/asan_stats.h", ++ "lib/asan/asan_suppressions.h", ++ "lib/asan/asan_thread.h", + ], +) + +filegroup( + name = "asan_sources", + srcs = [ -+ "asan_activation.cpp", -+ "asan_allocator.cpp", -+ "asan_debugging.cpp", -+ "asan_descriptions.cpp", -+ "asan_errors.cpp", -+ "asan_fake_stack.cpp", -+ "asan_flags.cpp", -+ "asan_fuchsia.cpp", -+ "asan_globals.cpp", -+ "asan_globals_win.cpp", -+ "asan_interceptors.cpp", -+ "asan_interceptors_memintrinsics.cpp", -+ "asan_interceptors_vfork.S", # Not Win32 and not Apple. -+ "asan_linux.cpp", -+ "asan_mac.cpp", -+ "asan_malloc_linux.cpp", -+ "asan_malloc_mac.cpp", -+ "asan_malloc_win.cpp", -+ "asan_memory_profile.cpp", -+ "asan_poisoning.cpp", -+ "asan_posix.cpp", -+ "asan_premap_shadow.cpp", -+ "asan_report.cpp", -+ "asan_rtl.cpp", -+ "asan_shadow_setup.cpp", -+ "asan_stack.cpp", -+ "asan_stats.cpp", -+ "asan_suppressions.cpp", -+ "asan_thread.cpp", -+ "asan_win.cpp", ++ "lib/asan/asan_activation.cpp", ++ "lib/asan/asan_allocator.cpp", ++ "lib/asan/asan_debugging.cpp", ++ "lib/asan/asan_descriptions.cpp", ++ "lib/asan/asan_errors.cpp", ++ "lib/asan/asan_fake_stack.cpp", ++ "lib/asan/asan_flags.cpp", ++ "lib/asan/asan_fuchsia.cpp", ++ "lib/asan/asan_globals.cpp", ++ "lib/asan/asan_globals_win.cpp", ++ "lib/asan/asan_interceptors.cpp", ++ "lib/asan/asan_interceptors_memintrinsics.cpp", ++ "lib/asan/asan_interceptors_vfork.S", # Not Win32 and not Apple. ++ "lib/asan/asan_linux.cpp", ++ "lib/asan/asan_mac.cpp", ++ "lib/asan/asan_malloc_linux.cpp", ++ "lib/asan/asan_malloc_mac.cpp", ++ "lib/asan/asan_malloc_win.cpp", ++ "lib/asan/asan_memory_profile.cpp", ++ "lib/asan/asan_poisoning.cpp", ++ "lib/asan/asan_posix.cpp", ++ "lib/asan/asan_premap_shadow.cpp", ++ "lib/asan/asan_report.cpp", ++ "lib/asan/asan_rtl.cpp", ++ "lib/asan/asan_shadow_setup.cpp", ++ "lib/asan/asan_stack.cpp", ++ "lib/asan/asan_stats.cpp", ++ "lib/asan/asan_suppressions.cpp", ++ "lib/asan/asan_thread.cpp", ++ "lib/asan/asan_win.cpp", + ], +) + +filegroup( + name = "asan_cxx_sources", + srcs = [ -+ "asan_new_delete.cpp", ++ "lib/asan/asan_new_delete.cpp", + ], +) + +filegroup( + name = "asan_static_sources", + srcs = [ -+ "asan_rtl_static.cpp", -+ "asan_rtl_x86_64.S", # Not Win32 and not Apple. ++ "lib/asan/asan_rtl_static.cpp", ++ "lib/asan/asan_rtl_x86_64.S", # Not Win32 and not Apple. + ], +) + +filegroup( + name = "asan_preinit_sources", + srcs = [ -+ "asan_preinit.cpp", ++ "lib/asan/asan_preinit.cpp", + ], +) + @@ -134,10 +121,10 @@ index 000000000000..79b4371039c9 + ], + hdrs = [ + ":asan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/lsan:lsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":interception_headers", ++ ":lsan_headers", ++ ":sanitizer_impl_headers", ++ ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ @@ -156,10 +143,10 @@ index 000000000000..79b4371039c9 + ], + hdrs = [ + ":asan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/lsan:lsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":interception_headers", ++ ":lsan_headers", ++ ":sanitizer_impl_headers", ++ ":ubsan_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], @@ -174,8 +161,8 @@ index 000000000000..79b4371039c9 + ], + hdrs = [ + ":asan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":interception_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], @@ -186,12 +173,12 @@ index 000000000000..79b4371039c9 +ll_library( + name = "RTAsan_static", + srcs = [ -+ "asan_rtl_static.cpp", -+ "asan_rtl_x86_64.S", # Not Win32 and not Apple. ++ "lib/asan/asan_rtl_static.cpp", ++ "lib/asan/asan_rtl_x86_64.S", # Not Win32 and not Apple. + ], + hdrs = [ + ":asan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], @@ -206,7 +193,7 @@ index 000000000000..79b4371039c9 + ], + hdrs = [ + ":asan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + emit = ["objects"], @@ -221,13 +208,13 @@ index 000000000000..79b4371039c9 + deps = [ + ":RTAsan", + ":RTAsan_preinit", -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/lsan:RTLSanCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", -+ "//compiler-rt/lib/ubsan:RTUbsan", ++ ":RTInterception", ++ ":RTLSanCommon", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", ++ ":RTUbsan", + ], +) + @@ -243,14 +230,14 @@ index 000000000000..79b4371039c9 + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_dynamic", -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/lsan:RTLSanCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", -+ "//compiler-rt/lib/ubsan:RTUbsan", -+ "//compiler-rt/lib/ubsan:RTUbsan_cxx", ++ ":RTInterception", ++ ":RTLSanCommon", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", ++ ":RTUbsan", ++ ":RTUbsan_cxx", + ], +) + @@ -260,7 +247,7 @@ index 000000000000..79b4371039c9 + visibility = ["//visibility:public"], + deps = [ + ":RTAsan_cxx", -+ "//compiler-rt/lib/ubsan:RTUbsan_cxx", ++ ":RTUbsan_cxx", + ], +) + @@ -281,233 +268,231 @@ index 000000000000..79b4371039c9 + ":RTAsan_preinit", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel -new file mode 100644 -index 000000000000..5e874e8f0bfe ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/builtins/BUILD.bazel -@@ -0,0 +1,252 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +GENERIC_SOURCES = [ -+ "absvdi2.c", -+ "absvsi2.c", -+ "absvti2.c", -+ "adddf3.c", -+ "addsf3.c", -+ "addvdi3.c", -+ "addvsi3.c", -+ "addvti3.c", -+ "apple_versioning.c", -+ "ashldi3.c", -+ "ashlti3.c", -+ "ashrdi3.c", -+ "ashrti3.c", -+ "bswapdi2.c", -+ "bswapsi2.c", -+ "clzdi2.c", -+ "clzsi2.c", -+ "clzti2.c", -+ "cmpdi2.c", -+ "cmpti2.c", -+ "comparedf2.c", -+ "comparesf2.c", -+ "ctzdi2.c", -+ "ctzsi2.c", -+ "ctzti2.c", -+ "divdc3.c", -+ "divdf3.c", -+ "divdi3.c", -+ "divmoddi4.c", -+ "divmodsi4.c", -+ "divmodti4.c", -+ "divsc3.c", -+ "divsf3.c", -+ "divsi3.c", -+ "divti3.c", -+ "extendsfdf2.c", -+ "extendhfsf2.c", -+ "ffsdi2.c", -+ "ffssi2.c", -+ "ffsti2.c", -+ "fixdfdi.c", -+ "fixdfsi.c", -+ "fixdfti.c", -+ "fixsfdi.c", -+ "fixsfsi.c", -+ "fixsfti.c", -+ "fixunsdfdi.c", -+ "fixunsdfsi.c", -+ "fixunsdfti.c", -+ "fixunssfdi.c", -+ "fixunssfsi.c", -+ "fixunssfti.c", -+ "floatdidf.c", -+ "floatdisf.c", -+ "floatsidf.c", -+ "floatsisf.c", -+ "floattidf.c", -+ "floattisf.c", -+ "floatundidf.c", -+ "floatundisf.c", -+ "floatunsidf.c", -+ "floatunsisf.c", -+ "floatuntidf.c", -+ "floatuntisf.c", -+ "fp_mode.c", -+ "int_util.c", -+ "lshrdi3.c", -+ "lshrti3.c", -+ "moddi3.c", -+ "modsi3.c", -+ "modti3.c", -+ "muldc3.c", -+ "muldf3.c", -+ "muldi3.c", -+ "mulodi4.c", -+ "mulosi4.c", -+ "muloti4.c", -+ "mulsc3.c", -+ "mulsf3.c", -+ "multi3.c", -+ "mulvdi3.c", -+ "mulvsi3.c", -+ "mulvti3.c", -+ "negdf2.c", -+ "negdi2.c", -+ "negsf2.c", -+ "negti2.c", -+ "negvdi2.c", -+ "negvsi2.c", -+ "negvti2.c", -+ "os_version_check.c", -+ "paritydi2.c", -+ "paritysi2.c", -+ "parityti2.c", -+ "popcountdi2.c", -+ "popcountsi2.c", -+ "popcountti2.c", -+ "powidf2.c", -+ "powisf2.c", -+ "subdf3.c", -+ "subsf3.c", -+ "subvdi3.c", -+ "subvsi3.c", -+ "subvti3.c", -+ "trampoline_setup.c", -+ "truncdfhf2.c", -+ "truncdfsf2.c", -+ "truncsfhf2.c", -+ "ucmpdi2.c", -+ "ucmpti2.c", -+ "udivdi3.c", -+ "udivmoddi4.c", -+ "udivmodsi4.c", -+ "udivmodti4.c", -+ "udivsi3.c", -+ "udivti3.c", -+ "umoddi3.c", -+ "umodsi3.c", -+ "umodti3.c", ++ "lib/builtins/absvdi2.c", ++ "lib/builtins/absvsi2.c", ++ "lib/builtins/absvti2.c", ++ "lib/builtins/adddf3.c", ++ "lib/builtins/addsf3.c", ++ "lib/builtins/addvdi3.c", ++ "lib/builtins/addvsi3.c", ++ "lib/builtins/addvti3.c", ++ "lib/builtins/apple_versioning.c", ++ "lib/builtins/ashldi3.c", ++ "lib/builtins/ashlti3.c", ++ "lib/builtins/ashrdi3.c", ++ "lib/builtins/ashrti3.c", ++ "lib/builtins/bswapdi2.c", ++ "lib/builtins/bswapsi2.c", ++ "lib/builtins/clzdi2.c", ++ "lib/builtins/clzsi2.c", ++ "lib/builtins/clzti2.c", ++ "lib/builtins/cmpdi2.c", ++ "lib/builtins/cmpti2.c", ++ "lib/builtins/comparedf2.c", ++ "lib/builtins/comparesf2.c", ++ "lib/builtins/ctzdi2.c", ++ "lib/builtins/ctzsi2.c", ++ "lib/builtins/ctzti2.c", ++ "lib/builtins/divdc3.c", ++ "lib/builtins/divdf3.c", ++ "lib/builtins/divdi3.c", ++ "lib/builtins/divmoddi4.c", ++ "lib/builtins/divmodsi4.c", ++ "lib/builtins/divmodti4.c", ++ "lib/builtins/divsc3.c", ++ "lib/builtins/divsf3.c", ++ "lib/builtins/divsi3.c", ++ "lib/builtins/divti3.c", ++ "lib/builtins/extendsfdf2.c", ++ "lib/builtins/extendhfsf2.c", ++ "lib/builtins/ffsdi2.c", ++ "lib/builtins/ffssi2.c", ++ "lib/builtins/ffsti2.c", ++ "lib/builtins/fixdfdi.c", ++ "lib/builtins/fixdfsi.c", ++ "lib/builtins/fixdfti.c", ++ "lib/builtins/fixsfdi.c", ++ "lib/builtins/fixsfsi.c", ++ "lib/builtins/fixsfti.c", ++ "lib/builtins/fixunsdfdi.c", ++ "lib/builtins/fixunsdfsi.c", ++ "lib/builtins/fixunsdfti.c", ++ "lib/builtins/fixunssfdi.c", ++ "lib/builtins/fixunssfsi.c", ++ "lib/builtins/fixunssfti.c", ++ "lib/builtins/floatdidf.c", ++ "lib/builtins/floatdisf.c", ++ "lib/builtins/floatsidf.c", ++ "lib/builtins/floatsisf.c", ++ "lib/builtins/floattidf.c", ++ "lib/builtins/floattisf.c", ++ "lib/builtins/floatundidf.c", ++ "lib/builtins/floatundisf.c", ++ "lib/builtins/floatunsidf.c", ++ "lib/builtins/floatunsisf.c", ++ "lib/builtins/floatuntidf.c", ++ "lib/builtins/floatuntisf.c", ++ "lib/builtins/fp_mode.c", ++ "lib/builtins/int_util.c", ++ "lib/builtins/lshrdi3.c", ++ "lib/builtins/lshrti3.c", ++ "lib/builtins/moddi3.c", ++ "lib/builtins/modsi3.c", ++ "lib/builtins/modti3.c", ++ "lib/builtins/muldc3.c", ++ "lib/builtins/muldf3.c", ++ "lib/builtins/muldi3.c", ++ "lib/builtins/mulodi4.c", ++ "lib/builtins/mulosi4.c", ++ "lib/builtins/muloti4.c", ++ "lib/builtins/mulsc3.c", ++ "lib/builtins/mulsf3.c", ++ "lib/builtins/multi3.c", ++ "lib/builtins/mulvdi3.c", ++ "lib/builtins/mulvsi3.c", ++ "lib/builtins/mulvti3.c", ++ "lib/builtins/negdf2.c", ++ "lib/builtins/negdi2.c", ++ "lib/builtins/negsf2.c", ++ "lib/builtins/negti2.c", ++ "lib/builtins/negvdi2.c", ++ "lib/builtins/negvsi2.c", ++ "lib/builtins/negvti2.c", ++ "lib/builtins/os_version_check.c", ++ "lib/builtins/paritydi2.c", ++ "lib/builtins/paritysi2.c", ++ "lib/builtins/parityti2.c", ++ "lib/builtins/popcountdi2.c", ++ "lib/builtins/popcountsi2.c", ++ "lib/builtins/popcountti2.c", ++ "lib/builtins/powidf2.c", ++ "lib/builtins/powisf2.c", ++ "lib/builtins/subdf3.c", ++ "lib/builtins/subsf3.c", ++ "lib/builtins/subvdi3.c", ++ "lib/builtins/subvsi3.c", ++ "lib/builtins/subvti3.c", ++ "lib/builtins/trampoline_setup.c", ++ "lib/builtins/truncdfhf2.c", ++ "lib/builtins/truncdfsf2.c", ++ "lib/builtins/truncsfhf2.c", ++ "lib/builtins/ucmpdi2.c", ++ "lib/builtins/ucmpti2.c", ++ "lib/builtins/udivdi3.c", ++ "lib/builtins/udivmoddi4.c", ++ "lib/builtins/udivmodsi4.c", ++ "lib/builtins/udivmodti4.c", ++ "lib/builtins/udivsi3.c", ++ "lib/builtins/udivti3.c", ++ "lib/builtins/umoddi3.c", ++ "lib/builtins/umodsi3.c", ++ "lib/builtins/umodti3.c", + + # Not Fuchsia and not a bare-metal build. -+ "emutls.c", -+ "enable_execute_stack.c", -+ "eprintf.c", ++ "lib/builtins/emutls.c", ++ "lib/builtins/enable_execute_stack.c", ++ "lib/builtins/eprintf.c", + + # Not sure whether we want atomic in this or separately. -+ "atomic.c", ++ "lib/builtins/atomic.c", + + # Not sure whether this is for libunwind or gcc_s. gotta check. -+ "gcc_personality_v0.c", ++ "lib/builtins/gcc_personality_v0.c", + + # Not Fuchsia. -+ "clear_cache.c", ++ "lib/builtins/clear_cache.c", +] + +GENERIC_TF_SOURCES = [ -+ "addtf3.c", -+ "comparetf2.c", -+ "divtc3.c", -+ "divtf3.c", -+ "extenddftf2.c", -+ "extendhftf2.c", -+ "extendsftf2.c", -+ "fixtfdi.c", -+ "fixtfsi.c", -+ "fixtfti.c", -+ "fixunstfdi.c", -+ "fixunstfsi.c", -+ "fixunstfti.c", -+ "floatditf.c", -+ "floatsitf.c", -+ "floattitf.c", -+ "floatunditf.c", -+ "floatunsitf.c", -+ "floatuntitf.c", -+ "multc3.c", -+ "multf3.c", -+ "powitf2.c", -+ "subtf3.c", -+ "trunctfdf2.c", -+ "trunctfhf2.c", -+ "trunctfsf2.c", ++ "lib/builtins/addtf3.c", ++ "lib/builtins/comparetf2.c", ++ "lib/builtins/divtc3.c", ++ "lib/builtins/divtf3.c", ++ "lib/builtins/extenddftf2.c", ++ "lib/builtins/extendhftf2.c", ++ "lib/builtins/extendsftf2.c", ++ "lib/builtins/fixtfdi.c", ++ "lib/builtins/fixtfsi.c", ++ "lib/builtins/fixtfti.c", ++ "lib/builtins/fixunstfdi.c", ++ "lib/builtins/fixunstfsi.c", ++ "lib/builtins/fixunstfti.c", ++ "lib/builtins/floatditf.c", ++ "lib/builtins/floatsitf.c", ++ "lib/builtins/floattitf.c", ++ "lib/builtins/floatunditf.c", ++ "lib/builtins/floatunsitf.c", ++ "lib/builtins/floatuntitf.c", ++ "lib/builtins/multc3.c", ++ "lib/builtins/multf3.c", ++ "lib/builtins/powitf2.c", ++ "lib/builtins/subtf3.c", ++ "lib/builtins/trunctfdf2.c", ++ "lib/builtins/trunctfhf2.c", ++ "lib/builtins/trunctfsf2.c", +] + +X86_ARCH_SOURCES = [ -+ "cpu_model.c", -+ "i386/fp_mode.c", # Used on 64-bit as well. ++ "lib/builtins/cpu_model/x86.c", ++ "lib/builtins/i386/fp_mode.c", # Used on 64-bit as well. +] + +X86_80_BIT_SOURCES = [ -+ "divxc3.c", -+ "fixxfdi.c", -+ "fixxfti.c", -+ "fixunsxfdi.c", -+ "fixunsxfsi.c", -+ "fixunsxfti.c", -+ "floatdixf.c", -+ "floattixf.c", -+ "floatundixf.c", -+ "floatuntixf.c", -+ "mulxc3.c", -+ "powixf2.c", ++ "lib/builtins/divxc3.c", ++ "lib/builtins/extendxftf2.c", ++ "lib/builtins/fixxfdi.c", ++ "lib/builtins/fixxfti.c", ++ "lib/builtins/fixunsxfdi.c", ++ "lib/builtins/fixunsxfsi.c", ++ "lib/builtins/fixunsxfti.c", ++ "lib/builtins/floatdixf.c", ++ "lib/builtins/floattixf.c", ++ "lib/builtins/floatundixf.c", ++ "lib/builtins/floatuntixf.c", ++ "lib/builtins/mulxc3.c", ++ "lib/builtins/powixf2.c", ++ "lib/builtins/trunctfxf2.c", +] + +X86_64_SOURCES = GENERIC_SOURCES + GENERIC_TF_SOURCES + X86_ARCH_SOURCES + X86_80_BIT_SOURCES + [ -+ "x86_64/floatdidf.c", -+ "x86_64/floatdisf.c", -+ "x86_64/floatundidf.S", -+ "x86_64/floatundisf.S", -+ "x86_64/floatdixf.c", -+ "x86_64/floatundixf.S", ++ "lib/builtins/x86_64/floatdidf.c", ++ "lib/builtins/x86_64/floatdisf.c", ++ "lib/builtins/x86_64/floatundidf.S", ++ "lib/builtins/x86_64/floatundisf.S", ++ "lib/builtins/x86_64/floatdixf.c", ++ "lib/builtins/x86_64/floatundixf.S", +] + +ll_library( + name = "builtins", + srcs = X86_64_SOURCES, + hdrs = [ -+ "assembly.h", -+ "fp_add_impl.inc", -+ "fp_compare_impl.inc", -+ "fp_div_impl.inc", -+ "fp_extend.h", -+ "fp_extend_impl.inc", -+ "fp_fixint_impl.inc", -+ "fp_fixuint_impl.inc", -+ "fp_lib.h", -+ "fp_mode.h", -+ "fp_mul_impl.inc", -+ "fp_trunc.h", -+ "fp_trunc_impl.inc", -+ "int_div_impl.inc", -+ "int_endianness.h", -+ "int_lib.h", -+ "int_math.h", -+ "int_mulo_impl.inc", -+ "int_mulv_impl.inc", -+ "int_types.h", -+ "int_util.h", ++ "lib/builtins/assembly.h", ++ "lib/builtins/cpu_model/cpu_model.h", ++ "lib/builtins/fp_add_impl.inc", ++ "lib/builtins/fp_compare_impl.inc", ++ "lib/builtins/fp_div_impl.inc", ++ "lib/builtins/fp_extend.h", ++ "lib/builtins/fp_extend_impl.inc", ++ "lib/builtins/fp_fixint_impl.inc", ++ "lib/builtins/fp_fixuint_impl.inc", ++ "lib/builtins/fp_lib.h", ++ "lib/builtins/fp_mode.h", ++ "lib/builtins/fp_mul_impl.inc", ++ "lib/builtins/fp_trunc.h", ++ "lib/builtins/fp_trunc_impl.inc", ++ "lib/builtins/int_div_impl.inc", ++ "lib/builtins/int_endianness.h", ++ "lib/builtins/int_lib.h", ++ "lib/builtins/int_math.h", ++ "lib/builtins/int_mulo_impl.inc", ++ "lib/builtins/int_mulv_impl.inc", ++ "lib/builtins/int_to_fp.h", ++ "lib/builtins/int_to_fp_impl.inc", ++ "lib/builtins/int_types.h", ++ "lib/builtins/int_util.h", + ], + compilation_mode = "bootstrap", + visibility = ["//visibility:public"], @@ -515,7 +500,7 @@ index 000000000000..5e874e8f0bfe + +ll_library( + name = "crtbegin", -+ srcs = ["crtbegin.c"], ++ srcs = ["lib/builtins/crtbegin.c"], + compilation_mode = "bootstrap", + defines = ["EH_USE_FRAME_REGISTRY"], + emit = ["objects"], @@ -524,7 +509,7 @@ index 000000000000..5e874e8f0bfe + +ll_library( + name = "crtend", -+ srcs = ["crtend.c"], ++ srcs = ["lib/builtins/crtend.c"], + compilation_mode = "bootstrap", + emit = ["objects"], + visibility = ["//visibility:public"], @@ -539,21 +524,14 @@ index 000000000000..5e874e8f0bfe + ":crtend", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel -new file mode 100644 -index 000000000000..4b8956e49b44 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/interception/BUILD.bazel -@@ -0,0 +1,29 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "interception_headers", + srcs = [ -+ "interception.h", -+ "interception_linux.h", -+ "interception_mac.h", -+ "interception_win.h", ++ "lib/interception/interception.h", ++ "lib/interception/interception_linux.h", ++ "lib/interception/interception_mac.h", ++ "lib/interception/interception_win.h", + ], + visibility = ["//visibility:public"], +) @@ -561,36 +539,29 @@ index 000000000000..4b8956e49b44 +ll_library( + name = "RTInterception", + srcs = [ -+ "interception_linux.cpp", -+ "interception_mac.cpp", -+ "interception_type_test.cpp", -+ "interception_win.cpp", ++ "lib/interception/interception_linux.cpp", ++ "lib/interception/interception_mac.cpp", ++ "lib/interception/interception_type_test.cpp", ++ "lib/interception/interception_win.cpp", + ], + hdrs = [ + ":interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel -new file mode 100644 -index 000000000000..2a3ebd4fa2e9 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/lsan/BUILD.bazel -@@ -0,0 +1,63 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "lsan_headers", + srcs = [ -+ "lsan.h", -+ "lsan_allocator.h", -+ "lsan_common.h", -+ "lsan_flags.inc", -+ "lsan_posix.h", # Missing in CMake. -+ "lsan_thread.h", ++ "lib/lsan/lsan.h", ++ "lib/lsan/lsan_allocator.h", ++ "lib/lsan/lsan_common.h", ++ "lib/lsan/lsan_flags.inc", ++ "lib/lsan/lsan_posix.h", # Missing in CMake. ++ "lib/lsan/lsan_thread.h", + ], + visibility = ["//visibility:public"], +) @@ -598,14 +569,14 @@ index 000000000000..2a3ebd4fa2e9 +ll_library( + name = "RTLSanCommon", + srcs = [ -+ "lsan_common.cpp", -+ "lsan_common_fuchsia.cpp", -+ "lsan_common_linux.cpp", -+ "lsan_common_mac.cpp", ++ "lib/lsan/lsan_common.cpp", ++ "lib/lsan/lsan_common_fuchsia.cpp", ++ "lib/lsan/lsan_common_linux.cpp", ++ "lib/lsan/lsan_common_mac.cpp", + ], + hdrs = [ + ":lsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], @@ -615,56 +586,49 @@ index 000000000000..2a3ebd4fa2e9 +ll_library( + name = "clang_rt.lsan", + srcs = [ -+ "lsan.cpp", -+ "lsan_allocator.cpp", -+ "lsan_fuchsia.cpp", -+ "lsan_interceptors.cpp", -+ "lsan_linux.cpp", -+ "lsan_mac.cpp", -+ "lsan_malloc_mac.cpp", -+ "lsan_posix.cpp", -+ "lsan_preinit.cpp", -+ "lsan_thread.cpp", ++ "lib/lsan/lsan.cpp", ++ "lib/lsan/lsan_allocator.cpp", ++ "lib/lsan/lsan_fuchsia.cpp", ++ "lib/lsan/lsan_interceptors.cpp", ++ "lib/lsan/lsan_linux.cpp", ++ "lib/lsan/lsan_mac.cpp", ++ "lib/lsan/lsan_malloc_mac.cpp", ++ "lib/lsan/lsan_posix.cpp", ++ "lib/lsan/lsan_preinit.cpp", ++ "lib/lsan/lsan_thread.cpp", + ], + hdrs = [ ++ ":interception_headers", + ":lsan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", ++ ":sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ ++ ":RTInterception", + ":RTLSanCommon", -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel -new file mode 100644 -index 000000000000..55b96afc1839 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/msan/BUILD.bazel -@@ -0,0 +1,76 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "msan_headers", + srcs = [ -+ "msan.h", -+ "msan_allocator.h", -+ "msan_chained_origin_depot.h", -+ "msan_dl.h", -+ "msan_flags.h", -+ "msan_flags.inc", -+ "msan_interface_internal.h", -+ "msan_origin.h", -+ "msan_poisoning.h", -+ "msan_report.h", -+ "msan_thread.h", ++ "lib/msan/msan.h", ++ "lib/msan/msan_allocator.h", ++ "lib/msan/msan_chained_origin_depot.h", ++ "lib/msan/msan_dl.h", ++ "lib/msan/msan_flags.h", ++ "lib/msan/msan_flags.inc", ++ "lib/msan/msan_interface_internal.h", ++ "lib/msan/msan_origin.h", ++ "lib/msan/msan_poisoning.h", ++ "lib/msan/msan_report.h", ++ "lib/msan/msan_thread.h", + ], + visibility = ["//visibility:public"], +) @@ -672,21 +636,21 @@ index 000000000000..55b96afc1839 +ll_library( + name = "clang_rt.msan", + srcs = [ -+ "msan.cpp", -+ "msan_allocator.cpp", -+ "msan_chained_origin_depot.cpp", -+ "msan_dl.cpp", -+ "msan_interceptors.cpp", -+ "msan_linux.cpp", -+ "msan_poisoning.cpp", -+ "msan_report.cpp", -+ "msan_thread.cpp", ++ "lib/msan/msan.cpp", ++ "lib/msan/msan_allocator.cpp", ++ "lib/msan/msan_chained_origin_depot.cpp", ++ "lib/msan/msan_dl.cpp", ++ "lib/msan/msan_interceptors.cpp", ++ "lib/msan/msan_linux.cpp", ++ "lib/msan/msan_poisoning.cpp", ++ "lib/msan/msan_report.cpp", ++ "lib/msan/msan_thread.cpp", + ], + hdrs = [ ++ ":interception_headers", + ":msan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":sanitizer_impl_headers", ++ ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ @@ -695,25 +659,25 @@ index 000000000000..55b96afc1839 + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", -+ "//compiler-rt/lib/ubsan:RTUbsan", ++ ":RTInterception", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", ++ ":RTUbsan", + ], +) + +ll_library( + name = "clang_rt.msan_cxx", + srcs = [ -+ "msan_new_delete.cpp", ++ "lib/msan/msan_new_delete.cpp", + ], + hdrs = [ ++ ":interception_headers", + ":msan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":sanitizer_impl_headers", ++ ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = [ @@ -722,45 +686,38 @@ index 000000000000..55b96afc1839 + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ -+ "//compiler-rt/lib/ubsan:RTUbsan_cxx", ++ ":RTUbsan_cxx", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel -new file mode 100644 -index 000000000000..8731b402fb28 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel -@@ -0,0 +1,44 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +ll_library( + name = "clang_rt.profile", + srcs = [ -+ "GCDAProfiling.c", -+ "InstrProfiling.c", -+ "InstrProfilingBuffer.c", -+ "InstrProfilingFile.c", -+ "InstrProfilingInternal.c", -+ "InstrProfilingMerge.c", -+ "InstrProfilingMergeFile.c", -+ "InstrProfilingNameVar.c", -+ "InstrProfilingPlatformDarwin.c", -+ "InstrProfilingPlatformFuchsia.c", -+ "InstrProfilingPlatformLinux.c", -+ "InstrProfilingPlatformOther.c", -+ "InstrProfilingPlatformWindows.c", -+ "InstrProfilingRuntime.cpp", -+ "InstrProfilingUtil.c", -+ "InstrProfilingValue.c", -+ "InstrProfilingVersionVar.c", -+ "InstrProfilingWriter.c", ++ "lib/profile/GCDAProfiling.c", ++ "lib/profile/InstrProfiling.c", ++ "lib/profile/InstrProfilingBuffer.c", ++ "lib/profile/InstrProfilingFile.c", ++ "lib/profile/InstrProfilingInternal.c", ++ "lib/profile/InstrProfilingMerge.c", ++ "lib/profile/InstrProfilingMergeFile.c", ++ "lib/profile/InstrProfilingNameVar.c", ++ "lib/profile/InstrProfilingPlatformDarwin.c", ++ "lib/profile/InstrProfilingPlatformFuchsia.c", ++ "lib/profile/InstrProfilingPlatformLinux.c", ++ "lib/profile/InstrProfilingPlatformOther.c", ++ "lib/profile/InstrProfilingPlatformWindows.c", ++ "lib/profile/InstrProfilingRuntime.cpp", ++ "lib/profile/InstrProfilingUtil.c", ++ "lib/profile/InstrProfilingValue.c", ++ "lib/profile/InstrProfilingVersionVar.c", ++ "lib/profile/InstrProfilingWriter.c", + ], + hdrs = [ -+ "InstrProfiling.h", -+ "InstrProfilingInternal.h", -+ "InstrProfilingPort.h", -+ "InstrProfilingUtil.h", -+ "WindowsMMap.h", ++ "lib/profile/InstrProfiling.h", ++ "lib/profile/InstrProfilingInternal.h", ++ "lib/profile/InstrProfilingPort.h", ++ "lib/profile/InstrProfilingUtil.h", ++ "lib/profile/WindowsMMap.h", + ], + compilation_mode = "bootstrap", + defines = [ @@ -773,141 +730,135 @@ index 000000000000..8731b402fb28 + "compiler-rt/lib", + ], + visibility = ["//visibility:public"], -+ deps = ["//compiler-rt:compiler_rt_hdrs"], ++ deps = [":compiler_rt_hdrs"], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel -new file mode 100644 -index 000000000000..d25c9c9728be ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/sanitizer_common/BUILD.bazel -@@ -0,0 +1,254 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "sanitizer_impl_headers", + srcs = [ -+ "sancov_flags.h", -+ "sancov_flags.inc", -+ "sanitizer_addrhashmap.h", -+ "sanitizer_allocator.h", -+ "sanitizer_allocator_checks.h", -+ "sanitizer_allocator_combined.h", -+ "sanitizer_allocator_dlsym.h", -+ "sanitizer_allocator_interface.h", -+ "sanitizer_allocator_internal.h", -+ "sanitizer_allocator_local_cache.h", -+ "sanitizer_allocator_primary32.h", -+ "sanitizer_allocator_primary64.h", -+ "sanitizer_allocator_report.h", -+ "sanitizer_allocator_secondary.h", -+ "sanitizer_allocator_size_class_map.h", -+ "sanitizer_allocator_stats.h", -+ "sanitizer_array_ref.h", -+ "sanitizer_asm.h", -+ "sanitizer_atomic.h", -+ "sanitizer_atomic_clang.h", -+ "sanitizer_atomic_clang_mips.h", -+ "sanitizer_atomic_clang_other.h", -+ "sanitizer_atomic_clang_x86.h", -+ "sanitizer_atomic_msvc.h", -+ "sanitizer_bitvector.h", -+ "sanitizer_bvgraph.h", -+ "sanitizer_chained_origin_depot.h", -+ "sanitizer_common.h", -+ "sanitizer_common_interceptors.inc", -+ "sanitizer_common_interceptors_format.inc", -+ "sanitizer_common_interceptors_ioctl.inc", -+ "sanitizer_common_interceptors_memintrinsics.inc", -+ "sanitizer_common_interceptors_netbsd_compat.inc", # Missing in CMake. ++ "lib/sanitizer_common/sancov_flags.h", ++ "lib/sanitizer_common/sancov_flags.inc", ++ "lib/sanitizer_common/sanitizer_addrhashmap.h", ++ "lib/sanitizer_common/sanitizer_allocator.h", ++ "lib/sanitizer_common/sanitizer_allocator_checks.h", ++ "lib/sanitizer_common/sanitizer_allocator_combined.h", ++ "lib/sanitizer_common/sanitizer_allocator_dlsym.h", ++ "lib/sanitizer_common/sanitizer_allocator_interface.h", ++ "lib/sanitizer_common/sanitizer_allocator_internal.h", ++ "lib/sanitizer_common/sanitizer_allocator_local_cache.h", ++ "lib/sanitizer_common/sanitizer_allocator_primary32.h", ++ "lib/sanitizer_common/sanitizer_allocator_primary64.h", ++ "lib/sanitizer_common/sanitizer_allocator_report.h", ++ "lib/sanitizer_common/sanitizer_allocator_secondary.h", ++ "lib/sanitizer_common/sanitizer_allocator_size_class_map.h", ++ "lib/sanitizer_common/sanitizer_allocator_stats.h", ++ "lib/sanitizer_common/sanitizer_array_ref.h", ++ "lib/sanitizer_common/sanitizer_asm.h", ++ "lib/sanitizer_common/sanitizer_atomic.h", ++ "lib/sanitizer_common/sanitizer_atomic_clang.h", ++ "lib/sanitizer_common/sanitizer_atomic_clang_mips.h", ++ "lib/sanitizer_common/sanitizer_atomic_clang_other.h", ++ "lib/sanitizer_common/sanitizer_atomic_clang_x86.h", ++ "lib/sanitizer_common/sanitizer_atomic_msvc.h", ++ "lib/sanitizer_common/sanitizer_bitvector.h", ++ "lib/sanitizer_common/sanitizer_bvgraph.h", ++ "lib/sanitizer_common/sanitizer_chained_origin_depot.h", ++ "lib/sanitizer_common/sanitizer_common.h", ++ "lib/sanitizer_common/sanitizer_common_interceptors.inc", ++ "lib/sanitizer_common/sanitizer_common_interceptors_format.inc", ++ "lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc", ++ "lib/sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc", ++ "lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc", # Missing in CMake. + + # Always linux. Missing in CMake. -+ "sanitizer_common_interceptors_vfork_aarch64.inc.S", -+ "sanitizer_common_interceptors_vfork_arm.inc.S", -+ "sanitizer_common_interceptors_vfork_i386.inc.S", -+ "sanitizer_common_interceptors_vfork_loongarch64.inc.S", -+ "sanitizer_common_interceptors_vfork_riscv64.inc.S", -+ "sanitizer_common_interceptors_vfork_x86_64.inc.S", -+ "sanitizer_common_interface.inc", -+ "sanitizer_common_interface_posix.inc", -+ "sanitizer_common_syscalls.inc", -+ "sanitizer_coverage_interface.inc", -+ "sanitizer_dbghelp.h", -+ "sanitizer_deadlock_detector.h", -+ "sanitizer_deadlock_detector_interface.h", -+ "sanitizer_dense_map.h", -+ "sanitizer_dense_map_info.h", -+ "sanitizer_errno.h", -+ "sanitizer_errno_codes.h", -+ "sanitizer_file.h", -+ "sanitizer_flag_parser.h", -+ "sanitizer_flags.h", -+ "sanitizer_flags.inc", -+ "sanitizer_flat_map.h", -+ "sanitizer_freebsd.h", -+ "sanitizer_fuchsia.h", -+ "sanitizer_getauxval.h", -+ "sanitizer_glibc_version.h", # Missing in CMake. -+ "sanitizer_hash.h", -+ "sanitizer_interceptors_ioctl_netbsd.inc", -+ "sanitizer_interface_internal.h", -+ "sanitizer_internal_defs.h", -+ "sanitizer_leb128.h", -+ "sanitizer_lfstack.h", -+ "sanitizer_libc.h", -+ "sanitizer_libignore.h", -+ "sanitizer_linux.h", -+ "sanitizer_list.h", -+ "sanitizer_local_address_space_view.h", -+ "sanitizer_lzw.h", -+ "sanitizer_mac.h", -+ "sanitizer_mallinfo.h", -+ "sanitizer_malloc_mac.inc", -+ "sanitizer_mutex.h", -+ "sanitizer_placement_new.h", -+ "sanitizer_platform.h", -+ "sanitizer_platform_interceptors.h", -+ "sanitizer_platform_limits_freebsd.h", # Missing in CMake. -+ "sanitizer_platform_limits_netbsd.h", -+ "sanitizer_platform_limits_posix.h", -+ "sanitizer_platform_limits_solaris.h", -+ "sanitizer_posix.h", -+ "sanitizer_procmaps.h", -+ "sanitizer_ptrauth.h", -+ "sanitizer_quarantine.h", -+ "sanitizer_range.h", -+ "sanitizer_redefine_builtins.h", -+ "sanitizer_report_decorator.h", -+ "sanitizer_ring_buffer.h", -+ "sanitizer_signal_interceptors.inc", -+ "sanitizer_solaris.h", -+ "sanitizer_stack_store.h", -+ "sanitizer_stackdepot.h", -+ "sanitizer_stackdepotbase.h", -+ "sanitizer_stacktrace.h", -+ "sanitizer_stacktrace_printer.h", -+ "sanitizer_stoptheworld.h", -+ "sanitizer_suppressions.h", -+ "sanitizer_symbolizer.h", -+ "sanitizer_symbolizer_fuchsia.h", -+ "sanitizer_symbolizer_internal.h", -+ "sanitizer_symbolizer_libbacktrace.h", -+ "sanitizer_symbolizer_mac.h", -+ "sanitizer_syscall_generic.inc", -+ "sanitizer_syscall_linux_aarch64.inc", -+ "sanitizer_syscall_linux_arm.inc", -+ "sanitizer_syscall_linux_riscv64.inc", -+ "sanitizer_syscall_linux_x86_64.inc", -+ "sanitizer_syscalls_netbsd.inc", -+ "sanitizer_thread_arg_retval.h", -+ "sanitizer_thread_registry.h", -+ "sanitizer_thread_safety.h", -+ "sanitizer_tls_get_addr.h", -+ "sanitizer_type_traits.h", # Missing in CMake. -+ "sanitizer_vector.h", -+ "sanitizer_win.h", -+ "sanitizer_win_defs.h", -+ "sanitizer_win_dll_thunk.h", -+ "sanitizer_win_weak_interception.h", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_aarch64.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_arm.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_riscv64.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S", ++ "lib/sanitizer_common/sanitizer_common_interface.inc", ++ "lib/sanitizer_common/sanitizer_common_interface_posix.inc", ++ "lib/sanitizer_common/sanitizer_common_syscalls.inc", ++ "lib/sanitizer_common/sanitizer_coverage_interface.inc", ++ "lib/sanitizer_common/sanitizer_dbghelp.h", ++ "lib/sanitizer_common/sanitizer_deadlock_detector.h", ++ "lib/sanitizer_common/sanitizer_deadlock_detector_interface.h", ++ "lib/sanitizer_common/sanitizer_dense_map.h", ++ "lib/sanitizer_common/sanitizer_dense_map_info.h", ++ "lib/sanitizer_common/sanitizer_dl.h", ++ "lib/sanitizer_common/sanitizer_errno.h", ++ "lib/sanitizer_common/sanitizer_errno_codes.h", ++ "lib/sanitizer_common/sanitizer_file.h", ++ "lib/sanitizer_common/sanitizer_flag_parser.h", ++ "lib/sanitizer_common/sanitizer_flags.h", ++ "lib/sanitizer_common/sanitizer_flags.inc", ++ "lib/sanitizer_common/sanitizer_flat_map.h", ++ "lib/sanitizer_common/sanitizer_fuchsia.h", ++ "lib/sanitizer_common/sanitizer_getauxval.h", ++ "lib/sanitizer_common/sanitizer_glibc_version.h", # Missing in CMake. ++ "lib/sanitizer_common/sanitizer_hash.h", ++ "lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc", ++ "lib/sanitizer_common/sanitizer_interface_internal.h", ++ "lib/sanitizer_common/sanitizer_internal_defs.h", ++ "lib/sanitizer_common/sanitizer_leb128.h", ++ "lib/sanitizer_common/sanitizer_lfstack.h", ++ "lib/sanitizer_common/sanitizer_libc.h", ++ "lib/sanitizer_common/sanitizer_libignore.h", ++ "lib/sanitizer_common/sanitizer_linux.h", ++ "lib/sanitizer_common/sanitizer_list.h", ++ "lib/sanitizer_common/sanitizer_local_address_space_view.h", ++ "lib/sanitizer_common/sanitizer_lzw.h", ++ "lib/sanitizer_common/sanitizer_mac.h", ++ "lib/sanitizer_common/sanitizer_mallinfo.h", ++ "lib/sanitizer_common/sanitizer_malloc_mac.inc", ++ "lib/sanitizer_common/sanitizer_mutex.h", ++ "lib/sanitizer_common/sanitizer_placement_new.h", ++ "lib/sanitizer_common/sanitizer_platform.h", ++ "lib/sanitizer_common/sanitizer_platform_interceptors.h", ++ "lib/sanitizer_common/sanitizer_platform_limits_freebsd.h", # Missing in CMake. ++ "lib/sanitizer_common/sanitizer_platform_limits_netbsd.h", ++ "lib/sanitizer_common/sanitizer_platform_limits_posix.h", ++ "lib/sanitizer_common/sanitizer_platform_limits_solaris.h", ++ "lib/sanitizer_common/sanitizer_posix.h", ++ "lib/sanitizer_common/sanitizer_procmaps.h", ++ "lib/sanitizer_common/sanitizer_ptrauth.h", ++ "lib/sanitizer_common/sanitizer_quarantine.h", ++ "lib/sanitizer_common/sanitizer_range.h", ++ "lib/sanitizer_common/sanitizer_redefine_builtins.h", ++ "lib/sanitizer_common/sanitizer_report_decorator.h", ++ "lib/sanitizer_common/sanitizer_ring_buffer.h", ++ "lib/sanitizer_common/sanitizer_signal_interceptors.inc", ++ "lib/sanitizer_common/sanitizer_solaris.h", ++ "lib/sanitizer_common/sanitizer_stack_store.h", ++ "lib/sanitizer_common/sanitizer_stackdepot.h", ++ "lib/sanitizer_common/sanitizer_stackdepotbase.h", ++ "lib/sanitizer_common/sanitizer_stacktrace.h", ++ "lib/sanitizer_common/sanitizer_stacktrace_printer.h", ++ "lib/sanitizer_common/sanitizer_stoptheworld.h", ++ "lib/sanitizer_common/sanitizer_suppressions.h", ++ "lib/sanitizer_common/sanitizer_symbolizer.h", ++ "lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h", ++ "lib/sanitizer_common/sanitizer_symbolizer_internal.h", ++ "lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h", ++ "lib/sanitizer_common/sanitizer_symbolizer_mac.h", ++ "lib/sanitizer_common/sanitizer_symbolizer_markup.h", ++ "lib/sanitizer_common/sanitizer_syscall_generic.inc", ++ "lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc", ++ "lib/sanitizer_common/sanitizer_syscall_linux_arm.inc", ++ "lib/sanitizer_common/sanitizer_syscall_linux_riscv64.inc", ++ "lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc", ++ "lib/sanitizer_common/sanitizer_syscalls_netbsd.inc", ++ "lib/sanitizer_common/sanitizer_thread_arg_retval.h", ++ "lib/sanitizer_common/sanitizer_thread_registry.h", ++ "lib/sanitizer_common/sanitizer_thread_safety.h", ++ "lib/sanitizer_common/sanitizer_tls_get_addr.h", ++ "lib/sanitizer_common/sanitizer_type_traits.h", # Missing in CMake. ++ "lib/sanitizer_common/sanitizer_vector.h", ++ "lib/sanitizer_common/sanitizer_win.h", ++ "lib/sanitizer_common/sanitizer_win_defs.h", ++ "lib/sanitizer_common/sanitizer_win_dll_thunk.h", ++ "lib/sanitizer_common/sanitizer_win_weak_interception.h", + ], + visibility = ["//visibility:public"], +) @@ -916,49 +867,49 @@ index 000000000000..d25c9c9728be +ll_library( + name = "RTSanitizerCommon", + srcs = [ -+ "sanitizer_allocator.cpp", -+ "sanitizer_common.cpp", -+ "sanitizer_deadlock_detector1.cpp", -+ "sanitizer_deadlock_detector2.cpp", -+ "sanitizer_errno.cpp", -+ "sanitizer_file.cpp", -+ "sanitizer_flags.cpp", -+ "sanitizer_flag_parser.cpp", -+ "sanitizer_fuchsia.cpp", -+ "sanitizer_libc.cpp", -+ "sanitizer_libignore.cpp", -+ "sanitizer_linux.cpp", -+ "sanitizer_linux_s390.cpp", -+ "sanitizer_mac.cpp", -+ "sanitizer_mutex.cpp", -+ "sanitizer_netbsd.cpp", -+ "sanitizer_platform_limits_freebsd.cpp", -+ "sanitizer_platform_limits_linux.cpp", -+ "sanitizer_platform_limits_netbsd.cpp", -+ "sanitizer_platform_limits_posix.cpp", -+ "sanitizer_platform_limits_solaris.cpp", -+ "sanitizer_posix.cpp", -+ "sanitizer_printf.cpp", -+ "sanitizer_procmaps_common.cpp", -+ "sanitizer_procmaps_bsd.cpp", -+ "sanitizer_procmaps_fuchsia.cpp", -+ "sanitizer_procmaps_linux.cpp", -+ "sanitizer_procmaps_mac.cpp", -+ "sanitizer_procmaps_solaris.cpp", -+ "sanitizer_range.cpp", -+ "sanitizer_solaris.cpp", -+ "sanitizer_stoptheworld_fuchsia.cpp", -+ "sanitizer_stoptheworld_mac.cpp", -+ "sanitizer_stoptheworld_win.cpp", -+ "sanitizer_suppressions.cpp", -+ "sanitizer_tls_get_addr.cpp", -+ "sanitizer_thread_arg_retval.cpp", -+ "sanitizer_thread_registry.cpp", -+ "sanitizer_type_traits.cpp", -+ "sanitizer_win.cpp", ++ "lib/sanitizer_common/sanitizer_allocator.cpp", ++ "lib/sanitizer_common/sanitizer_common.cpp", ++ "lib/sanitizer_common/sanitizer_deadlock_detector1.cpp", ++ "lib/sanitizer_common/sanitizer_deadlock_detector2.cpp", ++ "lib/sanitizer_common/sanitizer_errno.cpp", ++ "lib/sanitizer_common/sanitizer_file.cpp", ++ "lib/sanitizer_common/sanitizer_flags.cpp", ++ "lib/sanitizer_common/sanitizer_flag_parser.cpp", ++ "lib/sanitizer_common/sanitizer_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_libc.cpp", ++ "lib/sanitizer_common/sanitizer_libignore.cpp", ++ "lib/sanitizer_common/sanitizer_linux.cpp", ++ "lib/sanitizer_common/sanitizer_linux_s390.cpp", ++ "lib/sanitizer_common/sanitizer_mac.cpp", ++ "lib/sanitizer_common/sanitizer_mutex.cpp", ++ "lib/sanitizer_common/sanitizer_netbsd.cpp", ++ "lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp", ++ "lib/sanitizer_common/sanitizer_platform_limits_linux.cpp", ++ "lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp", ++ "lib/sanitizer_common/sanitizer_platform_limits_posix.cpp", ++ "lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp", ++ "lib/sanitizer_common/sanitizer_posix.cpp", ++ "lib/sanitizer_common/sanitizer_printf.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_common.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_bsd.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_linux.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_mac.cpp", ++ "lib/sanitizer_common/sanitizer_procmaps_solaris.cpp", ++ "lib/sanitizer_common/sanitizer_range.cpp", ++ "lib/sanitizer_common/sanitizer_solaris.cpp", ++ "lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_stoptheworld_mac.cpp", ++ "lib/sanitizer_common/sanitizer_stoptheworld_win.cpp", ++ "lib/sanitizer_common/sanitizer_suppressions.cpp", ++ "lib/sanitizer_common/sanitizer_tls_get_addr.cpp", ++ "lib/sanitizer_common/sanitizer_thread_arg_retval.cpp", ++ "lib/sanitizer_common/sanitizer_thread_registry.cpp", ++ "lib/sanitizer_common/sanitizer_type_traits.cpp", ++ "lib/sanitizer_common/sanitizer_win.cpp", + + # Always termination. -+ "sanitizer_termination.cpp", ++ "lib/sanitizer_common/sanitizer_termination.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", @@ -969,7 +920,7 @@ index 000000000000..d25c9c9728be +ll_library( + name = "RTSanitizerCommonNoLibc", + srcs = [ -+ "sanitizer_common_nolibc.cpp", ++ "lib/sanitizer_common/sanitizer_common_nolibc.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", @@ -980,13 +931,14 @@ index 000000000000..d25c9c9728be +ll_library( + name = "RTSanitizerCommonLibc", + srcs = [ -+ "sanitizer_allocator_checks.cpp", -+ "sanitizer_common_libcdep.cpp", -+ "sanitizer_linux_libcdep.cpp", -+ "sanitizer_mac_libcdep.cpp", -+ "sanitizer_posix_libcdep.cpp", -+ "sanitizer_stoptheworld_linux_libcdep.cpp", -+ "sanitizer_stoptheworld_netbsd_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_allocator_checks.cpp", ++ "lib/sanitizer_common/sanitizer_common_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_dl.cpp", ++ "lib/sanitizer_common/sanitizer_linux_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_mac_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_posix_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", @@ -997,10 +949,10 @@ index 000000000000..d25c9c9728be +ll_library( + name = "RTSanitizerCommonCoverage", + srcs = [ -+ "sancov_flags.cpp", -+ "sanitizer_coverage_fuchsia.cpp", -+ "sanitizer_coverage_libcdep_new.cpp", -+ "sanitizer_coverage_win_sections.cpp", ++ "lib/sanitizer_common/sancov_flags.cpp", ++ "lib/sanitizer_common/sanitizer_coverage_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp", ++ "lib/sanitizer_common/sanitizer_coverage_win_sections.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", @@ -1011,66 +963,62 @@ index 000000000000..d25c9c9728be +ll_library( + name = "RTSanitizerCommonSymbolizer", + srcs = [ -+ "sanitizer_allocator_report.cpp", -+ "sanitizer_chained_origin_depot.cpp", -+ "sanitizer_stack_store.cpp", -+ "sanitizer_stackdepot.cpp", -+ "sanitizer_stacktrace.cpp", -+ "sanitizer_stacktrace_libcdep.cpp", -+ "sanitizer_stacktrace_printer.cpp", -+ "sanitizer_stacktrace_sparc.cpp", -+ "sanitizer_symbolizer.cpp", -+ "sanitizer_symbolizer_libbacktrace.cpp", -+ "sanitizer_symbolizer_libcdep.cpp", -+ "sanitizer_symbolizer_mac.cpp", -+ "sanitizer_symbolizer_markup.cpp", -+ "sanitizer_symbolizer_posix_libcdep.cpp", -+ "sanitizer_symbolizer_report.cpp", -+ "sanitizer_symbolizer_win.cpp", -+ "sanitizer_unwind_linux_libcdep.cpp", -+ "sanitizer_unwind_win.cpp", ++ "lib/sanitizer_common/sanitizer_allocator_report.cpp", ++ "lib/sanitizer_common/sanitizer_chained_origin_depot.cpp", ++ "lib/sanitizer_common/sanitizer_stack_store.cpp", ++ "lib/sanitizer_common/sanitizer_stackdepot.cpp", ++ "lib/sanitizer_common/sanitizer_stacktrace.cpp", ++ "lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_stacktrace_printer.cpp", ++ "lib/sanitizer_common/sanitizer_stacktrace_sparc.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_mac.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_markup.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_markup_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_report.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_report_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_symbolizer_win.cpp", ++ "lib/sanitizer_common/sanitizer_unwind_fuchsia.cpp", ++ "lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp", ++ "lib/sanitizer_common/sanitizer_unwind_win.cpp", + ], + hdrs = [":sanitizer_impl_headers"], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel -new file mode 100644 -index 000000000000..c475c8bc53bc ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/tsan/BUILD.bazel -@@ -0,0 +1,115 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "tsan_headers", + srcs = [ -+ "rtl/tsan_defs.h", -+ "rtl/tsan_dense_alloc.h", -+ "rtl/tsan_fd.h", -+ "rtl/tsan_flags.h", -+ "rtl/tsan_flags.inc", -+ "rtl/tsan_ignoreset.h", -+ "rtl/tsan_ilist.h", -+ "rtl/tsan_interceptors.h", -+ "rtl/tsan_interface.h", -+ "rtl/tsan_interface.inc", -+ "rtl/tsan_interface_ann.h", -+ "rtl/tsan_interface_java.h", -+ "rtl/tsan_mman.h", -+ "rtl/tsan_mutexset.h", -+ "rtl/tsan_platform.h", -+ "rtl/tsan_ppc_regs.h", -+ "rtl/tsan_report.h", -+ "rtl/tsan_rtl.h", -+ "rtl/tsan_shadow.h", -+ "rtl/tsan_stack_trace.h", -+ "rtl/tsan_suppressions.h", -+ "rtl/tsan_symbolize.h", -+ "rtl/tsan_sync.h", -+ "rtl/tsan_trace.h", -+ "rtl/tsan_vector_clock.h", ++ "lib/tsan/rtl/tsan_defs.h", ++ "lib/tsan/rtl/tsan_dense_alloc.h", ++ "lib/tsan/rtl/tsan_fd.h", ++ "lib/tsan/rtl/tsan_flags.h", ++ "lib/tsan/rtl/tsan_flags.inc", ++ "lib/tsan/rtl/tsan_ignoreset.h", ++ "lib/tsan/rtl/tsan_ilist.h", ++ "lib/tsan/rtl/tsan_interceptors.h", ++ "lib/tsan/rtl/tsan_interface.h", ++ "lib/tsan/rtl/tsan_interface.inc", ++ "lib/tsan/rtl/tsan_interface_ann.h", ++ "lib/tsan/rtl/tsan_interface_java.h", ++ "lib/tsan/rtl/tsan_mman.h", ++ "lib/tsan/rtl/tsan_mutexset.h", ++ "lib/tsan/rtl/tsan_platform.h", ++ "lib/tsan/rtl/tsan_ppc_regs.h", ++ "lib/tsan/rtl/tsan_report.h", ++ "lib/tsan/rtl/tsan_rtl.h", ++ "lib/tsan/rtl/tsan_shadow.h", ++ "lib/tsan/rtl/tsan_stack_trace.h", ++ "lib/tsan/rtl/tsan_suppressions.h", ++ "lib/tsan/rtl/tsan_symbolize.h", ++ "lib/tsan/rtl/tsan_sync.h", ++ "lib/tsan/rtl/tsan_trace.h", ++ "lib/tsan/rtl/tsan_vector_clock.h", + ], +) + @@ -1078,49 +1026,49 @@ index 000000000000..c475c8bc53bc + name = "clang_rt.tsan", + srcs = [ + # TSAN_SOURCES. -+ "rtl/tsan_debugging.cpp", -+ "rtl/tsan_external.cpp", -+ "rtl/tsan_fd.cpp", -+ "rtl/tsan_flags.cpp", -+ "rtl/tsan_ignoreset.cpp", -+ "rtl/tsan_interceptors_memintrinsics.cpp", -+ "rtl/tsan_interceptors_posix.cpp", -+ "rtl/tsan_interface.cpp", -+ "rtl/tsan_interface_ann.cpp", -+ "rtl/tsan_interface_atomic.cpp", -+ "rtl/tsan_interface_java.cpp", -+ "rtl/tsan_malloc_mac.cpp", -+ "rtl/tsan_md5.cpp", -+ "rtl/tsan_mman.cpp", -+ "rtl/tsan_mutexset.cpp", -+ "rtl/tsan_report.cpp", -+ "rtl/tsan_rtl.cpp", -+ "rtl/tsan_rtl_access.cpp", -+ "rtl/tsan_rtl_mutex.cpp", -+ "rtl/tsan_rtl_proc.cpp", -+ "rtl/tsan_rtl_report.cpp", -+ "rtl/tsan_rtl_thread.cpp", -+ "rtl/tsan_stack_trace.cpp", -+ "rtl/tsan_suppressions.cpp", -+ "rtl/tsan_symbolize.cpp", -+ "rtl/tsan_sync.cpp", -+ "rtl/tsan_vector_clock.cpp", ++ "lib/tsan/rtl/tsan_debugging.cpp", ++ "lib/tsan/rtl/tsan_external.cpp", ++ "lib/tsan/rtl/tsan_fd.cpp", ++ "lib/tsan/rtl/tsan_flags.cpp", ++ "lib/tsan/rtl/tsan_ignoreset.cpp", ++ "lib/tsan/rtl/tsan_interceptors_memintrinsics.cpp", ++ "lib/tsan/rtl/tsan_interceptors_posix.cpp", ++ "lib/tsan/rtl/tsan_interface.cpp", ++ "lib/tsan/rtl/tsan_interface_ann.cpp", ++ "lib/tsan/rtl/tsan_interface_atomic.cpp", ++ "lib/tsan/rtl/tsan_interface_java.cpp", ++ "lib/tsan/rtl/tsan_malloc_mac.cpp", ++ "lib/tsan/rtl/tsan_md5.cpp", ++ "lib/tsan/rtl/tsan_mman.cpp", ++ "lib/tsan/rtl/tsan_mutexset.cpp", ++ "lib/tsan/rtl/tsan_report.cpp", ++ "lib/tsan/rtl/tsan_rtl.cpp", ++ "lib/tsan/rtl/tsan_rtl_access.cpp", ++ "lib/tsan/rtl/tsan_rtl_mutex.cpp", ++ "lib/tsan/rtl/tsan_rtl_proc.cpp", ++ "lib/tsan/rtl/tsan_rtl_report.cpp", ++ "lib/tsan/rtl/tsan_rtl_thread.cpp", ++ "lib/tsan/rtl/tsan_stack_trace.cpp", ++ "lib/tsan/rtl/tsan_suppressions.cpp", ++ "lib/tsan/rtl/tsan_symbolize.cpp", ++ "lib/tsan/rtl/tsan_sync.cpp", ++ "lib/tsan/rtl/tsan_vector_clock.cpp", + + # TSAN_ASM_SOURCES. -+ "rtl/tsan_rtl_amd64.S", ++ "lib/tsan/rtl/tsan_rtl_amd64.S", + + # TSAN_PREINIT_SOURCES. -+ "rtl/tsan_preinit.cpp", ++ "lib/tsan/rtl/tsan_preinit.cpp", + + # Linux sources. -+ "rtl/tsan_platform_linux.cpp", -+ "rtl/tsan_platform_posix.cpp", ++ "lib/tsan/rtl/tsan_platform_linux.cpp", ++ "lib/tsan/rtl/tsan_platform_posix.cpp", + ], + hdrs = [ ++ ":interception_headers", ++ ":sanitizer_impl_headers", + ":tsan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":ubsan_headers", + ], + angled_includes = ["compiler-rt/lib"], + compilation_mode = "bootstrap", @@ -1128,58 +1076,51 @@ index 000000000000..c475c8bc53bc + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", -+ "//compiler-rt/lib/ubsan:RTUbsan", ++ ":RTInterception", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", ++ ":RTUbsan", + ], +) + +ll_library( + name = "clang_rt.tsan_cxx", + srcs = [ -+ "rtl/tsan_new_delete.cpp", ++ "lib/tsan/rtl/tsan_new_delete.cpp", + ], + hdrs = [ ++ ":interception_headers", ++ ":sanitizer_impl_headers", + ":tsan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", -+ "//compiler-rt/lib/ubsan:ubsan_headers", ++ ":ubsan_headers", + ], + compilation_mode = "bootstrap", + compile_flags = ["-msse4.2"], + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ -+ "//compiler-rt/lib/ubsan:RTUbsan_cxx", ++ ":RTUbsan_cxx", + ], +) -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel -new file mode 100644 -index 000000000000..8ad56ad46df6 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/ubsan/BUILD.bazel -@@ -0,0 +1,109 @@ -+load("@rules_ll//ll:defs.bzl", "ll_library") + +filegroup( + name = "ubsan_headers", + srcs = [ -+ "ubsan_checks.inc", -+ "ubsan_diag.h", -+ "ubsan_flags.h", -+ "ubsan_flags.inc", -+ "ubsan_handlers.h", -+ "ubsan_handlers_cxx.h", -+ "ubsan_init.h", -+ "ubsan_interface.inc", -+ "ubsan_monitor.h", -+ "ubsan_platform.h", -+ "ubsan_signals_standalone.h", -+ "ubsan_type_hash.h", -+ "ubsan_value.h", ++ "lib/ubsan/ubsan_checks.inc", ++ "lib/ubsan/ubsan_diag.h", ++ "lib/ubsan/ubsan_flags.h", ++ "lib/ubsan/ubsan_flags.inc", ++ "lib/ubsan/ubsan_handlers.h", ++ "lib/ubsan/ubsan_handlers_cxx.h", ++ "lib/ubsan/ubsan_init.h", ++ "lib/ubsan/ubsan_interface.inc", ++ "lib/ubsan/ubsan_monitor.h", ++ "lib/ubsan/ubsan_platform.h", ++ "lib/ubsan/ubsan_signals_standalone.h", ++ "lib/ubsan/ubsan_type_hash.h", ++ "lib/ubsan/ubsan_value.h", + ], + visibility = ["//visibility:public"], +) @@ -1187,16 +1128,16 @@ index 000000000000..8ad56ad46df6 +ll_library( + name = "RTUbsan", + srcs = [ -+ "ubsan_diag.cpp", -+ "ubsan_flags.cpp", -+ "ubsan_handlers.cpp", -+ "ubsan_init.cpp", -+ "ubsan_monitor.cpp", -+ "ubsan_value.cpp", ++ "lib/ubsan/ubsan_diag.cpp", ++ "lib/ubsan/ubsan_flags.cpp", ++ "lib/ubsan/ubsan_handlers.cpp", ++ "lib/ubsan/ubsan_init.cpp", ++ "lib/ubsan/ubsan_monitor.cpp", ++ "lib/ubsan/ubsan_value.cpp", + ], + hdrs = [ ++ ":sanitizer_impl_headers", + ":ubsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + defines = [ @@ -1209,14 +1150,14 @@ index 000000000000..8ad56ad46df6 +ll_library( + name = "RTUbsan_cxx", + srcs = [ -+ "ubsan_handlers_cxx.cpp", -+ "ubsan_type_hash.cpp", -+ "ubsan_type_hash_itanium.cpp", -+ "ubsan_type_hash_win.cpp", ++ "lib/ubsan/ubsan_handlers_cxx.cpp", ++ "lib/ubsan/ubsan_type_hash.cpp", ++ "lib/ubsan/ubsan_type_hash_itanium.cpp", ++ "lib/ubsan/ubsan_type_hash_win.cpp", + ], + hdrs = [ ++ ":sanitizer_impl_headers", + ":ubsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], @@ -1226,14 +1167,14 @@ index 000000000000..8ad56ad46df6 +ll_library( + name = "RTUbsan_standalone", + srcs = [ -+ "ubsan_diag_standalone.cpp", -+ "ubsan_init_standalone.cpp", -+ "ubsan_signals_standalone.cpp", ++ "lib/ubsan/ubsan_diag_standalone.cpp", ++ "lib/ubsan/ubsan_init_standalone.cpp", ++ "lib/ubsan/ubsan_signals_standalone.cpp", + ], + hdrs = [ ++ ":interception_headers", ++ ":sanitizer_impl_headers", + ":ubsan_headers", -+ "//compiler-rt/lib/interception:interception_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], @@ -1243,23 +1184,23 @@ index 000000000000..8ad56ad46df6 +ll_library( + name = "clang_rt.ubsan_standalone", + srcs = [ -+ "ubsan_init_standalone_preinit.cpp", ++ "lib/ubsan/ubsan_init_standalone_preinit.cpp", + ], + hdrs = [ ++ ":sanitizer_impl_headers", + ":ubsan_headers", -+ "//compiler-rt/lib/sanitizer_common:sanitizer_impl_headers", + ], + compilation_mode = "bootstrap", + includes = ["compiler-rt/lib"], + visibility = ["//visibility:public"], + deps = [ ++ ":RTInterception", ++ ":RTSanitizerCommon", ++ ":RTSanitizerCommonCoverage", ++ ":RTSanitizerCommonLibc", ++ ":RTSanitizerCommonSymbolizer", + ":RTUbsan", + ":RTUbsan_standalone", -+ "//compiler-rt/lib/interception:RTInterception", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommon", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonCoverage", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonLibc", -+ "//compiler-rt/lib/sanitizer_common:RTSanitizerCommonSymbolizer", + ], +) + @@ -1273,11 +1214,12 @@ index 000000000000..8ad56ad46df6 +) diff --git a/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel new file mode 100644 -index 000000000000..21d7510a4697 +index 000000000000..f68af0f8d0f0 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel -@@ -0,0 +1,357 @@ +@@ -0,0 +1,368 @@ +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") ++load("@bazel_skylib//rules:copy_file.bzl", "copy_file") +load("@rules_ll//ll:defs.bzl", "ll_library") + +STD_PARTITIONS = [ @@ -1406,6 +1348,12 @@ index 000000000000..21d7510a4697 + for file in LIBCXX_MODULE_STD_INCLUDE_SOURCES_FILES +]) + ++copy_file( ++ name = "__assertion_handler_gen", ++ src = "vendor/llvm/default_assertion_handler.in", ++ out = "include/__assertion_handler", ++) ++ +expand_template( + name = "std.cppm", + out = "modules/std.cppm", @@ -1449,6 +1397,8 @@ index 000000000000..21d7510a4697 + "#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION": NO, + "#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS": NO, + "#cmakedefine _LIBCPP_HAS_NO_STD_MODULES": NO, ++ "#cmakedefine _LIBCPP_HAS_NO_TIME_ZONE_DATABASE": NO, ++ "#cmakedefine _LIBCPP_INSTRUMENTED_WITH_ASAN": NO, + + # PSTL backends. + "#cmakedefine _LIBCPP_PSTL_CPU_BACKEND_SERIAL": "#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL", @@ -1458,8 +1408,7 @@ index 000000000000..21d7510a4697 + # Hardening. + # TODO: Evaluate performance impact of this. If it isn't noticeable for + # most use-cases, enable it. -+ "#cmakedefine01 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT": "#define _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT 0", -+ "#cmakedefine01 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT": "#define _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT 0", ++ "#cmakedefine _LIBCPP_HARDENING_MODE_DEFAULT @_LIBCPP_HARDENING_MODE_DEFAULT@": "#define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE", + "@_LIBCPP_ABI_DEFINES@": NO, + "@_LIBCPP_EXTRA_SITE_DEFINES@": NO, + }, @@ -1471,6 +1420,7 @@ index 000000000000..21d7510a4697 + srcs = glob([ + "include/**/*", + ]) + [ ++ ":__assertion_handler_gen", + ":__config_site_gen", + ":module_modulemap_gen", + ], @@ -1489,8 +1439,10 @@ index 000000000000..21d7510a4697 + "src/algorithm.cpp", + "src/any.cpp", + "src/bind.cpp", ++ "src/call_once.cpp", + "src/charconv.cpp", + "src/chrono.cpp", ++ "src/error_category.cpp", + "src/exception.cpp", + "src/filesystem/filesystem_clock.cpp", + "src/filesystem/filesystem_error.cpp", diff --git a/third-party-overlays/clr.BUILD.bazel b/third-party-overlays/clr.BUILD.bazel index 4b7b85fb..713859ed 100644 --- a/third-party-overlays/clr.BUILD.bazel +++ b/third-party-overlays/clr.BUILD.bazel @@ -124,7 +124,7 @@ ll_library( ":amdocl_headers", "@rocr//:libhsa-runtime64", "@rocr//:hsa_headers", - "@comgr//:amd_comgr", + "@llvm-project-rocm//:amd_comgr", ], compile_flags = [ "-std=c++17", @@ -198,7 +198,7 @@ ll_library( ":CL2.2", ":amdocl_headers", ":rocclr", - "@comgr//:amd_comgr", + "@llvm-project-rocm//:amd_comgr", "@hip//:hip_headers", "@rocr//:libhsa-runtime64", ] + select({ diff --git a/third-party-overlays/comgr.BUILD.bazel b/third-party-overlays/comgr.BUILD.bazel deleted file mode 100644 index f399c2e0..00000000 --- a/third-party-overlays/comgr.BUILD.bazel +++ /dev/null @@ -1,256 +0,0 @@ -"Build file for ROCm-CompilerSupport." - -load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") -load("@bazel_skylib//rules:expand_template.bzl", "expand_template") -load("@rules_ll//ll:defs.bzl", "ll_library") -load("@rules_ll//third-party-overlays:defs.bzl", "opencl_pch") - -bool_flag( - name = "shared_amd_comgr", - build_setting_default = False, -) - -config_setting( - name = "shared", - flag_values = {":shared_amd_comgr": "true"}, -) - -expand_template( - name = "amd_comgr_h_gen", - out = "comgr/amd_comgr/amd_comgr.h", - substitutions = { - "@amd_comgr_VERSION_MAJOR@": "2", - "@amd_comgr_VERSION_MINOR@": "6", - "@amd_comgr_NAME@": "amd_comgr", - }, - template = "lib/comgr/include/amd_comgr.h.in", -) - -# Can't use ll_binary for now, as our transitions break. -cc_binary( - name = "bc2h", - srcs = ["lib/comgr/bc2h.c"], -) - -AMD_DEVICE_LIBS_TARGETS = [ - "oclc_abi_version_400", - "oclc_abi_version_500", - "oclc_correctly_rounded_sqrt_off", - "oclc_correctly_rounded_sqrt_on", - "oclc_daz_opt_off", - "oclc_daz_opt_on", - "oclc_finite_only_off", - "oclc_finite_only_on", - "oclc_isa_version_1010", - "oclc_isa_version_1011", - "oclc_isa_version_1012", - "oclc_isa_version_1013", - "oclc_isa_version_1030", - "oclc_isa_version_1031", - "oclc_isa_version_1032", - "oclc_isa_version_1033", - "oclc_isa_version_1034", - "oclc_isa_version_1035", - "oclc_isa_version_1036", - "oclc_isa_version_1100", - "oclc_isa_version_1101", - "oclc_isa_version_1102", - "oclc_isa_version_1103", - "oclc_isa_version_600", - "oclc_isa_version_601", - "oclc_isa_version_602", - "oclc_isa_version_700", - "oclc_isa_version_701", - "oclc_isa_version_702", - "oclc_isa_version_703", - "oclc_isa_version_704", - "oclc_isa_version_705", - "oclc_isa_version_801", - "oclc_isa_version_802", - "oclc_isa_version_803", - "oclc_isa_version_805", - "oclc_isa_version_810", - "oclc_isa_version_900", - "oclc_isa_version_902", - "oclc_isa_version_904", - "oclc_isa_version_906", - "oclc_isa_version_908", - "oclc_isa_version_909", - "oclc_isa_version_90a", - "oclc_isa_version_90c", - "oclc_isa_version_940", - "oclc_unsafe_math_off", - "oclc_unsafe_math_on", - "oclc_wavefrontsize64_off", - "oclc_wavefrontsize64_on", - "ocml", - "ockl", - "opencl", - "hip", - "asanrtl", -] - -# TODO: It is unfortunate that we can't really build these in parallel with the -# current build files. The rocm-device-libs block this target. -genrule( - name = "device_lib_headers_gen", - srcs = ["@rocm-device-libs//:rocm-device-libs"], - tools = [":bc2h"], - cmd = """ -for f in $(SRCS) -do - base=$$(basename $$f) - without_extension=$${base%.*} - $(location :bc2h) $$f $(RULEDIR)/comgr/internal/$${without_extension}.inc "$${without_extension}_lib" -done - """, - outs = [ - "comgr/internal/{}.inc".format(name) - for name in AMD_DEVICE_LIBS_TARGETS - ], -) - -genrule( - name = "libraries_inc_gen", - srcs = [":device_lib_headers_gen"], - cmd = """ -for f in $(SRCS) -do - echo '#include "'"$$(basename $$f)"'"' >> $(OUTS) -done - """, - outs = ["comgr/internal/libraries.inc"], -) - -genrule( - name = "libraries_defs_inc_gen", - srcs = [":device_lib_headers_gen"], - cmd = """ -cat <> $(OUTS) -#ifndef AMD_DEVICE_LIBS_TARGET -#define AMD_DEVICE_LIBS_TARGET(t) -#endif -#ifndef AMD_DEVICE_LIBS_GFXIP -#define AMD_DEVICE_LIBS_GFXIP(t, g) -#endif -#ifndef AMD_DEVICE_LIBS_FUNCTION -#define AMD_DEVICE_LIBS_FUNCTION(t, f) -#endif - -EOF - -for f in $(SRCS) -do - base=$$(basename $$f) - without_extension=$${base%.*} - echo "AMD_DEVICE_LIBS_TARGET("$$without_extension")" >> $(OUTS) - - if [[ $$without_extension == oclc_isa_version_* ]] - then - isa_version=$${without_extension##oclc_isa_version_} - echo 'AMD_DEVICE_LIBS_GFXIP('$$without_extension', "'$$isa_version'")' >> $(OUTS) - fi - - if [[ $$without_extension == oclc_*_on ]] - then - cut_oclc_prefix=$${without_extension##oclc_} - cut_on_suffix=$${cut_oclc_prefix%_on} - echo "AMD_DEVICE_LIBS_FUNCTION("$$without_extension", "$$cut_on_suffix")" >> $(OUTS) - fi - -done - -cat <> $(OUTS) - -#undef AMD_DEVICE_LIBS_TARGET -#undef AMD_DEVICE_LIBS_GFXIP -#undef AMD_DEVICE_LIBS_FUNCTION -EOF - """, - outs = ["comgr/internal/libraries_defs.inc"], -) - -opencl_pch( - name = "opencl_1_2_pch_gen", - cl_std = "1.2", -) - -genrule( - name = "opencl_1_2_inc_gen", - tools = [":bc2h"], - srcs = [":opencl_1_2_pch_gen"], - cmd = "$(location :bc2h) $(SRCS) $(OUTS) opencl1_2_c", - outs = ["comgr/internal/opencl1.2-c.inc"], -) - -opencl_pch( - name = "opencl_2_0_pch_gen", - cl_std = "2.0", -) - -genrule( - name = "opencl_2_0_inc_gen", - tools = [":bc2h"], - srcs = [":opencl_2_0_pch_gen"], - cmd = "$(location :bc2h) $(SRCS) $(OUTS) opencl2_0_c", - outs = ["comgr/internal/opencl2.0-c.inc"], -) - -ll_library( - name = "amd_comgr", - # The only externally visible entrypoint to this target is the generated - # amd_comgr.h header. - exposed_includes = ["$(GENERATED)/comgr"], - exposed_hdrs = [":amd_comgr_h_gen"], - includes = [ - "lib/comgr/src", - "$(GENERATED)/comgr/internal", - "$(GENERATED)/comgr/amd_comgr", - ], - compile_flags = [ - "-std=c++17", - "-O3", # Usually inherits O2 from the llvm build. Let's just use O3. - "-fno-rtti", - "-Wall", - "-Wno-attributes", - "-fms-extensions", - "-fvisibility=hidden", - "-fno-strict-aliasing", - ], - hdrs = glob([ - "lib/comgr/src/*.h", - "lib/comgr/src/time-stat/*.h", - "lib/comgr/src/comgr-isa-metadata.def", - ]) + [ - ":libraries_defs_inc_gen", - ":libraries_inc_gen", - ":opencl_1_2_inc_gen", - ":opencl_2_0_inc_gen", - ":device_lib_headers_gen", - ], - srcs = [ - "lib/comgr/src/comgr-compiler.cpp", - "lib/comgr/src/comgr.cpp", - "lib/comgr/src/comgr-device-libs.cpp", - "lib/comgr/src/comgr-disassembly.cpp", - "lib/comgr/src/comgr-elfdump.cpp", - "lib/comgr/src/comgr-env.cpp", - "lib/comgr/src/comgr-metadata.cpp", - "lib/comgr/src/comgr-objdump.cpp", - "lib/comgr/src/comgr-signal.cpp", - "lib/comgr/src/comgr-symbol.cpp", - "lib/comgr/src/comgr-symbolizer.cpp", - "lib/comgr/src/time-stat/time-stat.cpp", - ], - depends_on_llvm = 1, - defines = ["AMD_COMGR_BUILD"], - visibility = ["//visibility:public"], - emit = select({ - ":shared": ["shared_object"], - "//conditions:default": ["archive"], - }), - shared_object_link_flags = select({ - ":shared": ["--no-undefined"], - "//conditions:default": [], - }), -) diff --git a/third-party-overlays/defs.bzl b/third-party-overlays/defs.bzl index 0db0c684..581fa504 100644 --- a/third-party-overlays/defs.bzl +++ b/third-party-overlays/defs.bzl @@ -65,12 +65,8 @@ def _opencl_bitcode_library_impl(ctx): args.add_all( CLANG_OCL_FLAGS + [ - "-c", "-emit-llvm", - "-Xclang", - "-mlink-builtin-bitcode", - "-Xclang", - ctx.file.irif, + "-c", file, "-o", intermediary_bitcode, @@ -85,7 +81,7 @@ def _opencl_bitcode_library_impl(ctx): inputs = [file] + ctx.files.hdrs, executable = toolchain.cpp_driver, arguments = [args], - tools = [ctx.file.irif] + toolchain.builtin_includes, + tools = toolchain.builtin_includes, use_default_shell_env = False, env = compile_object_environment(ctx), ) @@ -177,15 +173,11 @@ opencl_bitcode_library = rule( default = "@rules_ll//ll:current_ll_toolchain_configuration", ), "compilation_mode": attr.string(default = "cpp"), - "irif": attr.label( - allow_single_file = True, - default = "@rocm-device-libs//:irif", - ), "prepare_builtins": attr.label( allow_single_file = True, executable = True, cfg = transition_to_bootstrap, - default = "@rocm-device-libs//:prepare-builtins", + default = "@llvm-project-rocm//:prepare-builtins", ), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", diff --git a/third-party-overlays/llvm-project-rocm.BUILD.bazel b/third-party-overlays/llvm-project-rocm.BUILD.bazel new file mode 100644 index 00000000..c90d00ff --- /dev/null +++ b/third-party-overlays/llvm-project-rocm.BUILD.bazel @@ -0,0 +1,417 @@ +"Build file for llvm-project-rocm." + +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_ll//ll:defs.bzl", "ll_binary", "ll_library") +load("@rules_ll//third-party-overlays:defs.bzl", "opencl_bitcode_library", "opencl_pch") + +bool_flag( + name = "shared_amd_comgr", + build_setting_default = False, +) + +config_setting( + name = "shared", + flag_values = {":shared_amd_comgr": "true"}, +) + +expand_template( + name = "amd_comgr_h_gen", + out = "amd/comgr/amd_comgr/amd_comgr.h", + substitutions = { + "@amd_comgr_VERSION_MAJOR@": "2", + "@amd_comgr_VERSION_MINOR@": "7", + "@amd_comgr_NAME@": "amd_comgr", + }, + template = "amd/comgr/include/amd_comgr.h.in", +) + +# Can't use ll_binary for now, as our transitions break. +cc_binary( + name = "bc2h", + srcs = ["lib/comgr/bc2h.c"], +) + +AMD_DEVICE_LIBS_TARGETS = [ + "oclc_abi_version_400", + "oclc_abi_version_500", + "oclc_correctly_rounded_sqrt_off", + "oclc_correctly_rounded_sqrt_on", + "oclc_daz_opt_off", + "oclc_daz_opt_on", + "oclc_finite_only_off", + "oclc_finite_only_on", + "oclc_isa_version_1010", + "oclc_isa_version_1011", + "oclc_isa_version_1012", + "oclc_isa_version_1013", + "oclc_isa_version_1030", + "oclc_isa_version_1031", + "oclc_isa_version_1032", + "oclc_isa_version_1033", + "oclc_isa_version_1034", + "oclc_isa_version_1035", + "oclc_isa_version_1036", + "oclc_isa_version_1100", + "oclc_isa_version_1101", + "oclc_isa_version_1102", + "oclc_isa_version_1103", + "oclc_isa_version_600", + "oclc_isa_version_601", + "oclc_isa_version_602", + "oclc_isa_version_700", + "oclc_isa_version_701", + "oclc_isa_version_702", + "oclc_isa_version_703", + "oclc_isa_version_704", + "oclc_isa_version_705", + "oclc_isa_version_801", + "oclc_isa_version_802", + "oclc_isa_version_803", + "oclc_isa_version_805", + "oclc_isa_version_810", + "oclc_isa_version_900", + "oclc_isa_version_902", + "oclc_isa_version_904", + "oclc_isa_version_906", + "oclc_isa_version_908", + "oclc_isa_version_909", + "oclc_isa_version_90a", + "oclc_isa_version_90c", + "oclc_isa_version_940", + "oclc_unsafe_math_off", + "oclc_unsafe_math_on", + "oclc_wavefrontsize64_off", + "oclc_wavefrontsize64_on", + "ocml", + "ockl", + "opencl", + "hip", + "asanrtl", +] + +# TODO: It is unfortunate that we can't really build these in parallel with the +# current build files. The rocm-device-libs block this target. +genrule( + name = "device_lib_headers_gen", + srcs = [":rocm-device-libs"], + tools = [":bc2h"], + cmd = """ +for f in $(SRCS) +do + base=$$(basename $$f) + without_extension=$${base%.*} + $(location :bc2h) $$f $(RULEDIR)/amd/comgr/internal/$${without_extension}.inc "$${without_extension}_lib" +done + """, + outs = [ + "amd/comgr/internal/{}.inc".format(name) + for name in AMD_DEVICE_LIBS_TARGETS + ], +) + +genrule( + name = "libraries_inc_gen", + srcs = [":device_lib_headers_gen"], + cmd = """ +for f in $(SRCS) +do + echo '#include "'"$$(basename $$f)"'"' >> $(OUTS) +done + """, + outs = ["amd/comgr/internal/libraries.inc"], +) + +genrule( + name = "libraries_defs_inc_gen", + srcs = [":device_lib_headers_gen"], + cmd = """ +cat <> $(OUTS) +#ifndef AMD_DEVICE_LIBS_TARGET +#define AMD_DEVICE_LIBS_TARGET(t) +#endif +#ifndef AMD_DEVICE_LIBS_GFXIP +#define AMD_DEVICE_LIBS_GFXIP(t, g) +#endif +#ifndef AMD_DEVICE_LIBS_FUNCTION +#define AMD_DEVICE_LIBS_FUNCTION(t, f) +#endif + +EOF + +for f in $(SRCS) +do + base=$$(basename $$f) + without_extension=$${base%.*} + echo "AMD_DEVICE_LIBS_TARGET("$$without_extension")" >> $(OUTS) + + if [[ $$without_extension == oclc_isa_version_* ]] + then + isa_version=$${without_extension##oclc_isa_version_} + echo 'AMD_DEVICE_LIBS_GFXIP('$$without_extension', "'$$isa_version'")' >> $(OUTS) + fi + + if [[ $$without_extension == oclc_*_on ]] + then + cut_oclc_prefix=$${without_extension##oclc_} + cut_on_suffix=$${cut_oclc_prefix%_on} + echo "AMD_DEVICE_LIBS_FUNCTION("$$without_extension", "$$cut_on_suffix")" >> $(OUTS) + fi + +done + +cat <> $(OUTS) + +#undef AMD_DEVICE_LIBS_TARGET +#undef AMD_DEVICE_LIBS_GFXIP +#undef AMD_DEVICE_LIBS_FUNCTION +EOF + """, + outs = ["amd/comgr/internal/libraries_defs.inc"], +) + +opencl_pch( + name = "opencl_1_2_pch_gen", + cl_std = "1.2", +) + +genrule( + name = "opencl_1_2_inc_gen", + tools = [":bc2h"], + srcs = [":opencl_1_2_pch_gen"], + cmd = "$(location :bc2h) $(SRCS) $(OUTS) opencl1_2_c", + outs = ["amd/comgr/internal/opencl1.2-c.inc"], +) + +opencl_pch( + name = "opencl_2_0_pch_gen", + cl_std = "2.0", +) + +genrule( + name = "opencl_2_0_inc_gen", + tools = [":bc2h"], + srcs = [":opencl_2_0_pch_gen"], + cmd = "$(location :bc2h) $(SRCS) $(OUTS) opencl2_0_c", + outs = ["amd/comgr/internal/opencl2.0-c.inc"], +) + +ll_library( + name = "amd_comgr", + # The only externally visible entrypoint to this target is the generated + # amd_comgr.h header. + exposed_includes = ["$(GENERATED)/amd/comgr"], + exposed_hdrs = [":amd_comgr_h_gen"], + includes = [ + "amd/comgr/src", + "$(GENERATED)/amd/comgr/internal", + "$(GENERATED)/amd/comgr/amd_comgr", + ], + compile_flags = [ + "-std=c++17", + "-O3", # Usually inherits O2 from the llvm build. Let's just use O3. + "-fno-rtti", + "-Wall", + "-Wno-attributes", + "-fms-extensions", + "-fvisibility=hidden", + "-fno-strict-aliasing", + ], + hdrs = glob([ + "amd/comgr/src/*.h", + "amd/comgr/src/time-stat/*.h", + "amd/comgr/src/comgr-isa-metadata.def", + ]) + [ + ":libraries_defs_inc_gen", + ":libraries_inc_gen", + ":opencl_1_2_inc_gen", + ":opencl_2_0_inc_gen", + ":device_lib_headers_gen", + ], + srcs = [ + "amd/comgr/src/comgr-compiler.cpp", + "amd/comgr/src/comgr.cpp", + "amd/comgr/src/comgr-device-libs.cpp", + "amd/comgr/src/comgr-disassembly.cpp", + "amd/comgr/src/comgr-elfdump.cpp", + "amd/comgr/src/comgr-env.cpp", + "amd/comgr/src/comgr-metadata.cpp", + "amd/comgr/src/comgr-objdump.cpp", + "amd/comgr/src/comgr-signal.cpp", + "amd/comgr/src/comgr-symbol.cpp", + "amd/comgr/src/comgr-symbolizer.cpp", + "amd/comgr/src/time-stat/time-stat.cpp", + ], + depends_on_llvm = 1, + defines = ["AMD_COMGR_BUILD"], + visibility = ["//visibility:public"], + emit = select({ + ":shared": ["shared_object"], + "//conditions:default": ["archive"], + }), + shared_object_link_flags = select({ + ":shared": ["--no-undefined"], + "//conditions:default": [], + }), +) + +# All artifacts from ROCm-Device-Libs are bitcode files. We need these to be in +# a directory "amdgcn/bitcode". The output layout should look like this: +# +# amdgcn/bitcode/asanrtl.bc +# amdgcn/bitcode/hip.bc +# amdgcn/bitcode/oclc_<...>.bc +# amdgcn/bitcode/ocml.bc +# amdgcn/bitcode/opencl.bc +# +# Then we can make them available to clang via the --rocm-device-lib-path flag. +# None of the headers in this repository are exported to downstream targets. + +ll_binary( + name = "prepare-builtins", + srcs = ["amd/device-libs/utils/prepare-builtins/prepare-builtins.cpp"], + compile_flags = ["-std=c++17"], + depends_on_llvm = 1, +) + +OCLC_NAMES = [ + "abi_version_400", + "abi_version_500", + "correctly_rounded_sqrt_off", + "correctly_rounded_sqrt_on", + "daz_opt_off", + "daz_opt_on", + "finite_only_off", + "finite_only_on", + "isa_version_1010", + "isa_version_1011", + "isa_version_1012", + "isa_version_1013", + "isa_version_1030", + "isa_version_1031", + "isa_version_1032", + "isa_version_1033", + "isa_version_1034", + "isa_version_1035", + "isa_version_1036", + "isa_version_1100", + "isa_version_1101", + "isa_version_1102", + "isa_version_1103", + "isa_version_1150", + "isa_version_1151", + "isa_version_600", + "isa_version_601", + "isa_version_602", + "isa_version_700", + "isa_version_701", + "isa_version_702", + "isa_version_703", + "isa_version_704", + "isa_version_705", + "isa_version_801", + "isa_version_802", + "isa_version_803", + "isa_version_805", + "isa_version_810", + "isa_version_900", + "isa_version_902", + "isa_version_904", + "isa_version_906", + "isa_version_908", + "isa_version_909", + "isa_version_90a", + "isa_version_90c", + "isa_version_940", + "isa_version_941", + "isa_version_942", + "unsafe_math_off", + "unsafe_math_on", + "wavefrontsize64_off", + "wavefrontsize64_on", +] + +[ + opencl_bitcode_library( + name = "oclc_{}".format(name), + hdrs = ["amd/device-libs/oclc/inc/oclc.h"], + srcs = ["amd/device-libs/oclc/src/{}.cl".format(name)], + ) + for name in OCLC_NAMES +] + +filegroup( + name = "oclc", + srcs = [":oclc_{}".format(name) for name in OCLC_NAMES], +) + +opencl_bitcode_library( + name = "ocml", + hdrs = glob(["amd/device-libs/ocml/src/*.h"]) + [ + "amd/device-libs/ocml/inc/ocml.h", + "amd/device-libs/irif/inc/irif.h", + "amd/device-libs/oclc/inc/oclc.h", + ], + srcs = glob(["amd/device-libs/ocml/src/*.cl"]), +) + +opencl_bitcode_library( + name = "ockl", + hdrs = glob(["amd/device-libs/ockl/inc/*.h"]) + [ + "amd/device-libs/oclc/inc/oclc.h", + "amd/device-libs/irif/inc/irif.h", + "amd/device-libs/ockl/src/ockl_priv.h", + ], + srcs = glob(["amd/device-libs/ockl/src/*.cl"]), + bitcode_srcs = [ + "amd/device-libs/ockl/src/wgscratch.ll", + "amd/device-libs/ockl/src/base-image-intrinsics.ll", + "amd/device-libs/ockl/src/extended-image-intrinsics.ll", + "amd/device-libs/ockl/src/buffer-intrinsics.ll", + ], +) + +opencl_bitcode_library( + name = "opencl", + hdrs = glob([ + "amd/device-libs/ockl/inc/*.h", + "amd/device-libs/opencl/src/*/*.h", + ]) + [ + "amd/device-libs/oclc/inc/oclc.h", + "amd/device-libs/irif/inc/irif.h", + "amd/device-libs/ocml/inc/ocml.h", + ], + srcs = glob(["amd/device-libs/opencl/src/*/*.cl"]), +) + +opencl_bitcode_library( + name = "hip", + hdrs = [ + "amd/device-libs/ockl/inc/ockl.h", + "amd/device-libs/irif/inc/irif.h", + ], + srcs = ["amd/device-libs/hip/src/empty.cl"], +) + +opencl_bitcode_library( + name = "asanrtl", + hdrs = glob(["amd/device-libs/asanrtl/inc/*.h"]) + [ + "amd/device-libs/ockl/inc/ockl.h", + "amd/device-libs/oclc/inc/oclc.h", + "amd/device-libs/irif/inc/irif.h", + ], + srcs = glob(["amd/device-libs/asanrtl/src/*.cl"]), +) + +filegroup( + name = "rocm-device-libs", + srcs = [ + ":asanrtl", + ":ockl", + ":hip", + ":oclc", + ":ocml", + ":opencl", + ], + visibility = ["//visibility:public"], +) diff --git a/third-party-overlays/rocclr_config.bzl b/third-party-overlays/rocclr_config.bzl index c4bc9048..6666df8d 100644 --- a/third-party-overlays/rocclr_config.bzl +++ b/third-party-overlays/rocclr_config.bzl @@ -37,6 +37,6 @@ ROCCLR_DEFINES = [ "CL_USE_DEPRECATED_OPENCL_1_2_APIS", "CL_USE_DEPRECATED_OPENCL_2_0_APIS", ] + select({ - "@comgr//:shared": ["COMGR_DYN_DLL"], + "@llvm-project-rocm//:shared": ["COMGR_DYN_DLL"], "//conditions:default": [], }) diff --git a/third-party-overlays/rocm-device-libs.BUILD.bazel b/third-party-overlays/rocm-device-libs.BUILD.bazel deleted file mode 100644 index 6e85f809..00000000 --- a/third-party-overlays/rocm-device-libs.BUILD.bazel +++ /dev/null @@ -1,169 +0,0 @@ -"Build file for the ROCm-Device-Libs." - -load("@rules_ll//ll:defs.bzl", "ll_binary") -load("@rules_ll//third-party-overlays:defs.bzl", "opencl_bitcode_library") - -# All artifacts from ROCm-Device-Libs are bitcode files. We need these to be in -# a directory "amdgcn/bitcode". The output layout should look like this: -# -# amdgcn/bitcode/asanrtl.bc -# amdgcn/bitcode/hip.bc -# amdgcn/bitcode/oclc_<...>.bc -# amdgcn/bitcode/ocml.bc -# amdgcn/bitcode/opencl.bc -# -# Then we can make them available to clang via the --rocm-device-lib-path flag. -# None of the headers in this repository are exported to downstream targets. - -ll_binary( - name = "prepare-builtins", - srcs = ["utils/prepare-builtins/prepare-builtins.cpp"], - compile_flags = ["-std=c++17"], - depends_on_llvm = 1, -) - -genrule( - name = "irif", - srcs = [ - "irif/src/base-image-intrinsics.ll", - "irif/src/extended-image-intrinsics.ll", - ], - outs = ["irif.bc"], - cmd = "$(location @llvm-project//llvm:llvm-link) $(SRCS) -o $(OUTS)", - tools = ["@llvm-project//llvm:llvm-link"], - visibility = ["//visibility:__pkg__"], -) - -OCLC_NAMES = [ - "abi_version_400", - "abi_version_500", - "correctly_rounded_sqrt_off", - "correctly_rounded_sqrt_on", - "daz_opt_off", - "daz_opt_on", - "finite_only_off", - "finite_only_on", - "isa_version_1010", - "isa_version_1011", - "isa_version_1012", - "isa_version_1013", - "isa_version_1030", - "isa_version_1031", - "isa_version_1032", - "isa_version_1033", - "isa_version_1034", - "isa_version_1035", - "isa_version_1036", - "isa_version_1100", - "isa_version_1101", - "isa_version_1102", - "isa_version_1103", - "isa_version_600", - "isa_version_601", - "isa_version_602", - "isa_version_700", - "isa_version_701", - "isa_version_702", - "isa_version_703", - "isa_version_704", - "isa_version_705", - "isa_version_801", - "isa_version_802", - "isa_version_803", - "isa_version_805", - "isa_version_810", - "isa_version_900", - "isa_version_902", - "isa_version_904", - "isa_version_906", - "isa_version_908", - "isa_version_909", - "isa_version_90a", - "isa_version_90c", - "isa_version_940", - "isa_version_941", - "isa_version_942", - "unsafe_math_off", - "unsafe_math_on", - "wavefrontsize64_off", - "wavefrontsize64_on", -] - -[ - opencl_bitcode_library( - name = "oclc_{}".format(name), - hdrs = ["oclc/inc/oclc.h"], - srcs = ["oclc/src/{}.cl".format(name)], - ) - for name in OCLC_NAMES -] - -filegroup( - name = "oclc", - srcs = [":oclc_{}".format(name) for name in OCLC_NAMES], -) - -opencl_bitcode_library( - name = "ocml", - hdrs = glob(["ocml/src/*.h"]) + [ - "ocml/inc/ocml.h", - "irif/inc/irif.h", - "oclc/inc/oclc.h", - ], - srcs = glob(["ocml/src/*.cl"]), -) - -opencl_bitcode_library( - name = "ockl", - hdrs = glob(["ockl/inc/*.h"]) + [ - "oclc/inc/oclc.h", - "irif/inc/irif.h", - ], - srcs = glob(["ockl/src/*.cl"]), - bitcode_srcs = ["ockl/src/wgscratch.ll"], -) - -opencl_bitcode_library( - name = "opencl", - hdrs = glob([ - "ockl/inc/*.h", - "opencl/src/*/*.h", - ]) + [ - "oclc/inc/oclc.h", - "irif/inc/irif.h", - "ocml/inc/ocml.h", - ], - srcs = glob(["opencl/src/*/*.cl"]), -) - -opencl_bitcode_library( - name = "hip", - hdrs = [ - "ockl/inc/ockl.h", - "irif/inc/irif.h", - ], - srcs = ["hip/src/atomic_fence.cl"], -) - -opencl_bitcode_library( - name = "asanrtl", - hdrs = glob(["asanrtl/inc/*.h"]) + [ - "ockl/inc/ockl.h", - "oclc/inc/oclc.h", - "irif/inc/irif.h", - ], - srcs = glob(["asanrtl/src/*.cl"]), -) - -filegroup( - name = "rocm-device-libs", - srcs = [ - ":asanrtl", - ":ockl", - ":hip", - ":oclc", - ":ocml", - ":opencl", - ], - visibility = ["//visibility:public"], -)