From nobody Wed May 04 20:38:36 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 21C781AB7636 for ; Wed, 4 May 2022 20:38:40 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (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 (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KtpZQ3lNsz3qxP; Wed, 4 May 2022 20:38:38 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 244KcaIt025269 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 4 May 2022 13:38:36 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 244KcaeD025268; Wed, 4 May 2022 13:38:36 -0700 (PDT) (envelope-from sgk) Date: Wed, 4 May 2022 13:38:36 -0700 From: Steve Kargl To: John Baldwin Cc: Ed Maste , FreeBSD Current Subject: Re: Profiled libraries on freebsd-current Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <80e38cf3-0d53-fce6-76e6-936c47d95c91@FreeBSD.org> <4b128639-f233-acfe-aeb4-5830aa973cb6@FreeBSD.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b128639-f233-acfe-aeb4-5830aa973cb6@FreeBSD.org> X-Rspamd-Queue-Id: 4KtpZQ3lNsz3qxP X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=washington.edu (policy=none); spf=none (mx1.freebsd.org: domain of sgk@troutmask.apl.washington.edu has no SPF policy when checking 128.95.76.21) smtp.mailfrom=sgk@troutmask.apl.washington.edu X-Spamd-Result: default: False [-1.01 / 15.00]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.986]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-current]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[washington.edu : No valid SPF, No valid DKIM,none] X-ThisMailContainsUnwantedMimeParts: N 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. -- Steve