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
This commit is contained in:
Gleb Popov 2022-08-08 18:16:00 +03:00
parent 1494f4776a
commit 20adba8bc1
6 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -142,6 +142,7 @@ __DEFAULT_YES_OPTIONS = \
LOCATE \
LPR \
LS_COLORS \
MACHDEP_OPTIMIZATIONS \
MAIL \
MAILWRAPPER \
MAKE \

View file

@ -0,0 +1 @@
Prefer machine-independent non-assembler code in libc and libm.