Re: Bug#1121498: libreoffice: Preprocessor macros in pdfium confuse arm64 with sparc64
Hi Rene,
On Tue, 2025-12-02 at 17:53 +0100, Rene Engelhard wrote:
> Am 27.11.25 um 18:32 schrieb John Paul Adrian Glaubitz:
> > No, the build log is confusing here. It's definitely in pdfium. I have applied the
> > patch locally and the build continues past this error now.
> >
> > You can see the bug here in the source code [1]. The preprocessor check is
> > incorrect and the reason why the the inline assembly code in [2] is emitted:
> >
> > asm("qsub %[result], %[first], %[second]"
> >
> > As shown above __arch64__ is incorrect for AArch64 since it's supposed to be __aarch64__.
>
> Apparently that's wrong. From Ubuntu:
>
> 14:27 <ricotz> hi, dieser sparc64 fix macht nun aber arm64 kaputt?
> https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice/-/commit/526f26e484aed8c398b44ee6a7dbcd374e89d7f4
> 14:29 <ricotz> 91 | asm("qsub %[result], %[first], %[second]"
> 14:29 <ricotz> | ^
> 14:29 <ricotz> <inline asm>:1:2: note: instantiated into assembly here
> 14:29 <ricotz> 1 | qsub x22, x9, x8
> 14:29 <ricotz> | ^
> 14:29 <ricotz> workdir/UnpackedTarball/pdfium/core/fxcrt/numerics/safe_math_arm_impl.h:91:9: error: unrecognized instruction mnemonic, did you mean: fsub,
> msub, sqsub, sub, subs, uqsub?
> 14:43 <ricotz> (__arch64__) sollte wohl entfernt werden - https://pdfium.googlesource.com/pdfium/+/refs/heads/main/core/fxcrt/numerics/safe_conversions.h
> 17:42 <_rene_> hatte das noch nicht auf arm getestet
> 17:42 <_rene_> schreib das mal in den bug an Adrian
> 17:45 <_rene_> s/bug/bug und/
>
> 17:49 <ricotz> https://git.launchpad.net/~libreoffice/ubuntu/+source/libreoffice/commit/?h=ubuntu-resolute-25.8&id=6099cd68b729afc128ecf8fe3f2dad15d7569e32
OK, I'll drop __arch64__ altogether then. I'm still struggling to fix my Gerrit access
in the mean time to fix this issue upstream in pdfium.
I'm surprised though what the original intention of the author of these lines were then
if not to enable ARM-optimized code on AArch64. There is no other 64-bit variant of ARM
that I know of, is there?
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Reply to: