GNU bug report logs - #79936
static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit hppa

Previous Next

Package: emacs;

Reported by: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>

Date: Tue, 2 Dec 2025 09:43:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

To reply to this bug, email your comments to 79936 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Tue, 02 Dec 2025 09:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 02 Dec 2025 09:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Cc: Helge Deller <deller <at> gmx.de>, John David Anglin <dave <at> parisc-linux.org>
Subject: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit hppa
Date: Tue, 02 Dec 2025 10:41:33 +0100
I am trying to build emacs revision 1677c4681a0 on 32-bit hppa (Debian unstable)
which fails with the following assertion error:

  CC       casefiddle.o
  CC       indent.o
  CC       search.o
  CC       regex-emacs.o
  CC       undo.o
  CC       alloc.o
alloc.c:639:1: error: static assertion failed
  639 | static_assert (MALLOC_IS_LISP_ALIGNED);
      | ^~~~~~~~~~~~~
make[3]: *** [Makefile:444: alloc.o] Error 1
make[3]: Leaving directory '/home/glaubitz/emacs/src'
make[2]: *** [Makefile:546: src] Error 2
make[2]: Leaving directory '/home/glaubitz/emacs'
make[1]: *** [Makefile:1293: actual-bootstrap] Error 2
make[1]: Leaving directory '/home/glaubitz/emacs'
make[1]: Entering directory '/home/glaubitz/emacs'

emacs was configured and built with:

./autogen.sh && ./configure && make bootstrap && make check

And the host system is using the following environment:

(sid_hppa-dchroot)glaubitz <at> panama:~/emacs$ uname -a
Linux panama 6.12.33+deb13-parisc64 #1 SMP Debian 6.12.33-1 (2025-06-19) parisc64 GNU/Linux
(sid_hppa-dchroot)glaubitz <at> panama:~/emacs$

(sid_hppa-dchroot)glaubitz <at> panama:~/emacs$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa-linux-gnu/15/lto-wrapper
Target: hppa-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 15.2.0-9' --with-bugurl=file:///usr/share/doc/gcc-15/README.Bugs --enable-languages=c,ada,c++,d,fortran,objc,obj-c++,m2,algol68 --
prefix=/usr --with-gcc-major-version-only --program-suffix=-15 --program-prefix=hppa-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-
threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-
unique-object --disable-libssp --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --
with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-libstdcxx-pch --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-
linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (Debian 15.2.0-9) 
(sid_hppa-dchroot)glaubitz <at> panama:~/emacs$

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Tue, 02 Dec 2025 15:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>,
 Paul Eggert <eggert <at> cs.ucla.edu>
Cc: deller <at> gmx.de, 79936 <at> debbugs.gnu.org, dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Tue, 02 Dec 2025 17:31:07 +0200
> Cc: Helge Deller <deller <at> gmx.de>, John David Anglin <dave <at> parisc-linux.org>
> From: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
> Date: Tue, 02 Dec 2025 10:41:33 +0100
> 
> I am trying to build emacs revision 1677c4681a0 on 32-bit hppa (Debian unstable)
> which fails with the following assertion error:
> 
>   CC       casefiddle.o
>   CC       indent.o
>   CC       search.o
>   CC       regex-emacs.o
>   CC       undo.o
>   CC       alloc.o
> alloc.c:639:1: error: static assertion failed
>   639 | static_assert (MALLOC_IS_LISP_ALIGNED);
>       | ^~~~~~~~~~~~~
> make[3]: *** [Makefile:444: alloc.o] Error 1
> make[3]: Leaving directory '/home/glaubitz/emacs/src'
> make[2]: *** [Makefile:546: src] Error 2
> make[2]: Leaving directory '/home/glaubitz/emacs'
> make[1]: *** [Makefile:1293: actual-bootstrap] Error 2
> make[1]: Leaving directory '/home/glaubitz/emacs'
> make[1]: Entering directory '/home/glaubitz/emacs'
> 
> emacs was configured and built with:
> 
> ./autogen.sh && ./configure && make bootstrap && make check
> 
> And the host system is using the following environment:
> 
> (sid_hppa-dchroot)glaubitz <at> panama:~/emacs$ uname -a
> Linux panama 6.12.33+deb13-parisc64 #1 SMP Debian 6.12.33-1 (2025-06-19) parisc64 GNU/Linux
> (sid_hppa-dchroot)glaubitz <at> panama:~/emacs$
> 
> (sid_hppa-dchroot)glaubitz <at> panama:~/emacs$ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa-linux-gnu/15/lto-wrapper
> Target: hppa-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Debian 15.2.0-9' --with-bugurl=file:///usr/share/doc/gcc-15/README.Bugs --enable-languages=c,ada,c++,d,fortran,objc,obj-c++,m2,algol68 --
> prefix=/usr --with-gcc-major-version-only --program-suffix=-15 --program-prefix=hppa-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-
> threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-
> unique-object --disable-libssp --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --
> with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-libstdcxx-pch --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-
> linux-gnu
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 15.2.0 (Debian 15.2.0-9) 
> (sid_hppa-dchroot)glaubitz <at> panama:~/emacs$

