#1103589 mimalloc: FTBFS on armhf: cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU

Package:
src:mimalloc
Source:
src:mimalloc
Submitter:
Chris Hofstaedtler
Date:
2025-08-13 11:53:05 UTC
Severity:
normal
Tags:
#1103589#5
Date:
2025-04-19 11:45:21 UTC
From:
To:
Version 3.0.1+ds-2.1 built before, but 3.0.3+ds-1 fails:

https://buildd.debian.org/status/fetch.php?pkg=mimalloc&arch=armhf&ver=3.0.3%2Bds-1&stamp=1744809460&raw=0

I imagine passing -march=armv8.1-a is also a baseline violation for armhf.

/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/alloc.c.o -MF CMakeFiles/mimalloc.dir/src/alloc.c.o.d -o CMakeFiles/mimalloc.dir/src/alloc.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/alloc.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/alloc-aligned.c.o -MF CMakeFiles/mimalloc.dir/src/alloc-aligned.c.o.d -o CMakeFiles/mimalloc.dir/src/alloc-aligned.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/alloc-aligned.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/alloc-posix.c.o -MF CMakeFiles/mimalloc.dir/src/alloc-posix.c.o.d -o CMakeFiles/mimalloc.dir/src/alloc-posix.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/alloc-posix.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/arena-meta.c.o -MF CMakeFiles/mimalloc.dir/src/arena-meta.c.o.d -o CMakeFiles/mimalloc.dir/src/arena-meta.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/arena-meta.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/arena.c.o -MF CMakeFiles/mimalloc.dir/src/arena.c.o.d -o CMakeFiles/mimalloc.dir/src/arena.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/arena.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/bitmap.c.o -MF CMakeFiles/mimalloc.dir/src/bitmap.c.o.d -o CMakeFiles/mimalloc.dir/src/bitmap.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/bitmap.c
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/heap.c.o -MF CMakeFiles/mimalloc.dir/src/heap.c.o.d -o CMakeFiles/mimalloc.dir/src/heap.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/heap.c
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:82: CMakeFiles/mimalloc.dir/src/alloc.c.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:96: CMakeFiles/mimalloc.dir/src/alloc-aligned.c.o] Error 1
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:110: CMakeFiles/mimalloc.dir/src/alloc-posix.c.o] Error 1
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:138: CMakeFiles/mimalloc.dir/src/arena-meta.c.o] Error 1
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:124: CMakeFiles/mimalloc.dir/src/arena.c.o] Error 1
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:152: CMakeFiles/mimalloc.dir/src/bitmap.c.o] Error 1
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:166: CMakeFiles/mimalloc.dir/src/heap.c.o] Error 1
[ 47%] Building C object CMakeFiles/mimalloc.dir/src/init.c.o
/usr/bin/cc -DMI_BUILD_RELEASE -DMI_CMAKE_BUILD_TYPE=relwithdebinfo -DMI_MALLOC_OVERRIDE -DMI_SHARED_LIB -DMI_SHARED_LIB_EXPORT -Dmimalloc_EXPORTS -I/build/reproducible-path/mimalloc-3.0.3+ds/include -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/mimalloc-3.0.3+ds=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wall -pedantic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -std=gnu11 -fPIC -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -Wstrict-prototypes -ftls-model=initial-exec -fno-builtin-malloc -march=armv8.1-a -MD -MT CMakeFiles/mimalloc.dir/src/init.c.o -MF CMakeFiles/mimalloc.dir/src/init.c.o.d -o CMakeFiles/mimalloc.dir/src/init.c.o -c /build/reproducible-path/mimalloc-3.0.3+ds/src/init.c
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
make[3]: *** [CMakeFiles/mimalloc.dir/build.make:180: CMakeFiles/mimalloc.dir/src/init.c.o] Error 1
make[3]: Leaving directory '/build/reproducible-path/mimalloc-3.0.3+ds/obj-arm-linux-gnueabihf'
make[2]: *** [CMakeFiles/Makefile2:90: CMakeFiles/mimalloc.dir/all] Error 2
make[2]: Leaving directory '/build/reproducible-path/mimalloc-3.0.3+ds/obj-arm-linux-gnueabihf'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory '/build/reproducible-path/mimalloc-3.0.3+ds/obj-arm-linux-gnueabihf'
dh_auto_build: error: cd obj-arm-linux-gnueabihf && make -j8 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:19: binary-arch] Error 25
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2025-04-16T13:17:38Z

#1103589#12
Date:
2025-08-12 23:54:04 UTC
From:
To:
[...]

There are two problems here.  Firstly, it misdetects the architecture as
arm64 because of the running kernel (this code is new in 3.0.3):

   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|armv[89].?|ARM64)$" OR CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64" OR "arm64" IN_LIST CMAKE_OSX_ARCHITECTURES)
     set(MI_ARCH "arm64")
   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|armv[34567]|ARM)$")
     set(MI_ARCH "arm32")

(That seems to have various other possible consequences; grep for
MI_ARCH_ARM64.  And of course this sort of checking strategy breaks
cross-builds as well.)

Secondly, this code in CMakeLists.txt defeats passing -DMI_OPT_ARCH=OFF
from debian/rules:

if(MI_NO_OPT_ARCH)
   set(MI_OPT_ARCH "OFF")
elseif(MI_ARCH STREQUAL "arm64")
   set(MI_OPT_ARCH "ON")  # enable armv8.1-a by default on arm64 unless MI_NO_OPT_ARCH is set
endif()

Since the repository is in Salsa's Debian group and the maintainer is in
LowThresholdNmu, I've gone ahead and committed the attached patch to git
for the second problem.  I haven't closed this bug with it yet though
since I think the first problem probably needs to be fixed too.

