[glibc] hurd: Fix redefinition of 'P2ALIGN'.

Samuel Thibault sthibaul@sourceware.org
Sat Jun 21 12:39:47 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5071149e89867070f692d89d75be5d7449294d1c

commit 5071149e89867070f692d89d75be5d7449294d1c
Author: Collin Funk <collin.funk1@gmail.com>
Date:   Mon Jun 16 20:45:14 2025 -0700

    hurd: Fix redefinition of 'P2ALIGN'.
    
    When building on GNU/Hurd warnings like the following occur:
    
        ../sysdeps/x86_64/multiarch/strnlen-evex-base.S:53:10: warning: "P2ALIGN" redefined
           53 | # define P2ALIGN(...)   .p2align 4,, 6
              |          ^~~~~~~
        In file included from /usr/include/x86_64-gnu/mach/x86_64/syscall_sw.h:30,
                         from ../sysdeps/mach/sysdep.h:21,
                         from ../sysdeps/mach/x86/sysdep.h:31,
                         from ../sysdeps/x86_64/multiarch/strnlen-evex-base.S:24:
        /usr/include/x86_64-gnu/mach/x86_64/asm.h:78:9: note: this is the location of the previous definition
           78 | #define P2ALIGN(p2)     .p2align p2     /* gas-specific */
              |         ^~~~~~~
    
    The fix is to undefine the macro from system headers in sysdep.h so that
    it can be properly defined in assembly files where its definition
    depends on whether string functions are being compiled for
    wide-characters or not.
    Message-ID: <721cd3a1bae1a553857db1dd69761a175f611364.1750131904.git.collin.funk1@gmail.com>

Diff:
---
 sysdeps/mach/sysdep.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sysdeps/mach/sysdep.h b/sysdeps/mach/sysdep.h
index 8293c66eb8..581bdcd54d 100644
--- a/sysdeps/mach/sysdep.h
+++ b/sysdeps/mach/sysdep.h
@@ -20,6 +20,11 @@
 /* Get the Mach definitions of ENTRY and kernel_trap.  */
 #include <mach/machine/syscall_sw.h>
 
+/* This macro is defined in Mach system headers, but string functions use it
+   with different definitions depending on whether being compiled for
+   wide-characters or not.  */
+#undef P2ALIGN
+
 /* The Mach definitions assume underscores should be prepended to
    symbol names.  Redefine them to do so only when appropriate.  */
 #undef EXT


More information about the Glibc-cvs mailing list