From b0840a28f6f663602c7cabade8c716e3e7eec27c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 16 Mar 2019 15:45:15 +0000 Subject: [PATCH] Connect lib/libomp to the build. * Set MK_OPENMP to yes by default only on amd64, for now. * Bump __FreeBSD_version to signal this addition. * Ensure gcc's conflicting omp.h is not installed if MK_OPENMP is yes. * Update OptionalObsoleteFiles.inc to cope with the conflicting omp.h. * Regenerate src.conf(5) with new WITH/WITHOUT fragments. Relnotes: yes PR: 236062 MFC after: 1 month X-MFC-With: r344779 --- gnu/lib/Makefile | 5 ++++- lib/Makefile | 1 + share/man/man5/src.conf.5 | 12 +++++++++++- share/mk/src.opts.mk | 6 ++++++ sys/sys/param.h | 2 +- tools/build/mk/OptionalObsoleteFiles.inc | 9 +++++++++ tools/build/options/WITHOUT_OPENMP | 2 ++ tools/build/options/WITH_OPENMP | 2 ++ 8 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 tools/build/options/WITHOUT_OPENMP create mode 100644 tools/build/options/WITH_OPENMP diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index 6dbef4d4065b..2cbb80cc7dcf 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -4,7 +4,10 @@ SUBDIR= SUBDIR.${MK_DIALOG}+= libdialog -SUBDIR.${MK_GCC}+= libgcov libgomp +SUBDIR.${MK_GCC}+= libgcov +.if ${MK_GCC} != "no" && ${MK_OPENMP} == "no" +SUBDIR+= libgomp +.endif SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests diff --git a/lib/Makefile b/lib/Makefile index 26c4ec208857..f5e89b0712c4 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -196,6 +196,7 @@ _libproc= libproc _librtld_db= librtld_db .endif +SUBDIR.${MK_OPENMP}+= libomp SUBDIR.${MK_OPENSSL}+= libmp SUBDIR.${MK_PMC}+= libpmc libpmcstat SUBDIR.${MK_RADIUS_SUPPORT}+= libradius diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index aa1d15f66cc0..67360756c39a 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 March 15, 2019 +.Dd March 16, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1534,6 +1534,16 @@ Set to build the non-essential components of the Infiniband software stack, mostly examples. .It Va WITH_OPENLDAP Enable building openldap support for kerberos. +.It Va WITHOUT_OPENMP +Set to not build LLVM's OpenMP runtime. +.Pp +This is a default setting on +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +.It Va WITH_OPENMP +Set to build LLVM's OpenMP runtime. +.Pp +This is a default setting on +amd64/amd64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 34e89f0190d5..430639c696da 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -399,6 +399,12 @@ BROKEN_OPTIONS+=NVME BROKEN_OPTIONS+=BSD_CRTBEGIN .endif +.if ${COMPILER_FEATURES:Mc++11} && ${__T} == "amd64" +__DEFAULT_YES_OPTIONS+=OPENMP +.else +__DEFAULT_NO_OPTIONS+=OPENMP +.endif + .include # diff --git a/sys/sys/param.h b/sys/sys/param.h index b9f1fe5e63da..edaac5307a40 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300015 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300016 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index f0b2e3663aa7..168759a3c6a0 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -2731,7 +2731,9 @@ OLD_FILES+=usr/include/gcc/4.2/altivec.h OLD_FILES+=usr/include/gcc/4.2/ppc-asm.h OLD_FILES+=usr/include/gcc/4.2/spe.h .endif +.if ${MK_OPENMP} == no OLD_FILES+=usr/include/omp.h +.endif OLD_FILES+=usr/lib/libgcov.a OLD_FILES+=usr/lib/libgomp.a OLD_FILES+=usr/lib/libgomp.so @@ -7733,6 +7735,13 @@ OLD_FILES+=usr/share/man/man8/smpquery.8.gz OLD_FILES+=usr/share/man/man8/vendstat.8.gz .endif +.if ${MK_OPENSSH} == no +.if ${MK_GCC} == no +OLD_FILES+=usr/include/omp.h +.endif +OLD_LIBS+=usr/lib/libomp.so +.endif + .if ${MK_OPENSSH} == no OLD_FILES+=etc/rc.d/sshd OLD_FILES+=etc/ssh/moduli diff --git a/tools/build/options/WITHOUT_OPENMP b/tools/build/options/WITHOUT_OPENMP new file mode 100644 index 000000000000..143b07e21b9c --- /dev/null +++ b/tools/build/options/WITHOUT_OPENMP @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM's OpenMP runtime. diff --git a/tools/build/options/WITH_OPENMP b/tools/build/options/WITH_OPENMP new file mode 100644 index 000000000000..6d41aeb0602c --- /dev/null +++ b/tools/build/options/WITH_OPENMP @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM's OpenMP runtime.