all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 4b5346f0128fe76db325b257d1951cfc83a3491d 3118 bytes (raw)
name: gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
 
From 8b8c768e3c701ed1993789bb46acb8a12c7a93df Mon Sep 17 00:00:00 2001
From: Flavio Cruz <flaviocruz@gmail.com>
Date: Sun, 18 Dec 2022 19:46:15 -0500
Subject: [PATCH] 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: <Y5+0V9osFc/zXMq0@mars>
---
 sysdeps/mach/configure    | 8 +++++++-
 sysdeps/mach/configure.ac | 6 ++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index 739f1028a46..36f556a6639 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -133,6 +133,8 @@ if test -n "$sysheaders"; then
 fi
 
 ### Sanity checks for Mach header installation
+old_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -ffreestanding"
 
 
 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
@@ -143,6 +145,7 @@ else
 fi
 
 
+CFLAGS=$old_CFLAGS
 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
 if test "x$ac_cv_header_mach_mach_types_defs" = xyes; then :
 
@@ -216,7 +219,9 @@ $as_echo_n "checking for creation_time in task_basic_info... " >&6; }
 if ${libc_cv_mach_task_creation_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  old_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -ffreestanding"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <mach/task_info.h>
 int
@@ -242,6 +247,7 @@ $as_echo "$libc_cv_mach_task_creation_time" >&6; }
 if test $libc_cv_mach_task_creation_time = no; then
   as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
 fi
+CFLAGS=$old_CFLAGS
 
 mach_interface_list=
 for ifc in mach mach4 gnumach \
diff --git a/sysdeps/mach/configure.ac b/sysdeps/mach/configure.ac
index 61b00d66b10..5816c3d4ad4 100644
--- a/sysdeps/mach/configure.ac
+++ b/sysdeps/mach/configure.ac
@@ -12,8 +12,11 @@ if test -n "$sysheaders"; then
 fi
 
 ### Sanity checks for Mach header installation
+old_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -ffreestanding"
 AC_CHECK_HEADER(mach/mach_types.h,,
                 [AC_MSG_ERROR([cannot find Mach headers])], -)
+CFLAGS=$old_CFLAGS
 AC_CHECK_HEADER(mach/mach_types.defs,, [dnl
 AC_MSG_ERROR([cannot find Mach .defs files])], -)
 
@@ -42,6 +45,8 @@ dnl The creation_time field is a GNU Mach addition the other variants lack.
 dnl
 AC_CACHE_CHECK(for creation_time in task_basic_info,
 	       libc_cv_mach_task_creation_time, [dnl
+old_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -ffreestanding"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/task_info.h>]], [[
 extern struct task_basic_info *i;
 long s = i->creation_time.seconds;
@@ -49,6 +54,7 @@ long s = i->creation_time.seconds;
 if test $libc_cv_mach_task_creation_time = no; then
   AC_MSG_ERROR([you need Mach headers supporting task_info.creation_time])
 fi
+CFLAGS=$old_CFLAGS
 
 dnl
 dnl The Darwin variant no longer has <mach/mach.defs>

debug log:

solving 4b5346f012 ...
found 4b5346f012 in https://yhetil.org/guix/6a027350c8639d0c52cdda781abb9f7d304f64ed.1679349992.git.dev@jpoiret.xyz/

applying [1/1] https://yhetil.org/guix/6a027350c8639d0c52cdda781abb9f7d304f64ed.1679349992.git.dev@jpoiret.xyz/
diff --git a/gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch b/gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch
new file mode 100644
index 0000000000..4b5346f012

1:27: trailing whitespace.
 
1:31: trailing whitespace.
 
1:32: trailing whitespace.
 
1:36: trailing whitespace.
 
1:37: trailing whitespace.
 
Checking patch gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch...
Applied patch gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch cleanly.
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

index at:
100644 4b5346f0128fe76db325b257d1951cfc83a3491d	gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.