Skip to content
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

[compiler-rt] Fix '-Wmacro-redefined' errors #100337

Closed
wants to merge 1 commit into from

Conversation

chestnykh
Copy link
Contributor

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 24, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Dmitry Chestnykh (chestnykh)

Changes

https://lab.llvm.org/buildbot/#/builders/186/builds/880


Full diff: https://github.com/llvm/llvm-project/pull/100337.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp (+9)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index bc2cb247f2a8a..bdc79778be631 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -2173,6 +2173,9 @@ static const char *RegNumToRegName(int reg) {
     case REG_ESP:
       return "esp";
 #    elif defined(__arm__)
+#      ifdef MAKE_CASE
+#        undef MAKE_CASE
+#      endif
 #      define REG_STR(reg) #reg
 #      define MAKE_CASE(N) \
         case REG_R##N:     \
@@ -2197,6 +2200,9 @@ static const char *RegNumToRegName(int reg) {
     case REG_R15:
       return "pc";
 #    elif defined(__aarch64__)
+#      ifdef MAKE_CASE
+#        undef MAKE_CASE
+#      endif
 #      define REG_STR(reg) #reg
 #      define MAKE_CASE(N) \
         case N:            \
@@ -2247,6 +2253,9 @@ static const char *RegNumToRegName(int reg) {
 static uptr GetArmRegister(ucontext_t *ctx, int RegNum) {
   switch (RegNum) {
 #      if defined(__arm__)
+#        ifdef MAKE_CASE
+#          undef MAKE_CASE
+#        endif
 #        define MAKE_CASE(N) \
           case REG_R##N:     \
             return ctx->uc_mcontext.arm_r##N

@chestnykh chestnykh requested a review from devnexen July 24, 2024 10:58
@devnexen
Copy link
Member

oh wow it s becoming complicated :)

@hctim
Copy link
Collaborator

hctim commented Jul 24, 2024

I think for now it's best to update the original patch and check it, then re-land it all at once. I've reverted the original + the 1st fix-forward already in 59e1c6c and e7a3aeb respectively.

@chestnykh
Copy link
Contributor Author

I think for now it's best to update the original patch and check it, then re-land it all at once. I've reverted the original + the 1st fix-forward already in 59e1c6c and e7a3aeb respectively.

No problem

@chestnykh
Copy link
Contributor Author

Will be fixed further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants