From nobody Tue Sep 13 18:56:07 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 4MRt3C70D3z4c94x; Tue, 13 Sep 2022 18:56:07 +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 4MRt3C6TFJz3VrJ; Tue, 13 Sep 2022 18:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663095367; 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=q6fzgaCS3aheUgmvlX3JFSCr/IIeixlTqJB2+DCWM0c=; b=hcQD8W3EUhpVCzoE7JMNVUhAsUYAGDtn6RYhRSUpV4iiWiLsc1hLOpe4UihY1DJHGYwVMJ qncQNmJR8KbkqDDTksOqbcciDLmEzN/hLh6PGeIvGwuDyn7U3MIZotsXJMiGSOitxLTM/R IM/4QxIcU7splJp1BsKUoaFhgKMl0K43MLG2RUIUf1fy4fdLGui1vUtf96MkR33KHVY0ZZ 5bgxIaVEI4OtAiNHnqP0SwrnR6wOwEYHA7VeLElqZtdKEIcyE4rTN0h9rb/89A2nDBQM/S EhiBnqSj2h+UoXQckuaAthPhjn2QOiYZwFf/dvWSg9EFlPltQt4spEg06+O6NQ== 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 4MRt3C5X3LzQjy; Tue, 13 Sep 2022 18:56:07 +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 28DIu7BK049270; Tue, 13 Sep 2022 18:56:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28DIu77S049269; Tue, 13 Sep 2022 18:56:07 GMT (envelope-from git) Date: Tue, 13 Sep 2022 18:56:07 GMT Message-Id: <202209131856.28DIu77S049269@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: 998c08856a4e - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 998c08856a4e261dbd92771561d65a0201ec03d4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663095367; 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=q6fzgaCS3aheUgmvlX3JFSCr/IIeixlTqJB2+DCWM0c=; b=yUWjd1jtKWrYg+dvhDjcoODS8b2NaWlDX9QfAQTEX4kkjNXeTcjlUyZPZvOSKviCBxUzwM NgoYXWMMF5MV+Kcqv9MkQ45GrAyUKbxgwqt0QTbxHXJHmUN5nOe0V4WxquXwBAyOetPYps pp/mjOBRd4wvwBPJptbgYVPiK9mFo04Fqx/vvFmc2JXY7LW9gVxyKvzMpa19bksVyGwJlx NpIClk8bSRysflYKTakc5pnABnXRIxtLR127n1UD1ijq1RUUU8zJG7dkM1P+FzDGylholj +bNeZpOq0rq682DBkrgak9kJ4/5SCs84g/jLiZq8AfaT03t5CeVYIK03KhR8yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663095367; a=rsa-sha256; cv=none; b=JC/ZGbk4OInz62C407SW7QG7GNWIFvpH7d6uXJcFlM/pps5a1tCm1l1AfY0ZAxbJTqxmdc M9gzsP26zWuumg9s7/xHskEfCW5x5IrJ/BG2eLm4LFc0il6HQAtCrpr59muBEuVoxPwrnN wKF3jv+TdAI9mZPtUgRWEw/iFgkpqw7CGZmBFu1vfSJla7MceFZPHTflcygyELxBvpFeqI JUnjD8CIQJ2z1Dm/wh320lnawcOFjOFK6LGiRobaxt1D4bajwHj+UyxWhlgey7XS722OLU YePtMfjamxcK3fnSbN7f+wK5ayaj1ZNmQik64vgx3cw9qLyRg3VDnKx9oZhRZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by arrowd (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=998c08856a4e261dbd92771561d65a0201ec03d4 commit 998c08856a4e261dbd92771561d65a0201ec03d4 Author: Gleb Popov AuthorDate: 2022-08-08 15:16:00 +0000 Commit: Gleb Popov CommitDate: 2022-09-13 18:55:45 +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 (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 2f2e07c03438..6363cef8d48b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -165,7 +165,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 c98c33bae3f5..8d3a05279004 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -103,7 +103,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 6274c27c12c5..0be2813bb933 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -152,7 +152,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 272ad1cb9e71..99ffdb38d8e1 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 July 18, 2022 +.Dd September 9, 2022 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1060,6 +1060,8 @@ and related programs. Build .Xr ls 1 without support for colors to distinguish file types. +.It Va WITHOUT_MACHDEP_OPTIMIZATIONS +Prefer machine-independent non-assembler code in libc and libm. .It Va WITHOUT_MAIL Do 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 3fb104ad1c50..90405ce4b80c 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -140,6 +140,7 @@ __DEFAULT_YES_OPTIONS = \ LOCATE \ LPR \ LS_COLORS \ + 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.