Skip to content

Commit

Permalink
Add dylibs to the lib target so that santizers work properly on macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
timbess committed Feb 17, 2024
1 parent 05f0bc1 commit 4010aff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions toolchain/BUILD.llvm_repo
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ filegroup(
[
"lib/**/lib*.a",
"lib/clang/*/lib/**/*.a",
"lib/clang/*/lib/**/*.dylib",
# clang_rt.*.o supply crtbegin and crtend sections.
"lib/**/clang_rt.*.o",
],
Expand All @@ -72,9 +73,9 @@ filegroup(
"lib/liblld*.a",
],
),
# Do not include the .dylib files in the linker sandbox because they will
# not be available at runtime. Any library linked from the toolchain should
# be linked statically.
# Include the .dylib files in the linker sandbox even though they will
# not be available at runtime to allow sanitizers to work locally.
# Any library linked from the toolchain to be released should be linked statically.
)

filegroup(
Expand Down
3 changes: 3 additions & 0 deletions toolchain/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ def cc_toolchain_config(
"-L{}/usr/lib".format(sysroot_path),
"-lc++",
"-lc++abi",
"-Bstatic",
"-lunwind",
"-Bdynamic",
])

# Let's provide the path to the toolchain library directory
Expand Down

0 comments on commit 4010aff

Please sign in to comment.