Thanks, I hope Paul (CC'ed) will be able to help here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Tue, 02 Dec 2025 16:38:01 GMT) Full text and rfc822 format available.

Message #11 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org,
 dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Tue, 2 Dec 2025 08:37:03 -0800
>> From: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
>> Date: Tue, 02 Dec 2025 10:41:33 +0100
>> ...
>> alloc.c:639:1: error: static assertion failed
>>    639 | static_assert (MALLOC_IS_LISP_ALIGNED);
>>        | ^~~~~~~~~~~~~

MALLOC_IS_LISP_ALIGNED is equivalent to (alignof (max_align_t) % 
LISP_ALIGNMENT == 0), LISP_ALIGNMENT is equivalent to (alignof (union { 
union emacs_align_type x; GCALIGNED_UNION_MEMBER })), and so forth, so 
it'd be helpful to know what all these things evaluate to. One way to do 
start doing that would be to run "make V=1", find what "CC alloc.o" 
really means, take that meaning "gcc -c OTHERARGS" and run "gcc -E -dD 
OTHERARGS" instead, and let us know what the output is.

Also, can you run GDB on that platform? If so, can you use it to print 
LISP_ALIGNMENT?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 01:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org,
 dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Tue, 2 Dec 2025 17:50:21 -0800
[Message part 1 (text/plain, inline)]
Oh, I think I see the problem, given the earlier GCC bug report on this 
topic. I installed the attached patch into the master branch; please 
give it a try.
[0001-Port-to-GNU-Linux-HPPA-malloc.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 06:25:02 GMT) Full text and rfc822 format available.

Message #17 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dave Anglin <dave <at> parisc-linux.org>,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Tue, 2 Dec 2025 22:24:19 -0800
On 2025-12-02 19:22, Dave Anglin wrote:
> I hate to over allocate unless it's absolutely necessary.  Although the details may be tricky, is there a way to forcibly
> under align the pthread types?

Not without nontrivial engineering that I'd rather avoid.

We're over-allocating only by a few bytes (12 bytes on this platform), 
only for reasonably-rare Lisp objects, and (as far as we know) only on 
this one rare hardware platform, which its maker stopped supporting a 
dozen years ago. Not sure it's worth our time to develop and debug 
further tricks in this area if we already have something that works.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 08:20:04 GMT) Full text and rfc822 format available.

Message #20 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org,
 dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on
 32-bit hppa
Date: Wed, 03 Dec 2025 09:19:23 +0100
Hi Paul,

On Tue, 2025-12-02 at 17:50 -0800, Paul Eggert wrote:
> Oh, I think I see the problem, given the earlier GCC bug report on this 
> topic. I installed the attached patch into the master branch; please 
> give it a try.

I've performed a "git pull" now and started a new build and the error is gone.

I'm wondering however whether it's a good idea to add a workaround in emacs
instead of possibly fixing the non-standard behavior on hppa-linux.

But I assume that David and Helge will know better.

Thanks for the quick fix!

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 10:18:02 GMT) Full text and rfc822 format available.

Message #23 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org,
 dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on
 32-bit hppa
Date: Wed, 03 Dec 2025 11:17:11 +0100
Hi,

On Wed, 2025-12-03 at 09:19 +0100, John Paul Adrian Glaubitz wrote:
> On Tue, 2025-12-02 at 17:50 -0800, Paul Eggert wrote:
> > Oh, I think I see the problem, given the earlier GCC bug report on this 
> > topic. I installed the attached patch into the master branch; please 
> > give it a try.
> 
> I've performed a "git pull" now and started a new build and the error is gone.
> 
> I'm wondering however whether it's a good idea to add a workaround in emacs
> instead of possibly fixing the non-standard behavior on hppa-linux.
> 
> But I assume that David and Helge will know better.
> 
> Thanks for the quick fix!

Just as a heads-up: The testsuite passes as well:

SUMMARY OF TEST RESULTS
-----------------------
Files examined: 542
Ran 8290 tests, 7952 results as expected, 0 unexpected, 338 skipped
make[2]: Leaving directory '/home/glaubitz/emacs/test'
make[1]: Leaving directory '/home/glaubitz/emacs/test'

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 14:13:01 GMT) Full text and rfc822 format available.

