From nobody Tue Sep 13 19:00:55 2022 X-Original-To: dev-commits-src-all@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 4MRt8m0jhxz4c9ZP; Tue, 13 Sep 2022 19:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MRt8m03Tzz3WW7; Tue, 13 Sep 2022 19:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663095656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMhcb4727QG45IuKTjt+UJEOkiMe3o29NFt1e+khXNQ=; b=gL/LOfQctzFcO/Pb1zwlIq7WuqE4PBCNQMa5PD9IANbB3pkEtsPtXdzS2MIK37NG7Lk3fe IBvhCMb0/rdcE3c2u4OdsA7rLIguPkC30PqiU1kuUdtWpnMr0TojUfG3OfgFpITVwtUqMK Wc/BRWqkBRLtgy689amw7oHvRqVUft27Rvnjf/OksMEXXgKDcpAO0QbvQ/gNhiPCc8nhH2 Eo55rIjaV0KAl4FK6hgW1YJmtSusuZtnu5ZiA4fQUYLq//8rSz25zDkJaSdL0L6EUMlmhx 0H97xd0hVtJ7PG7cE3ywf98zZT9ggJhEXbSDZ9Wv6baAqWwATt3mUZy/LDh0CQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MRt8l6F4hzQgZ; Tue, 13 Sep 2022 19:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28DJ0tc6059751; Tue, 13 Sep 2022 19:00:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28DJ0tpr059750; Tue, 13 Sep 2022 19:00:55 GMT (envelope-from git) Date: Tue, 13 Sep 2022 19:00:55 GMT Message-Id: <202209131900.28DJ0tpr059750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Popov Subject: git: 5b2084f04b65 - stable/12 - src.conf: Introduce WITHOUT_MACHDEP_OPTIMIZATIONS knob. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5b2084f04b65f854efa661e476cc19316a27db63 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663095656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMhcb4727QG45IuKTjt+UJEOkiMe3o29NFt1e+khXNQ=; b=kzJuB++vNEH3m7SFfGQ9uoBGBPsq0a6GhFV8QCgRMbjFEAHle1fFDDtE85GqAMRT3n/8j0 R222Y7gtrwUl0sAbSpJCJQcXTOjKk3gQo/k9WbpBhpz2cfTu82MNSpGycHlVRL9Ogb0m4k jWotwaRBZKu155GaVW0qR2AwrFxKECZtuY9OyLAj03XaW67+IaQ3PSRbvt5LB8eVQA3IJ2 mNZOsYT4wGM93o8jgWaCM+6g3fjkqLgFjRRPzMhU5JQl9hgHmkzziGIs/gsOI+Rf3KZZez nY2S2MOMSa/C8y6tbyuKnYmYQf1i/g3JMsUPGqvaA4Gt6Vl9XIy0oDPOVV6t9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663095656; a=rsa-sha256; cv=none; b=NV2tDUcwrpfYjm/qUAZCdxXc+MN5coYJa5DhiEirtJ3pWCTLWFvDvjR3Azetmd1CPvvpLb kAx5t3BuKgpNf62q4FVywuGxEdbgpJKAS1OHOZLPZ2SwTizFapR4Ff/dQ5hz0LWMY64ry9 LO/S1auaRmo79vV51UfpeJAIncgfpjmpFirJGBfTkGo+61YIUGLNAKGtl37gye9JCum8oJ RezN2mfokFGzesMZLIuo3G5iMlCUBAsQeSeouPc9cfU08Pa2eZRb+qStv/z4K1EReuZlE3 Vm0AJ50wIpqP7ArCgXcGM/0iNm4z2H4mWxAfQ+Ep+eyAKEVF0ZUeyPSRy3mMKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by arrowd (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5b2084f04b65f854efa661e476cc19316a27db63 commit 5b2084f04b65f854efa661e476cc19316a27db63 Author: Gleb Popov AuthorDate: 2022-08-08 15:16:00 +0000 Commit: Gleb Popov CommitDate: 2022-09-13 19:00:33 +0000 src.conf: Introduce WITHOUT_MACHDEP_OPTIMIZATIONS knob. Summary: This knob can be used to make buildsystem prefer generic C implentations of various functions, instead of machine-specific assembler ones. Test Plan: `make buildworld` on amd64 Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D36076 MFC after: 3 days (cherry picked from commit 20adba8bc1beb125d5e5ed8f12e747ae79ca6a10) --- lib/libc/Makefile | 2 +- lib/libmd/Makefile | 2 +- lib/msun/Makefile | 2 +- share/man/man5/src.conf.5 | 4 +++- share/mk/src.opts.mk | 1 + tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index ea3879ece592..792d8a51c1b7 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -148,7 +148,7 @@ CFLAGS+= -DSYMBOL_VERSIONING # If there are no machine dependent sources, append all the # machine-independent sources: -.if empty(MDSRCS) +.if empty(MDSRCS) || ${MK_MACHDEP_OPTIMIZATIONS} == no SRCS+= ${MISRCS} .else # Append machine-dependent sources, then append machine-independent sources diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 2381d6da9e93..99a2e50ba368 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -102,7 +102,7 @@ CFLAGS.skein_block.c+= -DSKEIN_LOOP=995 .PATH: ${SRCTOP}/sys/crypto/skein ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} USE_ASM_SOURCES?=1 -.if defined(BOOTSTRAPPING) +.if defined(BOOTSTRAPPING) || ${MK_MACHDEP_OPTIMIZATIONS} == no # Don't build ASM sources when bootstrapping to avoid toolchain dependencies USE_ASM_SOURCES:=0 .endif diff --git a/lib/msun/Makefile b/lib/msun/Makefile index b76dde4c1dd0..ae8b42bebe40 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -142,7 +142,7 @@ COMMON_SRCS+= catrig.c catrigf.c \ #COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c # Exclude the generic versions of what we provide in the MD area. -.if defined(ARCH_SRCS) +.if defined(ARCH_SRCS) && "${MK_MACHDEP_OPTIMIZATIONS}" != no .for i in ${ARCH_SRCS} COMMON_SRCS:= ${COMMON_SRCS:N${i:R}.c} .endfor diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index d3af8e62fbda..6d4c3d5f2ca9 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 2, 2022 +.Dd September 9, 2022 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1343,6 +1343,8 @@ Set to build without support for colors to distinguish file types. .It Va WITHOUT_LZMA_SUPPORT Set to build some programs without optional lzma compression support. +.It Va WITHOUT_MACHDEP_OPTIMIZATIONS +Prefer machine-independent non-assembler code in libc and libm. .It Va WITHOUT_MAIL Set to not build any mail support (MUA or MTA). When set, it enforces these options: diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7fb961048854..455e9f4c591c 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -141,6 +141,7 @@ __DEFAULT_YES_OPTIONS = \ LPR \ LS_COLORS \ LZMA_SUPPORT \ + MACHDEP_OPTIMIZATIONS \ MAIL \ MAILWRAPPER \ MAKE \ diff --git a/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS b/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS new file mode 100644 index 000000000000..1c596c998504 --- /dev/null +++ b/tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS @@ -0,0 +1 @@ +Prefer machine-independent non-assembler code in libc and libm.