#1103589#17
Date:
2025-08-13 00:26:40 UTC
From:
To:
In fact, despite the name appearing similar to the cmake-level MI_ARCH,
MI_ARCH_ARM64 is set in include/mimalloc/bits.h based on preprocessor
definitions such as __aarch64__, which is probably fine.  And overriding
CMAKE_SYSTEM_PROCESSOR doesn't seem to be easy; I tried a conditional
-DCMAKE_SYSTEM_PROCESSOR=armv7l, and that was ignored.

So I'm actually inclined to just call this bug done with my previous
commit, although I still want to investigate
https://bugs.debian.org/1106879 before uploading it.

I filed https://bugs.debian.org/1110961 for a possible improvement in
debhelper.

My mistake; debhelper sets CMAKE_SYSTEM_PROCESSOR in that case, or at
least tries, and it's documented
(https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html)
as being cross-aware.

#1103589#22
Date:
2025-08-13 11:11:15 UTC
From:
To:
Dear maintainer,

I've prepared an NMU for mimalloc (versioned as 3.0.3+ds-1.1) and
uploaded it per the low-threshold NMU rules (also because this is an RC
bug that has been open for nearly four months and is blocking some other
packages I work on).  Diff attached.

Thanks,

#1103589#29
Date:
2025-08-13 11:52:37 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
mimalloc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1103589@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated mimalloc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 13 Aug 2025 12:06:40 +0100
Source: mimalloc
Architecture: source
Version: 3.0.3+ds-1.1
Distribution: unstable
Urgency: medium
Maintainer: Alex Myczko <tar@debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Closes: 1103589
Changes:
 mimalloc (3.0.3+ds-1.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Build with -DMI_NO_OPT_ARCH=ON rather than -DMI_OPT_ARCH=OFF, since the
     latter is ineffective on systems that the build system thinks are arm64
     (closes: #1103589).
Checksums-Sha1:
 c5bdf0ac4142189b3642d8aba11b3e8fdba461f0 2201 mimalloc_3.0.3+ds-1.1.dsc
 b4341e26cca2053a0ed0bee7e438c781d47dfa77 3720 mimalloc_3.0.3+ds-1.1.debian.tar.xz
 2239d0c6bc47b5252da62897af0810fb2a566c21 557208 mimalloc_3.0.3+ds-1.1.git.tar.xz
 02b039e543b27576369d0cb771afdf05ec91b13f 18078 mimalloc_3.0.3+ds-1.1_source.buildinfo
Checksums-Sha256:
 2741ed36119131a6600bc0535563fa495e9652e997d0cb058f6868b7e7523750 2201 mimalloc_3.0.3+ds-1.1.dsc
 dbaca39a4b19dcd372c555f3775fd4861f01bd1ff04a5ac6c7445f639ebbfb4c 3720 mimalloc_3.0.3+ds-1.1.debian.tar.xz
 86cce702678cff632785bfc0d2e2057c0b1876a8612bf96038915d4cbc101d45 557208 mimalloc_3.0.3+ds-1.1.git.tar.xz
 a7240208d52276db9da2503b39e268b396659bda532651d6393b387327544235 18078 mimalloc_3.0.3+ds-1.1_source.buildinfo
Files:
 54d08bd2d1df2e903e5cda636a09c51b 2201 libs optional mimalloc_3.0.3+ds-1.1.dsc
 12eb36386804692a50fdb680243b3036 3720 libs optional mimalloc_3.0.3+ds-1.1.debian.tar.xz
 b2531e3ddfd1dc77b95ad9aff230fef7 557208 libs optional mimalloc_3.0.3+ds-1.1.git.tar.xz
 b9c96e0f8546f73025f13113c03ec49b 18078 libs optional mimalloc_3.0.3+ds-1.1_source.buildinfo
Git-Tag-Info: tag=dbf16cb6fa0a9a49aef20bb41925bc88b0084d43 fp=ac0a4ff12611b6fccf01c111393587d97d86500b
Git-Tag-Tagger: Colin Watson <cjwatson@debian.org>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmiccw8ACgkQYG0ITkaD
wHk9NxAAlnoa6Lhl3gab8ioH1VnU59j4aZN/fK7GR3i2cnYBSKMjowZaM00uhJJ4
q5rlGY21UaASYiLMc40lJq6rGqj2zYuG2as5CEcuNJQ/ik74wFZtkPlRGbiPldQh
h16HOaHy2CRXclBqg8N2T7QPxM/GO4fynt0JepJHX9rZsriEX/MwfkZ/HUQbvYXw
KOnNwBALDyN5Ojx9sWuT0ukFE/Y9UZRxJ5HmiYtB8yT3QxKV00umfAai3/c4a/FH
M+7jP0HZaVWnPBCaA2NhLmuXoz1fbay4r5gjdN4KYKS29myJdvmLHxLmAr5tmLqx
FX4TMEjZqtmiqYHIRgWjSp4jnK4FzQeeeBUORYRc6UAEZEMvRP7bvmLdprda/q0S
hQ/U3WQI7sPnmNdR/Dm7fcGkx+H1h0p3566BtVRZUGLOnNbVinnuipmg/E7Bpb8o
siWqTYZRjFVD5gn8Wb5U8Gp2+TfDzdyozmyy6fEXmizv/Md5NPzPCvfuo9lOVH+p
ThG6IAIWMzFsXGd+ctZaoniKmfGk3vMp9pec0JJTzbthl1GWpc4tcrDg7qCZIklA
8E9tUfF8OMZmFYFIXeNvh+gAhPTJO0HtZxEizF3ytt6IN64spo9TMQl9iFxBJXhU
WDpSa/7ymClduuZ7g24kvhY2ISf6+S1XPeZLMbVGNu9TmjaYy7E=
=qy9c
-----END PGP SIGNATURE-----