[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
github-actions[bot] wrote: @tstellar (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
https://github.com/tstellar closed https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
https://github.com/llvmbot updated
https://github.com/llvm/llvm-project/pull/139389
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
}
.container { margin: 50px auto; max-width: 600px; text-align: center;
padding: 0 24px; }
a { color: #0366d6; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px;
text-shadow: 0 1px 0 #fff; }
p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }
ul { list-style: none; margin: 25px 0; padding: 0; }
li { display: table-cell; font-weight: bold; width: 1%; }
.logo { display: inline-block; margin-top: 35px; }
.logo-img-2x { display: none; }
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
}
#suggestions {
margin-top: 35px;
color: #ccc;
}
#suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
}
Whoa there!
You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information. https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
llvmbot wrote:
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: None (llvmbot)
Changes
Backport 801b519dfd01e21da0be17aa8f8dc2ceb0eb9e77
Requested by: @tstellar
---
Full diff: https://github.com/llvm/llvm-project/pull/139389.diff
4 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp (+4)
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
(+7-6)
- (modified)
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp (+1-1)
- (modified)
compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
(+2-1)
``diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index 7aa48d29d2d53..a4d526b4466c3 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -86,6 +86,10 @@
#include
# endif
+# if SANITIZER_LINUX && defined(__powerpc64__)
+#include
+# endif
+
# if SANITIZER_FREEBSD
#include
#include
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index e11eff13cd326..331e1c7d8d152 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) {
*addr = tp - RoundUpTo(*size, align);
*size = tp - *addr + ThreadDescriptorSize();
# else
- if (SANITIZER_GLIBC)
-*size += 1664;
- else if (SANITIZER_FREEBSD)
-*size += 128; // RTLD_STATIC_TLS_EXTRA
-#if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
+#if SANITIZER_GLIBC
+ *size += 1664;
+#elif SANITIZER_FREEBSD
+ *size += 128; // RTLD_STATIC_TLS_EXTRA
+# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
const uptr pre_tcb_size = TlsPreTcbSize();
*addr -= pre_tcb_size;
*size += pre_tcb_size;
-#else
+# else
// arm and aarch64 reserve two words at TP, so this underestimates the range.
// However, this is sufficient for the purpose of finding the pointers to
// thread-specific data keys.
const uptr tcb_size = ThreadDescriptorSize();
*addr -= tcb_size;
*size += tcb_size;
+# endif
#endif
# endif
#elif SANITIZER_NETBSD
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index a5311d266b0c4..ec5f2edab6a64 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -96,7 +96,7 @@
# include
#if defined(__mips64) || defined(__aarch64__) || defined(__arm__) ||
\
defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 ||
\
-defined(__sparc__)
+defined(__sparc__) || defined(__powerpc64__)
# include
# ifdef __arm__
typedef struct user_fpregs elf_fpregset_t;
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
index 945da99d41f4e..58d17d90c343a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
@@ -31,7 +31,8 @@
#include // for pid_t
#include // for iovec
#include // for NT_PRSTATUS
-#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
+#if (defined(__aarch64__) || defined(__powerpc64__) || \
+ SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) &&\
!SANITIZER_ANDROID
// GLIBC 2.20+ sys/user does not include asm/ptrace.h
# include
``
https://github.com/llvm/llvm-project/pull/139389
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
llvmbot wrote: @vitalybuka What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
https://github.com/llvmbot milestoned https://github.com/llvm/llvm-project/pull/139389 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/20.x: [sanitizer_common] Fix build on ppc64+musl (#120036) (PR #139389)
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/139389 Backport 801b519dfd01e21da0be17aa8f8dc2ceb0eb9e77 Requested by: @tstellar >From 3632a99ac092c604b374d1f02681465e48d5 Mon Sep 17 00:00:00 2001 From: mojyack <[email protected]> Date: Fri, 11 Apr 2025 06:23:26 +0900 Subject: [PATCH] [sanitizer_common] Fix build on ppc64+musl (#120036) In powerpc64-unknown-linux-musl, signal.h does not include asm/ptrace.h, which causes "member access into incomplete type 'struct pt_regs'" errors. Include the header explicitly to fix this. Also in sanitizer_linux_libcdep.cpp, there is a usage of TlsPreTcbSize which is not defined in such a platform. Guard the branch with macro. (cherry picked from commit 801b519dfd01e21da0be17aa8f8dc2ceb0eb9e77) --- .../lib/sanitizer_common/sanitizer_linux.cpp| 4 .../sanitizer_common/sanitizer_linux_libcdep.cpp| 13 +++-- .../sanitizer_platform_limits_posix.cpp | 2 +- .../sanitizer_stoptheworld_linux_libcdep.cpp| 3 ++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp index 7aa48d29d2d53..a4d526b4466c3 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp @@ -86,6 +86,10 @@ #include # endif +# if SANITIZER_LINUX && defined(__powerpc64__) +#include +# endif + # if SANITIZER_FREEBSD #include #include diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp index e11eff13cd326..331e1c7d8d152 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp @@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) { *addr = tp - RoundUpTo(*size, align); *size = tp - *addr + ThreadDescriptorSize(); # else - if (SANITIZER_GLIBC) -*size += 1664; - else if (SANITIZER_FREEBSD) -*size += 128; // RTLD_STATIC_TLS_EXTRA -#if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 +#if SANITIZER_GLIBC + *size += 1664; +#elif SANITIZER_FREEBSD + *size += 128; // RTLD_STATIC_TLS_EXTRA +# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 const uptr pre_tcb_size = TlsPreTcbSize(); *addr -= pre_tcb_size; *size += pre_tcb_size; -#else +# else // arm and aarch64 reserve two words at TP, so this underestimates the range. // However, this is sufficient for the purpose of finding the pointers to // thread-specific data keys. const uptr tcb_size = ThreadDescriptorSize(); *addr -= tcb_size; *size += tcb_size; +# endif #endif # endif #elif SANITIZER_NETBSD diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp index a5311d266b0c4..ec5f2edab6a64 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp @@ -96,7 +96,7 @@ # include #if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \ defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \ -defined(__sparc__) +defined(__sparc__) || defined(__powerpc64__) # include # ifdef __arm__ typedef struct user_fpregs elf_fpregset_t; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp index 945da99d41f4e..58d17d90c343a 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp @@ -31,7 +31,8 @@ #include // for pid_t #include // for iovec #include // for NT_PRSTATUS -#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \ +#if (defined(__aarch64__) || defined(__powerpc64__) || \ + SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) &&\ !SANITIZER_ANDROID // GLIBC 2.20+ sys/user does not include asm/ptrace.h # include ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
