From nobody Wed May 4 20:22:57 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 340B31AB14C5 for ; Wed, 4 May 2022 20:22:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KtpDM0yJXz3l5f; Wed, 4 May 2022 20:22:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651695779; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=WXqX6gjUE1Fq3AnUkgq7miVsoqc84NzMQAFZZA+v+3A=; b=aqob+0WsFO2EG/qYgSmGhYjyLGvXz0H88tfyML1AQ7eeFt/jfQrLhQ197cDVDtEirDjzFb bXfUBOuekGLNBmdCDQPNe36zaJsZEfvd5Abpdwk3n6xAA1+NG673PixYFTpplkZ+V7LUJU 1ZKdDVcFEMJMqvx8EktC9xE2w+8a+5iJRlauA48yT5f/H/CPk147C2BKnLKch8jGjKUMcq /G2CiaoLBPuxboJpQqFHIPYusYpRUMawftgLFaAUcZWxRkYCENVhaF9AM8SS7ZKBxB/00e tyoX7F0HnVvp+lYc26ia4tCg7VzMVUHX1UF4pzzeiIlrHm4lBNCyE2JIUr8z4Q== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 9A73A78C2; Wed, 4 May 2022 20:22:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <4b128639-f233-acfe-aeb4-5830aa973cb6@FreeBSD.org> Date: Wed, 4 May 2022 13:22:57 -0700 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: Profiled libraries on freebsd-current Content-Language: en-US To: sgk@troutmask.apl.washington.edu Cc: Ed Maste , FreeBSD Current References: <80e38cf3-0d53-fce6-76e6-936c47d95c91@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651695779; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=WXqX6gjUE1Fq3AnUkgq7miVsoqc84NzMQAFZZA+v+3A=; b=hnMXzrqyrzBaLKfaJMt2f2jP9GWRhWKIquOcW0oyBVznL2EU2gh2x+u1Cohr4szbD66SCE 9ENYQ1j9JCo6JhUxwsSAyLr9TB8BeJ4XyRko5uP0DOFd5/CXDUOxPQw4abVaTN7mU7WQjd P1zSj2QVf0ypCc3Pj9USfuHq9PmOsGBisafET6IYoX1c6VifdMVGgDbPGHx3HOWEb/oESY Y/7zFEid5stKD3Ngu43Xw8KPUXvfPhUui+WP400PPqx3mv/jp7nl9NE03lNaq7eAdWULnP CZ7pLhLeBHhAYeWVOn6YYyKnejRG/kuNxvQBn28n2px74w9gVe0bQ5EuF2txMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651695779; a=rsa-sha256; cv=none; b=Fwnr7mrPULMIC6pwvApRW/YLDZfbWxuO7l5CvdlZGz7xR91R9CwpMWguw3/XcVgJGWvCvJ +3BkftjQjtimDv/1+WTqAtozsCGl8xlIvvgc3qgfsaZA1/xCsi7U1mF2dspPztFwXBJwhl w2AXkFhQBEH9ZJuflXF4shSXEfenpRQ14ycNGAHb21oqAooUy1DEQXxa4JQRXb+uiZurbT tiiC3j/3caGRjDh6LHUcQrjBzPsy3vWc+RA0ATdzRr8AQhduVHNq/s6G4uBKAB4U/kyB5K ftTgx3YoIKD+H9vnnvFHGt1ZPpdBEAUxn+hEgHF9IsOdGuadLi8HolhibRxaZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 5/4/22 12:53 PM, Steve Kargl wrote: > On Wed, May 04, 2022 at 11:12:55AM -0700, John Baldwin wrote: >> On 5/2/22 10:37 AM, Steve Kargl wrote: >>> On Mon, May 02, 2022 at 12:32:25PM -0400, Ed Maste wrote: >>>> On Sun, 1 May 2022 at 11:54, Steve Kargl >>>> wrote: >>>>> >>>>> diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h >>>>> index 594487829b5..1e8ab2e1827 100644 >>>>> --- a/gcc/config/freebsd-spec.h >>>>> +++ b/gcc/config/freebsd-spec.h >>>>> @@ -93,14 +93,22 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see >>>>> (similar to the default, except no -lg, and no -p). */ >>>>> >>>>> #ifdef FBSD_NO_THREADS >>>> >>>> I wonder if we can simplify things now, and remove this >>>> `FBSD_NO_THREADS` case. I didn't see anything similar in other GCC >>>> targets I looked at. >>> >>> That I don't know. FBSD_NO_THREADS is defined in freebsd-nthr.h. >>> In fact, it's the only thing in that header (except copyright >>> broilerplate). freebsd-nthr.h only appears in config.gcc and >>> seems to only get added to the build if someone runs configure >>> with --enable-threads=no. Looking at my last config.log for >>> gcc trunk, I see "Thread model: posix", which appears to be >>> the default case or if someone does --enable-threads=yes or >>> --enable-threads=posix. So, I suppose it comes down to >>> two questions: (1) is libpthread.* available on all supported >>> targets and versions? (2) does anyone build gcc without >>> threads support? >> >> libpthread is available on all supported architectures on all >> supported versions. libthr has been the default threading library >> since 7.0 and the only supported library since 8.0. In GDB I just >> assume libthr style threads, and I think GCC can safely do the >> same. >> > > I don't know the entire FreeBSD ecosystem. Do people > use FreeBSD on embedded systems (e.g., nanobsd) where > libthr may be stripped out? Thus, --enable-threads=no > is needed. If they do, they are also using a constrained userland and probably are not shipping a GCC binary either. However, it's not clear to me what --enable-threads means. Does this enable -pthread as an option? If so, that should definitely just always be on. It's still an option users have to opt into via a command line flag and doesn't prevent building non-threaded programs. If it's enabling use of threads at runtime within GCC itself, I'd say that also should probably just be allowed to be on. I can't really imagine what else it might mean (and I doubt it means the latter). -- John Baldwin