From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cKWTKRf6ImSnewAASxT56A (envelope-from ) for ; Tue, 28 Mar 2023 16:30:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YSF3KRf6ImTFrwAA9RJhRA (envelope-from ) for ; Tue, 28 Mar 2023 16:30:47 +0200 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 aspmx1.migadu.com (Postfix) with ESMTPS id 60D551F867 for ; Tue, 28 Mar 2023 16:30:47 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=D8K4F62z; spf=pass (aspmx1.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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680013847; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=Wko4EQnQb53m0rbkmxDrkkUo/1dm8m0765WHEXwxZ8c=; b=CdaT9/D+QFr4mN2+AJ/neNUXHxUscjnk/uq87E80NA/SWnoJxnNcUvnXoZ8Evud4IrDGWO A4cHIegNbLhAKz/K8d5uQrIpVR3xWFtos9o2eZidL95B3kNwWC1Lgch/nmOU1T91PxxEpT iuYxETJPhe0QfyV7le5kyY7fbHnah6gfqHVCtynkvsEwu3R5AcLRarOwXnGj1gKXqf+GTz o/rMsUKyv/x1JBy3R9nBPCXOQ2Kezek8AuBCWC5Rpjv3+kn/cZY25uzhSzFesufYiX7RHX PPFlx+v/3ObDBlv2/wl2y4usjAnN84AfIMZtYpleIHYkhVTpOMJun6de7IREjg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680013847; a=rsa-sha256; cv=none; b=qIXAV3b5+R+0xKKczi8JVhCekV/83faEpqKUGxVTTFHpg9L+O4sUjzqPFg86HjuUX/pUNb +Z0UJKzvrKPiCNqREhimf4ImpEf4IulpFTVhRkNOBRrNbZ/82JACOomJeYmtoN7/rR/VaB gaTjU4sfbGNGUa/kgaH0FbJpryiN8Fx1POq8lLztWHqU966OAAICt0GKZwAySe4wWtotAz jfoxKt1USaGb3u9qKxZfSKW/pJ+KIXDWkuQkEfYnNIWjBBkDRq7yqmAamTXiUHdKk/UNbH evPp1LHokpUB2OnWMeK6LNbVl6rzsrjJ+ds4ryT54fVSAilLt10elTVFZY649Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=D8K4F62z; spf=pass (aspmx1.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"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phAKu-0004fC-CK; Tue, 28 Mar 2023 10:30:08 -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 1phAKr-0004d1-4D for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:05 -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 1phAKq-0006pp-SQ for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phAKq-0002aT-M8 for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62307] [PATCH core-updates v2 03/20] gnu: gcc@11: Patch libpthread on GNU/Hurd. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Mar 2023 14:30:04 +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 Cc: Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 62307-submit@debbugs.gnu.org id=B62307.16800137639654 (code B ref 62307); Tue, 28 Mar 2023 14:30:04 +0000 Received: (at 62307) by debbugs.gnu.org; 28 Mar 2023 14:29:23 +0000 Received: from localhost ([127.0.0.1]:50378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phAKA-0002VQ-Ga for submit@debbugs.gnu.org; Tue, 28 Mar 2023 10:29:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phAK7-0002UO-Pd for 62307@debbugs.gnu.org; Tue, 28 Mar 2023 10:29:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phAK2-0006O3-J6; Tue, 28 Mar 2023 10:29:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Wko4EQnQb53m0rbkmxDrkkUo/1dm8m0765WHEXwxZ8c=; b=D8K4F62zi/1e76NhQJ6/ D4T+HMDpIVe3hi/yAYGrkcn42vQZkCjmtrDAPcq6AVBx1meV+gq4u2XwZXWmDC13ecjw/X9z7JUNh 6JT7M8KffWZWXcdCymbYEKrrIX+IZjxbqqToSGvHVc6YDyDi/pZIJewP25gGxRE//RwAv9lgv8ICb KMOaNk7UvQryz6Z116EWa0CYFYsDqEeIKhVbR3SWsfg24P7ndrRH4HnyxSz/yd7YNrwqKXlK6BheN KRYaLOoLmMPtnd1DT2Ev+6OYrLVoSLTZXuFWJFQBZG0/5TlH6DltdQtRaJmgu+lHBQW0Lu6ycQHD1 NJDDciAYAD3fWw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phAK2-00026Y-0R; Tue, 28 Mar 2023 10:29:14 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 28 Mar 2023 16:28:35 +0200 Message-Id: <20230328142852.26635-4-ludo@gnu.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230328142852.26635-1-ludo@gnu.org> References: <87pm90bzva.fsf_-_@gnu.org> <20230328142852.26635-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: X-Migadu-Queue-Id: 60D551F867 X-Spam-Score: -2.53 X-Migadu-Spam-Score: -2.53 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , 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: Q09U/M04ODWU From: Josselin Poiret * gnu/packages/gcc.scm (gcc-11)[arguments]: Add 'patch-hurd-libpthread' phase. * gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Co-authored-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/gcc.scm | 13 +++- .../gcc-11-libstdc++-hurd-libpthread.patch | 62 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch diff --git a/gnu/local.mk b/gnu/local.mk index d211db22c9..c44ad3aab3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1181,6 +1181,7 @@ dist_patch_DATA = \ %D%/packages/patches/gcc-9-strmov-store-file-names.patch \ %D%/packages/patches/gcc-12-strmov-store-file-names.patch \ %D%/packages/patches/gcc-10-cross-environment-variables.patch \ + %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch \ %D%/packages/patches/gcc-12-cross-environment-variables.patch \ %D%/packages/patches/gcc-10-tree-sra-union-handling.patch \ %D%/packages/patches/gcolor3-update-libportal-usage.patch \ diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index ce6e3e7a83..a511cdbc45 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -706,7 +706,18 @@ (define-public gcc-11 "gcc-10-tree-sra-union-handling.patch")) (modules '((guix build utils))) (snippet gcc-canadian-cross-objdump-snippet))) - + (arguments + (substitute-keyword-arguments (package-arguments gcc-8) + ((#:phases phases #~%standard-phases) + (if (target-hurd?) + #~(modify-phases #$phases + (add-after 'unpack 'patch-hurd-libpthread + (lambda _ + (define patch + #$(local-file + (search-patch "gcc-11-libstdc++-hurd-libpthread.patch"))) + (invoke "patch" "--force" "-p1" "-i" patch)))) + phases)))) (properties `((compiler-cpu-architectures ("aarch64" ,@%gcc-11-aarch64-micro-architectures) diff --git a/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch b/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch new file mode 100644 index 0000000000..1845583ac5 --- /dev/null +++ b/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch @@ -0,0 +1,62 @@ +From f0065f207cf19cd960b33d961472c6d69514336f Mon Sep 17 00:00:00 2001 +From: Samuel Thibault +Date: Fri, 7 Oct 2022 22:45:06 +0200 +Subject: [PATCH] libstdc++: Mark pieces of gnu-linux/os_support.h + linux-specific + +This is notably needed because in glibc 2.34, the move of pthread functions +into libc.so happened for Linux only, not GNU/Hurd. + +The pthread_self() function can also always be used fine as it is on +GNU/Hurd. + +libstdc++-v3/ChangeLog: + + * config/os/gnu-linux/os_defines.h [!__linux__] + (_GLIBCXX_NATIVE_THREAD_ID, _GLIBCXX_GTHREAD_USE_WEAK): Do not define. + +Reviewed-by: Jonathan Wakely +--- + libstdc++-v3/config/os/gnu-linux/os_defines.h | 22 +++++++++++-------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/libstdc++-v3/config/os/gnu-linux/os_defines.h b/libstdc++-v3/config/os/gnu-linux/os_defines.h +index 3064f8d908ac2..87317031fcd71 100644 +--- a/libstdc++-v3/config/os/gnu-linux/os_defines.h ++++ b/libstdc++-v3/config/os/gnu-linux/os_defines.h +@@ -60,22 +60,26 @@ + # define _GLIBCXX_HAVE_FLOAT128_MATH 1 + #endif + +-#if __GLIBC_PREREQ(2, 27) ++#ifdef __linux__ ++// The following libpthread properties only apply to Linux, not GNU/Hurd. ++ ++# if __GLIBC_PREREQ(2, 27) + // Since glibc 2.27 pthread_self() is usable without linking to libpthread. +-# define _GLIBCXX_NATIVE_THREAD_ID pthread_self() +-#else ++# define _GLIBCXX_NATIVE_THREAD_ID pthread_self() ++# else + // Before then it was in libc.so.6 but not libc.a, and always returns 0, + // which breaks the invariant this_thread::get_id() != thread::id{}. + // So only use it if we know the libpthread version is available. + // Otherwise use (__gthread_t)1 as the ID of the main (and only) thread. +-# define _GLIBCXX_NATIVE_THREAD_ID \ +- (__gthread_active_p() ? __gthread_self() : (__gthread_t)1) +-#endif ++# define _GLIBCXX_NATIVE_THREAD_ID \ ++ (__gthread_active_p() ? __gthread_self() : (__gthread_t)1) ++# endif + +-#if __GLIBC_PREREQ(2, 34) ++# if __GLIBC_PREREQ(2, 34) + // Since glibc 2.34 all pthreads functions are usable without linking to + // libpthread. +-# define _GLIBCXX_GTHREAD_USE_WEAK 0 +-#endif ++# define _GLIBCXX_GTHREAD_USE_WEAK 0 ++# endif ++#endif // __linux__ + + #endif -- 2.39.2