From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qNf+A0HaGGScJgAASxT56A (envelope-from ) for ; Mon, 20 Mar 2023 23:12:17 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mLjTA0HaGGQFOQAAauVa8A (envelope-from ) for ; Mon, 20 Mar 2023 23:12:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx2.migadu.com (Postfix) with ESMTPS id 9A356393B9 for ; Mon, 20 Mar 2023 23:12:16 +0100 (CET) Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=oecIeP8N; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679350336; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2IIV1EkO1F+Nz1dx7NJyqOg0YYNUfv0nw4r6iKO5OFI=; b=AwOMcnQStjqZKAAwZc88q2rjjr9nBOrSeeh0Rm8CzkYNeTOo5WDTWe2GFMqxVv7V5KvXct rJ4I7tW2Z41YObMTu4MReZDJjFmsycp09qw6kidNkLLlrfQlr2Syf57dmQzwEoP0rVs/ZM MJ/k6lFX0O2wP1PUi+xSvTFShb3vi5y3LymX6DQyKZQ5+s/vjSjzuMBtOhPAlq/0ud+v+9 0DnqB5TKL6nEqIgRbbkJh6dy/nOluyEUojUuYTg3Xpv0PyQIPCMxF1hDFa+4KDGAzOEix9 7iGQg+UBo6QflyVH67uMnNzYUxa2t/9P61VIy+it7uDzTDCnD5cmTTtEfIyjHw== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=oecIeP8N; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679350336; a=rsa-sha256; cv=none; b=LZIq0GW/DTMqA2+k7yFSPdgCr3bEo7ErRz2suecgDcPonHQc10fLbO90m0aIa0h8w+S26q /Ilz7Lk4qTeaubKkQPGX/XXXSK9M6lveZ4n61kiLZoHGVw1RaDUrb22YQo2l/Nane8x9gt zTL++/gbSeYcGFBtnZQhKVfuM2FXDHXN3qmWDJ/NDzJSkYOoDhgW2S2cF2nzos7WzAaUcV 56/K5FrNFvlA8FBuBOt/ZhIVPQYmVjK0YeObqb6hK/fTgJc31heGlWxc8KqdyXXbV1N1Mt 2ecEYHpvB6QLEJ2Wr/bUcQwU8Jp71F3r8iJ3S0JGjdYXTG05ttOrv5Oqhxlhow== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNjX-0003kp-9I; Mon, 20 Mar 2023 18:12:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peNjW-0003kU-F4 for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peNjW-0003Fz-6c for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peNjW-0007Mg-2p for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62307] [PATCH core-updates 01/15] gnu: glibc/fix-for-hurd-cross: Add new variant. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Mar 2023 22:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62307@debbugs.gnu.org, Josselin Poiret Received: via spool by 62307-submit@debbugs.gnu.org id=B62307.167935026328052 (code B ref 62307); Mon, 20 Mar 2023 22:12:02 +0000 Received: (at 62307) by debbugs.gnu.org; 20 Mar 2023 22:11:03 +0000 Received: from localhost ([127.0.0.1]:56979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNiZ-0007IL-2H for submit@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:03 -0400 Received: from jpoiret.xyz ([206.189.101.64]:46548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNiW-0007Hb-U5 for 62307@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:01 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id BCEA2184D6B; Mon, 20 Mar 2023 22:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1679350259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2IIV1EkO1F+Nz1dx7NJyqOg0YYNUfv0nw4r6iKO5OFI=; b=oecIeP8NRm2eTM+UIOh0czH0W9vlu4TsSbM1e1/S9PgfnfEKU/bh33ZLzt4VGfSn4foKkg onKlIVD4ILV/dBCUuaTbaFEC8jqz6YQufUNdCHZWdaHHWzC3pfc2aABjFJbrQKg5T0UdKB CQ6FZyxkB/uj6f4HFCDWHnyzRTe4esbGHY0nPc640zZC4m+iIYu0xOR9NBtI8p7Qu31reB aoYZJuQ9EkiP23DwKQGjXef1izA/Ath3cpitiZIeEP3sGocOC7cgwUAvDN8b/VDsQB8q0J WAwYZNjVa5+fgBYQeLW8Gmmae94OZLQJN1Qs9NZi+JFCCZ4xYrZsDTRlpTTOgw== Date: Mon, 20 Mar 2023 23:10:36 +0100 Message-Id: <6a027350c8639d0c52cdda781abb9f7d304f64ed.1679349992.git.dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Migadu-Queue-Id: 9A356393B9 X-Spam-Score: -4.05 X-Migadu-Spam-Score: -4.05 X-Migadu-Scanner: scn0.migadu.com From: Josselin Poiret via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: ihivtdgwAqyv * gnu/packages/base.scm (glibc/fix-for-hurd-cross): New variable. (glibc/hurd-headers): Inherit it. * gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch: * gnu/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch: New files * gnu/local.mk (dist_patch_DATA): Register patches. --- gnu/local.mk | 2 + gnu/packages/base.scm | 13 ++- ...-hurd-add-freestanding-for-configure.patch | 87 +++++++++++++++++++ ...bc-hurd-add-freestanding-to-cppflags.patch | 72 +++++++++++++++ 4 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch create mode 100644 gnu/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch diff --git a/gnu/local.mk b/gnu/local.mk index c7a37814d9..0b2c8538c4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1226,6 +1226,8 @@ dist_patch_DATA = \ %D%/packages/patches/glibc-cross-objdump.patch \ %D%/packages/patches/glibc-dl-cache.patch \ %D%/packages/patches/glibc-hidden-visibility-ldconfig.patch \ + %D%/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch \ + %D%/packages/patches/glibc-hurd-add-freestanding-for-configure.patch \ %D%/packages/patches/glibc-hurd-clock_gettime_monotonic.patch \ %D%/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch \ %D%/packages/patches/glibc-hurd-clock_t_centiseconds.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 041f16b4fc..ffb3f8ac52 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1376,8 +1376,19 @@ (define-public which command.") (license gpl3+))) ; some files are under GPLv2+ +;; We need this for now because otherwise the configure phase fails. This +;; will be fixed with glibc 2.37. +(define-public glibc/fix-for-hurd-cross + (package/inherit glibc + (source + (origin + (inherit (package-source glibc)) + (patches (append (origin-patches (package-source glibc)) + (search-patches "glibc-hurd-add-freestanding-for-configure.patch" + "glibc-hurd-add-freestanding-to-cppflags.patch"))))))) + (define-public glibc/hurd-headers - (package (inherit glibc) + (package (inherit glibc/fix-for-hurd-cross) (name "glibc-hurd-headers") (outputs '("out")) (propagated-inputs (list gnumach-headers hurd-headers)) 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 --- /dev/null +++ b/gnu/packages/patches/glibc-hurd-add-freestanding-for-configure.patch @@ -0,0 +1,87 @@ +From 8b8c768e3c701ed1993789bb46acb8a12c7a93df Mon Sep 17 00:00:00 2001 +From: Flavio Cruz +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: +--- + 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 + 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 ]], [[ + 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 diff --git a/gnu/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch b/gnu/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch new file mode 100644 index 0000000000..14ed3f2a78 --- /dev/null +++ b/gnu/packages/patches/glibc-hurd-add-freestanding-to-cppflags.patch @@ -0,0 +1,72 @@ +From 7685630b98ca2a3f5de86eadf130993e6cf998a0 Mon Sep 17 00:00:00 2001 +From: Samuel Thibault +Date: Mon, 19 Dec 2022 02:34:55 +0100 +Subject: [PATCH] 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. +--- + sysdeps/mach/configure | 9 +++------ + sysdeps/mach/configure.ac | 9 +++------ + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure +index 36f556a663..ba6371cd3f 100644 +--- a/sysdeps/mach/configure ++++ b/sysdeps/mach/configure +@@ -127,14 +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 +-old_CFLAGS=$CFLAGS +-CFLAGS="$CFLAGS -ffreestanding" ++CPPFLAGS="$CPPFLAGS -ffreestanding" + + + ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h" +@@ -527,6 +526,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 5816c3d4ad..900e5445c5 100644 +--- a/sysdeps/mach/configure.ac ++++ b/sysdeps/mach/configure.ac +@@ -6,14 +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 +-old_CFLAGS=$CFLAGS +-CFLAGS="$CFLAGS -ffreestanding" ++CPPFLAGS="$CPPFLAGS -ffreestanding" + AC_CHECK_HEADER(mach/mach_types.h,, + [AC_MSG_ERROR([cannot find Mach headers])], -) + CFLAGS=$old_CFLAGS +@@ -136,6 +135,4 @@ fi]) + + hurd_MIG_RETCODE + +-if test -n "$sysheaders"; then +- CPPFLAGS=$OLD_CPPFLAGS +-fi ++CPPFLAGS=$OLD_CPPFLAGS -- 2.39.2