This is an archive of the discontinued LLVM Phabricator instance.

[gn] Add check-lsan target for Mac
ClosedPublic

Authored by lgrey on Jun 23 2023, 10:58 AM.

Details

Summary

Only supports ASAN mode right now. Standalone requires a some more plumbing so it will be a follow-up.

Mac-only but I suspect this will be fine on Linux also since it's based on the check-asan file, will follow up after testing.

Diff Detail

Event Timeline

lgrey created this revision.Jun 23 2023, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 10:58 AM
Herald added a subscriber: Enna1. · View Herald Transcript
lgrey requested review of this revision.Jun 23 2023, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 10:58 AM
thakis accepted this revision.Jun 25 2023, 11:41 AM

Cool!

llvm/utils/gn/build/toolchain/target_flags.gni
57

iOS above also sets target_ldflags, don't we need that for mac? (If not, why not?)

Can we share code with the iOS path?

llvm/utils/gn/secondary/BUILD.gn
28

You add this here in the linux or win or amc branch, but currently i'll only have an effect on mac due to supported_toolchains being non-empty only on mac, right? (i'm wondering if things will start failing on http://45.33.8.238/ once this goes in, but I think it should be fine?)

llvm/utils/gn/secondary/compiler-rt/test/lsan/BUILD.gn
61

i think we don't do the "leading subdir for local vars" think in llvm's gn files.

This revision is now accepted and ready to land.Jun 25 2023, 11:41 AM
lgrey updated this revision to Diff 537497.Jul 5 2023, 2:24 PM
lgrey marked 2 inline comments as done.

Combine Mac and iOS target flags + light cleanup

llvm/utils/gn/build/toolchain/target_flags.gni
57

I didn't add them because it just doubled them up (https://github.com/llvm/llvm-project/blob/main/llvm/utils/gn/secondary/compiler-rt/test/test.gni#L13) but it probably can't hurt!

Had Mac as a separate clause to reduce nesting and I wasn't sure if sharing was what we wanted here. Now combined.

llvm/utils/gn/secondary/BUILD.gn
28

Ooh good catch. Done.

This revision was automatically updated to reflect the committed changes.