From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 2F7313858D32 for ; Mon, 7 Nov 2022 04:37:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F7313858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102b.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso13442734pjc.0 for ; Sun, 06 Nov 2022 20:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yl+KWd5zkCJ68LsJJX/aUNi9iwDI2NwtBE8kAyKlFrg=; b=dv7km9QTnlpjo1D8tqAvpxxB6gm96SWWlgpE3Kb0W5Rq3IVc1mZNbs2OGdXFd5peeQ eSkuKqnDZGAXTw51ZfCGagc7OHOULsIVd9yCy0AiYW9D0RFGXLEJNvYRuvqWcrWM3Rmh ZVGeP4ZUq/lSIbOJi3XU6Knghh/6eddqiqWI2kDiSkmB0/HX8OxnbCxfToIThP8ZcN/V G3FOLXjqWqEemKOIW3PmkdgFwdfGQhwbVog0+iz6SwBByag9cQOoGAM4/8s+zzSJf+GI SoFG/8hGWgvc1/WrenybvCKatBgZ1LdEMfQy69ZKrcSZbujR8j75TRjXDPdVc8WBDTms BZgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yl+KWd5zkCJ68LsJJX/aUNi9iwDI2NwtBE8kAyKlFrg=; b=1pPk4F/ERTf34FwRvhUxRxfZXFofK3aZJa4W/m7PlWKk35JnWF18IbzB85aUjWkJZe 1VTxULVedyB9LYfc8K44zhmV5xWasYc6L6cppZGc8CSxSF83dmzQsmRtMhNPRHhQl2bF e8wjBdjYA6YJeXwsHS0Vm1qtRj1VLTWjsIDW7MT82xkPvJH9/8Vub3NHNCxY4SPlSLhN ENMxOhBzPza3kGb5EVdzUw3qDVYowkjdz7dNE5GOAYFPlfE9+HyaIRVGhjCFPRck6T49 +pxUWKOXtzQ46ONotaAofgI3N5pZocI1EX3LXfjefv7P7bi0dE0gU+XtliHi8y4RItAO jmvw== X-Gm-Message-State: ACrzQf3mCAU1YYbt5y6AIAF0XQX4UmtqmToZc67bq/kHOIL8rnSKeBNE jkfmxVKHFjiMhM++9KoAufwymyqvzRhFFVsZTY4= X-Google-Smtp-Source: AMsMyM5m0eLHqgW5orBb5UCDgymHPVOZbhFUowlO3PxYA49i3caPTrJs1Z4N720nJUL137zUE2z391hSyHMjiPjA3SQ= X-Received: by 2002:a17:903:283:b0:186:897e:71ea with SMTP id j3-20020a170903028300b00186897e71eamr48166249plr.123.1667795836233; Sun, 06 Nov 2022 20:37:16 -0800 (PST) MIME-Version: 1.0 References: <8f15b063-9ec8-59e0-590b-20e416f68cb4@126.com> In-Reply-To: <8f15b063-9ec8-59e0-590b-20e416f68cb4@126.com> From: Andrew Pinski Date: Sun, 6 Nov 2022 20:37:03 -0800 Message-ID: Subject: Re: why does gccgit require pthread? To: LIU Hao Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Nov 6, 2022 at 7:59 PM LIU Hao via Gcc wrote: > > Greetings, > > At the moment, there are references to pthread mutexes in 'gcc/jit/libgccjit.cc' and > 'gcc/git/jit-playback.cc'. The former was introduced by 63b2923dc6f57e74d964a9cf14f4ba595ab14ed9 in > 2020, while the latter was introduced by 38771e4e1fdacfbdac5a14e50fcc0538577b1bdb in 2014. > > Does this mean, GCC can't be built with JIT enabled, for some thread model other than `posix` (e.g. > `win32`), where pthread isn't available? > > Can those references to mutexes be replaced with `__gthread_mutex_*` instead? However I see no other > references to inside the 'gcc' subdirectory, so I suspect it isn't an option there? The original code which used pthread was added in GCC 5 way before GCC moved to being written in C++11 which was only in the last 3 years. pthread_* functions were the best choice at the time (2014) but now GCC is written in C++11, I don't see any reason not to move them over to using C++11 threading code. Thanks, Andrew Thanks, Andrew Pinski > > > -- > Best regards, > LIU Hao