]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: fix SVE ACLE check for bootstrap glibc builds
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 4 May 2023 08:48:03 +0000 (09:48 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 4 May 2023 09:19:11 +0000 (10:19 +0100)
arm_sve.h depends on stdint.h but that relies on libc headers unless
compiled in freestanding mode.  Without this change a bootstrap glibc
build (that uses a compiler without installed libc headers) failed with

checking for availability of SVE ACLE... In file included from [...]/arm_sve.h:28,
                 from conftest.c:1:
[...]/stdint.h:9:16: fatal error: stdint.h: No such file or directory
    9 | # include_next <stdint.h>
      |                ^~~~~~~~~~
compilation terminated.
configure: error: mathvec is enabled but compiler does not have SVE ACLE. [...]

sysdeps/aarch64/configure
sysdeps/aarch64/configure.ac

index 22ed9d38d2f107d435a1ddfb575421db73e1e6fa..d0d78d69f1da8bf0cb64c200a4ed57ac4ff41a50 100644 (file)
@@ -342,7 +342,7 @@ else
     cat > conftest.c <<EOF
 #include <arm_sve.h>
 EOF
-    if ! ${CC-cc} conftest.c -fsyntax-only; then
+    if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then
       as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)."
     fi
     rm conftest.c
index ba519c90538b30ba99cfb01cabe5396bc78575b1..259edc3de8df017689a466ef69ab71cd7fd31b9d 100644 (file)
@@ -112,7 +112,7 @@ AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_has_sve_acle, [dnl
     cat > conftest.c <<EOF
 #include <arm_sve.h>
 EOF
-    if ! ${CC-cc} conftest.c -fsyntax-only; then
+    if ! ${CC-cc} conftest.c -fsyntax-only -ffreestanding; then
       as_fn_error 1 "mathvec is enabled but compiler does not have SVE ACLE. Either use a compatible compiler or configure with --disable-mathvec (this results in incomplete ABI)."
     fi
     rm conftest.c