-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[llvm][docs] MemTagSanitizer is only supported on AArch64 Android #120545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
``` $ ./bin/clang /tmp/test.c -o /tmp/test.o -target aarch64-linux -march=armv8+memtag -fsanitize=memtag-stack clang: error: unsupported option '-fsanitize=memtag*' for target 'aarch64-unknown-linux' ``` But this works: ``` $ ./bin/clang /tmp/test.c -o /tmp/test.o -target aarch64-linux-android -march=armv8+memtag -fsanitize=memtag-stack ``` Due to this check in Clang: https://github.com/llvm/llvm-project/blob/2210da3b823ccf21fc634c858827c9f12c864b51/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1651 Likely because the required notes and dynamic loader support only exist for Android. You can get around this, sort of, by not linking the file. However this means you have to provide your own way of loading it, so it doesn't change the statement that this feature is Android only.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: David Spickett (DavidSpickett) ChangesBut this works: Due to this check in Clang:
Likely because the required notes and dynamic loader support only exist for Android. You can get around this, sort of, by not linking the file. However this means you have to provide your own way of loading it, so it doesn't change the statement that this feature is Android only. #64692 also confirms that the intent is to only support Android at this time. Full diff: https://github.com/llvm/llvm-project/pull/120545.diff 1 Files Affected:
diff --git a/llvm/docs/MemTagSanitizer.rst b/llvm/docs/MemTagSanitizer.rst
index 62efbfb041cbd0..44d261bec028f9 100644
--- a/llvm/docs/MemTagSanitizer.rst
+++ b/llvm/docs/MemTagSanitizer.rst
@@ -29,9 +29,9 @@ Usage
=====
Compile and link your program with ``-fsanitize=memtag`` flag. This
-will only work when targeting AArch64 with MemTag extension. One
+will only work when targeting AArch64 Android with MemTag extension. One
possible way to achieve that is to add ``-target
-aarch64-linux -march=armv8+memtag`` to compilation flags.
+aarch64-linux-android -march=armv8+memtag`` to compilation flags.
Implementation
==============
|
fmayer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
But this works:
Due to this check in Clang:
llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp
Line 1651 in 2210da3
Likely because the required notes and dynamic loader support only exist for Android.
You can get around this, sort of, by not linking the file. However this means you have to provide your own way of loading it, so it doesn't change the statement that this feature is Android only.
#64692 also confirms that the intent is to only support Android at this time.
And while I'm here, suggest an additive set of flags that can also be used.