Skip to content

Conversation

@SchrodingerZhu
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the libc label Oct 8, 2025
@SchrodingerZhu
Copy link
Contributor Author

SchrodingerZhu commented Oct 8, 2025

Merge without review as a simple build fix

@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

Changes

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

1 Files Affected:

  • (modified) libc/src/__support/OSUtil/linux/auxv.h (+4-2)
diff --git a/libc/src/__support/OSUtil/linux/auxv.h b/libc/src/__support/OSUtil/linux/auxv.h
index 17108e2e54794..7fb996f01dd84 100644
--- a/libc/src/__support/OSUtil/linux/auxv.h
+++ b/libc/src/__support/OSUtil/linux/auxv.h
@@ -96,8 +96,9 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
   }
   size_t avaiable_size = AUXV_MMAP_SIZE - sizeof(Entry);
 
-  // Attempt 1: use PRCTL to get the auxv.
-  // We guarantee that the vector is always padded with AT_NULL entries.
+// Attempt 1: use PRCTL to get the auxv.
+// We guarantee that the vector is always padded with AT_NULL entries.
+#ifdef PR_GET_AUXV
   long prctl_ret = syscall_impl<long>(SYS_prctl, PR_GET_AUXV,
                                       reinterpret_cast<unsigned long>(vector),
                                       avaiable_size, 0, 0);
@@ -105,6 +106,7 @@ LIBC_INLINE void Vector::fallback_initialize_unsync() {
     entries = vector;
     return;
   }
+#endif
 
   // Attempt 2: read /proc/self/auxv.
 #ifdef SYS_openat

@SchrodingerZhu SchrodingerZhu merged commit 8c3d929 into llvm:main Oct 8, 2025
17 of 20 checks passed
@SchrodingerZhu SchrodingerZhu deleted the libc-quick-fix branch October 8, 2025 14:38
clingfei pushed a commit to clingfei/llvm-project that referenced this pull request Oct 10, 2025
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants