From nobody Fri Sep 09 06:54:35 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 4MP6DW2pf7z4bwQs; Fri, 9 Sep 2022 06:54:35 +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 4MP6DW259Hz4QMX; Fri, 9 Sep 2022 06:54:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662706475; 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=Up02LYZ2cU3CK0mNKk+BbPPVbfSDKt67WXw3OtjwJNY=; b=pZFVt/VwCfqIIUj5hXsL5/cIX/1DkcjNFws7HRQG++0UPaoPijBM3K1PUOe8rZHAXRIGzy q6dVZ4Q4QrZSKMV16w3dz/cvNiZS+iwQ54Jhy33iodRihblgyueVWqwkDK2AkotBs62HDE 0B0newme+l20l1YVxTYglF2/nMIB0fT9qe+hH4Wya6jTqrUWrhxRLN+5bM7H2QG0JE2lHV xR8Tw/SuKhOYYjwVHbN80M7aAf42vfCaCjWe0z2kvGdbvzHupK8uA4IEZhjaANKoDRsJuv /joEpc2ZpZ+Zt7Y1jVvOKfS3oYR0pQxYNttI8Pv9gOfJePFcDoJsvheKgG37Qw== 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 4MP6DW15rRz17YN; Fri, 9 Sep 2022 06:54:35 +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 2896sZPD067359; Fri, 9 Sep 2022 06:54:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2896sZ0S067358; Fri, 9 Sep 2022 06:54:35 GMT (envelope-from git) Date: Fri, 9 Sep 2022 06:54:35 GMT Message-Id: <202209090654.2896sZ0S067358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Popov Subject: git: 20adba8bc1be - main - src.conf: Introduce WITHOUT_MACHDEP 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/main X-Git-Reftype: branch X-Git-Commit: 20adba8bc1beb125d5e5ed8f12e747ae79ca6a10 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662706475; 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=Up02LYZ2cU3CK0mNKk+BbPPVbfSDKt67WXw3OtjwJNY=; b=ApzATVFAorhv57F3GGqXplRtsWICfngQP3p+oWyxpYWdlmVw3s8Sh0v+rCBdFwyQA5nLFl 7A6+x1z+m4wtH3ub0y0K4yzYj3kg4H5D0W5rYINImYeGs5fmINEFD87ZAagh0bXbvt3j5N 74klbaio0P8jT1RQwho5kCmwgeNjH5zy3kKFnwf1yWCd7d3Bkz6CIv+E+zimbUSOZtAyFc 8dntDYD1Up3rBmmBpVXVTU4l4gSX9bZEcbKpjtoND2v5ZUQMmfDzMYIIPkDj9ieII8Qo2L um7uX8izCVUcyrGllksWdbLBKseNxuqQJAihod8pdr2ghAH2zMB9c2CSwAvhjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662706475; a=rsa-sha256; cv=none; b=Cm0ZqJQS54O06ftYEEDR92VNoWfvJqp5Ac/1EkkwQLHPTDHAV0EflFmxlyDyI36T/cQtvf pe9QTuEzQenwrb539wFNHcURt4RcnTED0B71evN9QDaC6/kMfWJvv3UV8v3VMeeuSJTsvF 94od0KRVJgpcwPqq7BQADprAGCl9B+PiSvdpwvQeAoIBwJJGWI4IcOZx6OMdeqbJjnjuu/ MMQQDnyrKZzRiU7OTGP1GAWssOMewhfLHdYSuFk94ge6NK9wcYkZfx+c+az0bIQwPbGDbV v1gm2UWNE26chxJ6qQbysZiHaTl3O06+6D3F/zbKwFpMnWpMU+KV7jCG+VXoEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=20adba8bc1beb125d5e5ed8f12e747ae79ca6a10 commit 20adba8bc1beb125d5e5ed8f12e747ae79ca6a10 Author: Gleb Popov AuthorDate: 2022-08-08 15:16:00 +0000 Commit: Gleb Popov CommitDate: 2022-09-09 06:54:28 +0000 src.conf: Introduce WITHOUT_MACHDEP 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 --- lib/libc/Makefile | 2 +- lib/libmd/Makefile | 2 +- lib/msun/Makefile | 2 +- share/man/man5/src.conf.5 | 2 ++ share/mk/src.opts.mk | 1 + tools/build/options/WITHOUT_MACHDEP_OPTIMIZATIONS | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 3667eea15307..a221a5a66c19 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -162,7 +162,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 2382a9ae3fdb..e65e9401cdbf 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -151,7 +151,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 36fb474b6597..0ccdfa6cd49c 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1094,6 +1094,8 @@ and related programs. Build .Xr ls 1 without support for colors to distinguish file types. +.It Va WITHOUT_MACHDEP +Prefer machine-independent non-assembler code across the code base. .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 4ac61f13cee2..a03b8147ecbb 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -142,6 +142,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.