Message #26 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Dave Anglin <dave <at> parisc-linux.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Tue, 2 Dec 2025 22:22:42 -0500
On 2025-12-02 8:50 p.m., Paul Eggert wrote:
> Oh, I think I see the problem, given the earlier GCC bug report on this topic. I installed the attached patch into the master branch; please
> give it a try.
Ugh!  Although the pthread types pthread_mutex_t and pthread_cond_t nominally require 16-byte alignment,
the current locking implementation only requires 4-byte alignment for the lock.  I believe these types will work
correctly with 8-byte alignment but we can't change the alignment without a major ABI break and rebuilding
everything.

I hate to over allocate unless it's absolutely necessary.  Although the details may be tricky, is there a way to forcibly
under align the pthread types?  I doubt there's any code that actually needs 16-byte alignment still around.

Dave

-- 
John David Anglin  dave <at> parisc-linux.org





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 15:58:02 GMT) Full text and rfc822 format available.

Message #29 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dave Anglin <dave <at> parisc-linux.org>,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 07:57:18 -0800
On 2025-12-02 19:22, Dave Anglin wrote:
> Although the pthread types pthread_mutex_t and pthread_cond_t nominally require 16-byte alignment,
> the current locking implementation only requires 4-byte alignment for the lock.  I believe these types will work
> correctly with 8-byte alignment but we can't change the alignment without a major ABI break

Why would *reducing* required alignment break ABI? Although old user 
binaries with the stricter alignment will pass overaligned structures to 
the library, the library will continue to work.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 16:00:02 GMT) Full text and rfc822 format available.

Message #32 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, 79936 <at> debbugs.gnu.org,
 dave <at> parisc-linux.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 07:59:21 -0800
On 2025-12-03 00:19, John Paul Adrian Glaubitz wrote:
> I'm wondering however whether it's a good idea to add a workaround in emacs
> instead of possibly fixing the non-standard behavior on hppa-linux.

Yes, I'm wondering the same thing.

Although the behavior conforms to the C and POSIX standards, it 
disagrees with all other known implementations, it's bad for user code, 
and it's arguably a bug in POSIX that the behavior is allowed.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 03 Dec 2025 16:01:02 GMT) Full text and rfc822 format available.

Notification sent to John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>:
bug acknowledged by developer. (Wed, 03 Dec 2025 16:01:03 GMT) Full text and rfc822 format available.

Message #37 received at 79936-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: deller <at> gmx.de, Eli Zaretskii <eliz <at> gnu.org>, dave <at> parisc-linux.org,
 79936-done <at> debbugs.gnu.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 08:00:02 -0800
On 2025-12-03 02:17, John Paul Adrian Glaubitz wrote:

> Just as a heads-up: The testsuite passes as well:

Thanks, closing the Emacs bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 18:02:01 GMT) Full text and rfc822 format available.

Message #40 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Dave Anglin <dave <at> parisc-linux.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Cc: Helge Deller <deller <at> gmx.de>, Eli Zaretskii <eliz <at> gnu.org>,
 79936 <at> debbugs.gnu.org
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 13:00:54 -0500
On 2025-12-03 10:57 a.m., Paul Eggert wrote:
> On 2025-12-02 19:22, Dave Anglin wrote:
>> Although the pthread types pthread_mutex_t and pthread_cond_t nominally require 16-byte alignment,
>> the current locking implementation only requires 4-byte alignment for the lock.  I believe these types will work
>> correctly with 8-byte alignment but we can't change the alignment without a major ABI break
>
> Why would *reducing* required alignment break ABI? Although old user binaries with the stricter alignment will pass overaligned structures to
> the library, the library will continue to work.
It changes some struct offsets which will silently break some packages.

See <https://sourceware.org/pipermail/libc-alpha/2023-March/146644.html>.

Maybe it's time to bring back this change.  In March 23, we were facing dealing with the ABI
breakage caused by the time t64 transition.  The 16-byte alignment was needed for linux
threads.  The ldci semaphore instruction used by linuxthreads needed 16-byte alignment for
its address.  This has been replaced by linux kernel lock support which doesn't have this restriction
but we are still left with original linuxthread alignment requirement.

Dave

-- 
John David Anglin  dave <at> parisc-linux.org





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 21:16:02 GMT) Full text and rfc822 format available.

Message #43 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dave Anglin <dave <at> parisc-linux.org>
Cc: deller <at> gmx.de, 79936 <at> debbugs.gnu.org,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 13:15:08 -0800
[Message part 1 (text/plain, inline)]
On 2025-12-03 10:00, Dave Anglin wrote:
> On 2025-12-03 10:57 a.m., Paul Eggert wrote:
>> > Why would *reducing* required alignment break ABI? Although old user binaries with the stricter alignment will pass overaligned structures to
>> > the library, the library will continue to work.
> It changes some struct offsets which will silently break some packages.
> See <https://sourceware.org/pipermail/libc-alpha/2023-March/146644.html>.

