-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch LLVM/Clang to support memtag-stack
Previously, we pypassed the clang flag `-fsanitize=memtag-stack` so that `m libc` was able to build with these two CLs (aosp/3261733, aosp/3264014). But just found out today that this is not enough: 1. `m libbase` was still falling back due to clang flag like this: `-fsanitize=integer,integer,memtag-stack` 2. There are also some other targets depending on this flag (see example: https://paste.googleplex.com/4516018109284352) This CL patched this github CL (http://shortn/_QQURhHpCQy) into reclient's input processor, so that re-client officially supports this memtag-stack clang flag. Test: abtd run: 1) caiman_fullmte_userdebug 8 fallbacks (http://shortn/_yy6YSVV0Cf), 2) kiyomi_fullmte-userdebug 8 fallbacks (http://shortn/_5UJCZ6PSjS) Bug: b/371029823 Change-Id: I71651b00c27c0595a73ec1eb182277c55eaf929b GitOrigin-RevId: 4f4b37ac14617145401b77709dda9738ab10aaf1
- Loading branch information
1 parent
609ddf9
commit e7f5533
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
third_party/patches/llvm/llvm-delay-sanitizer-args-parsing.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp | ||
index ca992528ac2e..96695ef5b562 100644 | ||
--- a/clang/lib/Driver/ToolChains/Clang.cpp | ||
+++ b/clang/lib/Driver/ToolChains/Clang.cpp | ||
@@ -6351,8 +6351,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | ||
options::OPT_no_offload_new_driver, false)) | ||
CmdArgs.push_back("--offload-new-driver"); | ||
|
||
- SanitizeArgs.addArgs(TC, Args, CmdArgs, InputType); | ||
- | ||
const XRayArgs &XRay = TC.getXRayArgs(); | ||
XRay.addArgs(TC, Args, CmdArgs, InputType); | ||
|
||
@@ -7176,6 +7174,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | ||
} | ||
} | ||
|
||
+ // This needs to run after -Xclang argument forwarding to pick up the target | ||
+ // features enabled through -Xclang -target-feature flags. | ||
+ SanitizeArgs.addArgs(TC, Args, CmdArgs, InputType); | ||
+ | ||
// With -save-temps, we want to save the unoptimized bitcode output from the | ||
// CompileJobAction, use -disable-llvm-passes to get pristine IR generated | ||
// by the frontend. |