From patchwork Tue Jan 3 22:47:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 38695 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4851237wrt; Tue, 3 Jan 2023 14:47:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXshwEhPWiDGh1o7sk/V1E7QMeLZa8yT9kWTVaSTwiSAw9tBCXpWW3m2mVOTskMe229vrJCy X-Received: by 2002:aa7:d04e:0:b0:45c:835b:ac4d with SMTP id n14-20020aa7d04e000000b0045c835bac4dmr39550382edo.8.1672786070449; Tue, 03 Jan 2023 14:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672786070; cv=none; d=google.com; s=arc-20160816; b=LB5Dvg1UiAR+gEMfICL3iUSozM4JN+5ZfQgUXYsncf6lrX5FPy//mzgAJmRx9i9a15 9oB5zqrFI8wFx/dckDDtafjVdaep5baC9Od0/5n7X1HJGl26119OR8M8XP8BKv/ZsDHn yNXV4RK7KzCJqBSRWGD6hztTgLACxux1xUnGHbbi6YG95voOTCv+3zDh4FvFWevGnc7L RE9qTxDnhMfEwJeIJcRjOv2z3svFS865VWlf+dtB4cgx1/XRMUjw5VMB9Jg1ZzYFE+oA MlLsvsdJNurbGOk737VgrqnliSnk5PvaIJO0PFJDdwLsUdnPqxRqm5C0RNok55kXP0uD Hr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:organization:date:cc:to:subject:message-id:delivered-to :dkim-signature:dkim-filter; bh=Fvj1nPmOPzt9828F19Xl49Hjoz3TAyZ+YD1mTpAQe60=; b=ZTbioJ3mTTpio4wLv6mKqhNKsg8XHrutHVtkLOSRBiVCOWpoMP2j/eHMP/AZe9c10q +k36VkqOMT6rOUSbYv9q1X/KEVkvAoePjyw66XBfXd9SA9rzvT0AiaMhfUrryg9OscCT ET7BQTzPj6Ax1n1Eyhpwui7bQxsebk4BXp6qb5LlLok5gDNhjxvyx3E0FRUJw9SiF9dD UoSYw3LZhut1dU+JWm2Gm82N5MDy177R1oRY4iAfrboME3cpNDKoUMTGTogbGIh3DNbt iLlxoHFCbsRHvXawvBnAghqI04potq1EhR1qbFJYSEeF1jLSE4FW8URhHCYYfaqvfDF7 srKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kM4v33Rq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j17-20020a05640211d100b00451e0d930dfsi32870620edw.497.2023.01.03.14.47.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 14:47:50 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kM4v33Rq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 78C323858C54 for ; Tue, 3 Jan 2023 22:47:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78C323858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672786069; bh=Fvj1nPmOPzt9828F19Xl49Hjoz3TAyZ+YD1mTpAQe60=; h=Subject:To:Cc:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=kM4v33RqwTNreIfMRvLTrdh39FxywGZ2GCDE54bFZ44D+d93446j+kqtcRzIUCd90 gZ8OnFK8FwHFOrsXBUxkgDIcaRxJ3lKVQhnP5Fsk7CUteufhPc9d0l33tFnrxva0P5 UvG3YF6YPpX7YM+n7g1rOPdHbLCSb54g3PavcJ4k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 487C83858D20; Tue, 3 Jan 2023 22:46:35 +0000 (GMT) Received: by mail-lj1-x231.google.com with SMTP id f20so33577792lja.4; Tue, 03 Jan 2023 14:46:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:organization:date:cc:to:reply-to:from :subject:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Fvj1nPmOPzt9828F19Xl49Hjoz3TAyZ+YD1mTpAQe60=; b=jLZYff8m2dzBAJJGQNX5up3nOk/b0xGVrKi0LAD9lBWv0Baz21gWIuqTjmPhlWN9N5 ohpmYP3UgvFFXt7blpECHueHouxYFI6b7mI+6isb10TJbHMd+6rnx6qGW3D1hWCrdLUs tN/Sg5DyZGmWPFBl4be63q4TehWB5mA8lv+RX07fYo19ZEXWqqHbAEMhKKjsYcGpfODn 3EWWQ1Y/VfpgRnkDmHVmfdoPBdGNiYtPsIodw/eoKNvvTtKlzJYWujYHTi+zpXgw1SzG 5jbLCsLtZOJl9rwMkYr425a+oNDs/uyOKNHiLv1mRHtZ6aytna3nOg0x2Z3G8GHxdGyZ 7rsA== X-Gm-Message-State: AFqh2kr7Sv/wI46kTw2VNWTZfh2y5GhOe8IwmNgqc68pUyRl7mnVSgOu 65P+1Y74gqNqvKjBKV5pOFw= X-Received: by 2002:a2e:9b1a:0:b0:27f:df8f:7c8d with SMTP id u26-20020a2e9b1a000000b0027fdf8f7c8dmr4696337lji.47.1672785993474; Tue, 03 Jan 2023 14:46:33 -0800 (PST) Received: from G3620.lan (178-78-231-178.customers.ownit.se. [178.78.231.178]) by smtp.gmail.com with ESMTPSA id i16-20020a2ea370000000b00279a5b85791sm3661639ljn.88.2023.01.03.14.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 14:46:32 -0800 (PST) Message-ID: Subject: gcc-11: FTBFS on hurd-i386 To: Debian Bug Tracking System Cc: gcc-bugs@gcc.gnu.org, gcc-patches Date: Tue, 03 Jan 2023 23:47:20 +0100 Organization: Home User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Svante Signell via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: svante.signell@gmail.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754043326185471258?= X-GMAIL-MSGID: =?utf-8?q?1754043326185471258?= Source: gcc-11 Version: 11.3.0-10 Severity: important Tags: patch User: debian-hurd@lists.debian.org Usertags: hurd Affects: gcc-11, gcc-snapshot X-Debbugs-CC: debian-hurd@lists.debian.org Hi, gcc-11-11.3.0-10 in sid FTBFS on hurd-i386 due to failing linkage of pthread_once (same error already fixed in gcc-12 and gcc-13): /<>/build/i686-gnu/libstdc++-v3/include/i686-gnu/bits/gthr- default.h:700: undefined reference to `pthread_once' and more. The patch at hand is: libstdc++-hurd.diff, attached here for convenience. Thanks! 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. --- a/libstdc++-v3/config/os/gnu-linux/os_defines.h +++ b/libstdc++-v3/config/os/gnu-linux/os_defines.h @@ -49,22 +49,24 @@ // version dynamically in case it has changed since libstdc++ was configured. #define _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC __GLIBC_PREREQ(2,23) -#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 +#ifdef __linux__ +# if __GLIBC_PREREQ(2, 27) +// Since glibc 2.27 Linux' pthread_self() is usable without linking to libpthread. +# 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) -// Since glibc 2.34 all pthreads functions are usable without linking to +# if __GLIBC_PREREQ(2, 34) +// Since glibc 2.34 all Linux pthreads functions are usable without linking to // libpthread. -# define _GLIBCXX_GTHREAD_USE_WEAK 0 +# define _GLIBCXX_GTHREAD_USE_WEAK 0 +# endif #endif #endif