Although I don't see that issue mentioned there, nor in the July 2023 
reversion of that change 
<https://sourceware.org/pipermail/glibc-cvs/2023q3/082677.html>, I 
assume the struct offsets you're talking about are in structs exposed by 
libraries other than glibc. (If it were merely structs exposed by glibc, 
glibc could pad them as needed.)

If that's the problem, then yes, the best thing is surely a rebuild of 
everything on GNU/Linux 32-bit HPPA.


> The 16-byte alignment was needed for linux
> threads.  The ldci semaphore instruction used by linuxthreads needed 16-byte alignment for
> its address.  This has been replaced by linux kernel lock support which doesn't have this restriction

Thanks for the history. It's worth mentioning in the Emacs comment so I 
installed the attached. Also, the history gave me the courage to save 4 
bytes in each object (as someone else mentioned excess bytes) by having 
the patch change 'int' to 'double' in the union.
[0001-Waste-4-fewer-bytes-in-GNU-Linux-32-bit-HPPA.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 21:39:01 GMT) Full text and rfc822 format available.

Message #46 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Dave Anglin <dave <at> parisc-linux.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: deller <at> gmx.de, Sam James <sam <at> gentoo.org>, 79936 <at> debbugs.gnu.org,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 16:38:50 -0500
On 2025-12-03 4:15 p.m., Paul Eggert wrote:
> On 2025-12-03 10:00, Dave Anglin wrote:
>> On 2025-12-03 10:57 a.m., Paul Eggert wrote:
>>> > Why would *reducing* required alignment break ABI? Although old user binaries with the stricter alignment will pass overaligned structures to
>>> > the library, the library will continue to work.
>> It changes some struct offsets which will silently break some packages.
>> See <https://sourceware.org/pipermail/libc-alpha/2023-March/146644.html>.
>
> Although I don't see that issue mentioned there, nor in the July 2023 reversion of that change
> <https://sourceware.org/pipermail/glibc-cvs/2023q3/082677.html>, I assume the struct offsets you're talking about are in structs exposed by
> libraries other than glibc. (If it were merely structs exposed by glibc, glibc could pad them as needed.) 
Yes.  I never saw a problem in my testing.

The patch never reached debian or gentoo, so what would actually break is unknown.  I reverted the change mainly
based on Florian's comment:

> Although the change may change some structure offsets, I don't
> believe the change requires a mass rebuild.  I am running a Debian
> hppa system with the reduced lock alignment and so far I haven't
> observed any breakage.  I checked this prior to committing the
> change.

With nothing rebuilt, no struct offsets change, so this isn't
unexpected.

Maybe it's still the easiest way to fix the underlying issue, but it's
likely not going to stop at just changing the glibc headers.

>
> If that's the problem, then yes, the best thing is surely a rebuild of everything on GNU/Linux 32-bit HPPA.
I'm willing to re-install the patch to reduce the alignment requirement.  Will adjust comment.  Thoughts?

Dave

-- 
John David Anglin  dave <at> parisc-linux.org





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 21:55:02 GMT) Full text and rfc822 format available.

Message #49 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dave Anglin <dave <at> parisc-linux.org>
Cc: deller <at> gmx.de, Sam James <sam <at> gentoo.org>, 79936 <at> debbugs.gnu.org,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 13:53:52 -0800
On 2025-12-03 13:38, Dave Anglin wrote:
> I'm willing to re-install the patch to reduce the alignment requirement.  Will adjust comment.  Thoughts?

Works for me. Bleeding-edge Emacs should work fine either way. 
Last-week-and-older Emacs should start working.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79936; Package emacs. (Wed, 03 Dec 2025 22:00:02 GMT) Full text and rfc822 format available.

Message #52 received at 79936 <at> debbugs.gnu.org (full text, mbox):

From: Dave Anglin <dave <at> parisc-linux.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: deller <at> gmx.de, Sam James <sam <at> gentoo.org>, 79936 <at> debbugs.gnu.org,
 John Paul Adrian Glaubitz <glaubitz <at> physik.fu-berlin.de>
Subject: Re: bug#79936: static_assert (MALLOC_IS_LISP_ALIGNED) fails on 32-bit
 hppa
Date: Wed, 3 Dec 2025 16:59:06 -0500
On 2025-12-03 4:53 p.m., Paul Eggert wrote:
> On 2025-12-03 13:38, Dave Anglin wrote:
>> I'm willing to re-install the patch to reduce the alignment requirement.  Will adjust comment.  Thoughts?
>
> Works for me. Bleeding-edge Emacs should work fine either way. Last-week-and-older Emacs should start working.
The t64 rebuild was a lot of work because of circular package dependencies.  The amount of work depends
on the amount of breakage.

Dave

-- 
John David Anglin  dave <at> parisc-linux.org





This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.