From nobody Wed May 4 20:47:04 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 E25361ABA8F1 for ; Wed, 4 May 2022 20:47:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4Ktpm95g7Tz3tNt; Wed, 4 May 2022 20:47:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651697225; 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=byv81HHW3j/en8ulEm3eK67V00eWTmBNkD9t58ERo4g=; b=WuiblLy3021Rhub9dntTaF7gZ2Uww5ZfVlp3pP/YSP6zKFRRyU3bEbKUTUXDOk9nq9qSRZ QI2+v4ew+zpT+H4TfWYiyk/BYrBaq3R4LBNtbHuJHi2m2S0GK3g4TbHukP+4fyz2T9vZnn kROc1VLXcfb91CXuS2kVvzV+MJ154bTFTmpTcnfsK/KT7Hq+BYtYxLgtnFmrOdDiWp2Ybg dfOGaAswuDVHB6vtgCOsjaygS+jyllZBMYbmsZ7DqY+eKu9WNESD69s9vfGWH+TJc4xKRA O9Mw0g6oPU2JtrnY0oId7ZTfHegz8eevczMyAerS/rop06DOB+fpnXuVWXIW3A== 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 48F9472C0; Wed, 4 May 2022 20:47:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <1ab2b5dc-c98b-5a4d-de34-7472e936d395@FreeBSD.org> Date: Wed, 4 May 2022 13:47:04 -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> <4b128639-f233-acfe-aeb4-5830aa973cb6@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=1651697225; 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=byv81HHW3j/en8ulEm3eK67V00eWTmBNkD9t58ERo4g=; b=RwKbBaqrug43v8AW0kQKQALcBjukGkNRhqqQX0Pjn5wlkRR5nZ7ZCxOXe2O6VOpEP0KWkh kGcs9oySNK2Z8YxbvK62JIETM6oeIKZcen8S37jTig+BU94Zcoub2q2iN5GOnGApJYmai0 6PIWrBZ3DqQIR1EfiCXVaRRI6IQTs4od54zcdFm0rQJmp6ZrpRKB8SLoGhNY51ONw29kwn cmnsWMTkjVc+d3etomPZPb0cn0aH48xI1R4BF5OxN8rY9mU3oWk5kteSejfAKuKI8iV/6k mwQ8bqgeJEuHc36m0TBUfRuPZQ4PEGVAi1QZQVr6dgJO0ghGKfZmvZMvxT2N2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651697225; a=rsa-sha256; cv=none; b=aJ9vWFpDYPuOZVWOv+ry61hNDrZGkKyDO7jGdsBbmhbDx5pi5Va+dHGVGaLQrr3z2tKFRZ 1f52dARYE8hp9SKBcTFhOAS6P7hOkSiE39HzE0dxlzvWK2ef2LiYzjTa5q4EhAKwPmYjbp Z9x5Z1SBKLEkPf9OgfWmhAXeSOHvLVj9xXe2qnNbkZXofSWzbICk+UEvsvG0M/A7/KrIp2 hxfrqHCDM79qUx8AaIDTWP9xSvB8PmKdIH0uezMfhtNLhS8ju58ARt99Y1ib5uZ4TQcoyB okY0dIsE/OH9N92Zw4hkP1a/3ueYBv+mb6W/YC7egp9dtx9tkGrp56sLNaUb/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 5/4/22 1:38 PM, Steve Kargl wrote: > On Wed, May 04, 2022 at 01:22:57PM -0700, John Baldwin wrote: >> On 5/4/22 12:53 PM, Steve Kargl wrote: >>> On Wed, May 04, 2022 at 11:12:55AM -0700, John Baldwin wrote: >>> >>> 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). >> > > AFAICT, it controls whether -lpthread is automatically added to > the command line. In the case of -pg, it is -lpthread_p. > The relevant lines are > > #ifdef FBSD_NO_THREADS > #define FBSD_LIB_SPEC " \ > %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \ > is built with the --enable-threads configure-time option.} \ > %{!shared: \ > %{!pg: -lc} \ > %{pg: -lc_p} \ > }" > #else > #define FBSD_LIB_SPEC " \ > %{!shared: \ > %{!pg: %{pthread:-lpthread} -lc} \ > %{pg: %{pthread:-lpthread_p} -lc_p} \ > } \ > %{shared: \ > %{pthread:-lpthread} -lc \ > }" > #endif > > Ed is wondering if one can get rid of FBSD_NO_THREADS. With the > pending removal of WITH_PROFILE, the above reduces to > > #define FBSD_LIB_SPEC " \ > %{!shared: \ > %{pthread:-lpthread} -lc \ > } \ > %{shared: \ > %{pthread:-lpthread} -lc \ > }" > > If one can do the above, then freebsd-nthr.h is no longer needed > and can be deleted and config.gcc's handling of --enable-threads > can be updated/removed. Ok, so it's just if -pthread is supported (%{pthread:-lpthread} only adds -lpthread if -pthread was given on the command line). That can just be on all the time and Ed is correct that it is safe to remove the FBSD_NO_THREADS case and assume it is always present instead. -- John Baldwin