From bab4e1044a6d9612cc4b6bed73e3242eeda72f8c Mon Sep 17 00:00:00 2001 From: GNU Libc Maintainers Date: Thu, 15 Aug 2024 11:10:46 +0200 Subject: [PATCH] git-mach-headers-freestanding commit 8b8c768e3c701ed1993789bb46acb8a12c7a93df Author: Flavio Cruz Date: Sun Dec 18 19:46:15 2022 -0500 Force use of -ffreestanding when checking for gnumach headers Without this ./configure assumes that we are in a fully hosted environment, which might not be the case. After this patch, we can rely on the freestanding header files provided by GCC such as stdint.h. Message-Id: commit 7685630b98ca2a3f5de86eadf130993e6cf998a0 Author: Samuel Thibault Date: Mon Dec 19 02:34:55 2022 +0100 mach: Fix passing -ffreestanding when checking for gnumach headers 8b8c768e3c70 ("Force use of -ffreestanding when checking for gnumach headers") was passing -ffreestanding to CFLAGS only, but headers checks are performed with the preprocessor, so we rather need to pass it to CPPFLAGS. commit 0fb10e49ad169374650534509767ec1d4232e230 Author: Samuel Thibault Date: Mon Dec 19 02:38:38 2022 +0100 mach: Drop remnants of old_CFLAGS Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name git-mach-headers-freestanding.diff --- sysdeps/mach/configure | 7 +++---- sysdeps/mach/configure.ac | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure index 739f1028a..3f0a90299 100644 --- a/sysdeps/mach/configure +++ b/sysdeps/mach/configure @@ -127,12 +127,13 @@ fi config_vars="$config_vars MIG = $MIG" +OLD_CPPFLAGS=$CPPFLAGS if test -n "$sysheaders"; then - OLD_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $SYSINCLUDES" fi ### Sanity checks for Mach header installation +CPPFLAGS="$CPPFLAGS -ffreestanding" ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h" @@ -521,6 +522,4 @@ if test $hurd_cv_mig_retcode = yes; then fi -if test -n "$sysheaders"; then - CPPFLAGS=$OLD_CPPFLAGS -fi +CPPFLAGS=$OLD_CPPFLAGS diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac index 61b00d66b..a57cb259b 100644 --- a/sysdeps/mach/configure.ac +++ b/sysdeps/mach/configure.ac @@ -6,12 +6,13 @@ if test "x$MIG" = xMISSING; then fi LIBC_CONFIG_VAR([MIG], [$MIG]) +OLD_CPPFLAGS=$CPPFLAGS if test -n "$sysheaders"; then - OLD_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $SYSINCLUDES" fi ### Sanity checks for Mach header installation +CPPFLAGS="$CPPFLAGS -ffreestanding" AC_CHECK_HEADER(mach/mach_types.h,, [AC_MSG_ERROR([cannot find Mach headers])], -) AC_CHECK_HEADER(mach/mach_types.defs,, [dnl @@ -130,6 +131,4 @@ fi]) hurd_MIG_RETCODE -if test -n "$sysheaders"; then - CPPFLAGS=$OLD_CPPFLAGS -fi +CPPFLAGS=$OLD_CPPFLAGS -- 2.30.2