Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2019 20:08:01 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346331 - in stable/12: gnu/lib lib/libomp share/man/man5 share/mk tools/build/mk tools/build/options
Message-ID:  <201904172008.x3HK81ml082062@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Apr 17 20:08:01 2019
New Revision: 346331
URL: https://svnweb.freebsd.org/changeset/base/346331

Log:
  After r346168, also merge build infrastructure for LLVM libomp.
  
  MFC r345235:
  
  Add lib/libomp, with a Makefile, and generated configuration headers.
  Not connected to the main build yet, as there is still the issue of the
  GNU omp.h header conflicting with the LLVM one.  (That is, if MK_GCC is
  enabled.)
  
  PR:		236062
  
  MFC r345236:
  
  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 r345242:
  
  Explicitly link libomp.so against -lpthread, as it depends on pthread
  functionality.  This should make example OpenMP programs work out of the
  box.
  
  Reported by:	jbeich
  PR:		236062, 236581
  
  MFC r345278:
  
  Also explicitly link libomp.so against -lm, as it transitively depends
  on scalbn and a few other math functions, via libcompiler-rt.  This
  should allow OpenMP programs to link with BFD linkers too.
  
  Reported by:	jbeich
  PR:		236062, 236581
  
  MFC r345282:
  
  Remove --as-needed from the linker flags for libomp.so, as these
  actually prevent the transitive dependency on libm.
  
  Reported by:	jbeich
  PR:		236062, 236581
  
  MFC r345291:
  
  Turn on MK_OPENMP for i386 by default, now that it can build.
  
  Noticed by:	jbeich
  PR:		236062, 236582

Added:
  stable/12/lib/libomp/
     - copied from r345235, head/lib/libomp/
  stable/12/tools/build/options/WITHOUT_OPENMP
     - copied unchanged from r345236, head/tools/build/options/WITHOUT_OPENMP
  stable/12/tools/build/options/WITH_OPENMP
     - copied unchanged from r345236, head/tools/build/options/WITH_OPENMP
Modified:
  stable/12/gnu/lib/Makefile
  stable/12/lib/libomp/Makefile
  stable/12/share/man/man5/src.conf.5
  stable/12/share/mk/src.opts.mk
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/gnu/lib/Makefile
==============================================================================
--- stable/12/gnu/lib/Makefile	Wed Apr 17 19:24:41 2019	(r346330)
+++ stable/12/gnu/lib/Makefile	Wed Apr 17 20:08:01 2019	(r346331)
@@ -4,7 +4,10 @@
 
 SUBDIR=			csu
 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
 

Modified: stable/12/lib/libomp/Makefile
==============================================================================
--- head/lib/libomp/Makefile	Sat Mar 16 15:01:36 2019	(r345235)
+++ stable/12/lib/libomp/Makefile	Wed Apr 17 20:08:01 2019	(r346331)
@@ -58,12 +58,14 @@ CXXFLAGS+=	-fno-exceptions
 CXXFLAGS+=	-fno-rtti
 
 LDFLAGS+=	-Wl,--warn-shared-textrel
-LDFLAGS+=	-Wl,--as-needed
 LDFLAGS+=	-Wl,--gc-sections
 LDFLAGS+=	-Wl,-z,noexecstack
 LDFLAGS+=	-Wl,-fini=__kmp_internal_end_fini
 LDFLAGS+=	-Wl,-soname,libomp.so
 
 VERSION_MAP=	${OMPSRC}/exports_so.txt
+
+LIBADD+=	pthread
+LIBADD+=	m
 
 .include <bsd.lib.mk>

Modified: stable/12/share/man/man5/src.conf.5
==============================================================================
--- stable/12/share/man/man5/src.conf.5	Wed Apr 17 19:24:41 2019	(r346330)
+++ stable/12/share/man/man5/src.conf.5	Wed Apr 17 20:08:01 2019	(r346331)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd April 12, 2019
+.Dd April 17, 2019
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1477,6 +1477,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, 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 and i386/i386.
 .It Va WITHOUT_OPENSSH
 Set to not build OpenSSH.
 .It Va WITHOUT_OPENSSL

Modified: stable/12/share/mk/src.opts.mk
==============================================================================
--- stable/12/share/mk/src.opts.mk	Wed Apr 17 19:24:41 2019	(r346330)
+++ stable/12/share/mk/src.opts.mk	Wed Apr 17 20:08:01 2019	(r346331)
@@ -396,6 +396,12 @@ __DEFAULT_YES_OPTIONS+=NVME
 __DEFAULT_NO_OPTIONS+=NVME
 .endif
 
+.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "amd64" || ${__T} == "i386")
+__DEFAULT_YES_OPTIONS+=OPENMP
+.else
+__DEFAULT_NO_OPTIONS+=OPENMP
+.endif
+
 .include <bsd.mkopt.mk>
 
 #

Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/12/tools/build/mk/OptionalObsoleteFiles.inc	Wed Apr 17 19:24:41 2019	(r346330)
+++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc	Wed Apr 17 20:08:01 2019	(r346331)
@@ -2734,7 +2734,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
@@ -7189,6 +7191,13 @@ OLD_FILES+=usr/share/man/man8/ntpdate.8.gz
 OLD_FILES+=usr/share/man/man8/ntpdc.8.gz
 OLD_FILES+=usr/share/man/man8/ntpq.8.gz
 OLD_FILES+=usr/share/man/man8/ntptime.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

Copied: stable/12/tools/build/options/WITHOUT_OPENMP (from r345236, head/tools/build/options/WITHOUT_OPENMP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/12/tools/build/options/WITHOUT_OPENMP	Wed Apr 17 20:08:01 2019	(r346331, copy of r345236, head/tools/build/options/WITHOUT_OPENMP)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build LLVM's OpenMP runtime.

Copied: stable/12/tools/build/options/WITH_OPENMP (from r345236, head/tools/build/options/WITH_OPENMP)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/12/tools/build/options/WITH_OPENMP	Wed Apr 17 20:08:01 2019	(r346331, copy of r345236, head/tools/build/options/WITH_OPENMP)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to build LLVM's OpenMP runtime.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904172008.x3HK81ml082062>