gn build: Add hwasan_preinit.cpp to hwasan static library to match CMake.

Reviewers: aeubanks

Reviewed By: aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/134942
This commit is contained in:
Peter Collingbourne 2025-04-08 16:14:19 -07:00 committed by GitHub
parent 0428252db3
commit 93096bf830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,6 +88,13 @@ source_set("cxx_sources") {
sources = [ "hwasan_new_delete.cpp" ]
}
source_set("preinit_sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
defines = [ "HWASAN_WITH_INTERCEPTORS=1" ]
sources = [ "hwasan_preinit.cpp" ]
}
static_library("hwasan_static") {
output_dir = crt_current_out_dir
output_name = "clang_rt.$hwasan_name$crt_current_target_suffix"
@ -97,7 +104,10 @@ static_library("hwasan_static") {
"//llvm/utils/gn/build:thin_archive",
]
configs += [ "//llvm/utils/gn/build:crt_code" ]
deps = [ ":sources" ]
deps = [
":preinit_sources",
":sources",
]
}
static_library("hwasan_cxx") {
@ -138,15 +148,15 @@ static_library("hwasan_preinit") {
"//llvm/utils/gn/build:thin_archive",
]
configs += [ "//llvm/utils/gn/build:crt_code" ]
sources = [ "hwasan_preinit.cpp" ]
deps = [ ":preinit_sources" ]
}
group("hwasan") {
deps = [
":hwasan_cxx",
":hwasan_preinit",
":hwasan_shared",
":hwasan_static",
":hwasan_cxx",
":version_script",
]
}