2019-03-16 15:01:36 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2019-09-08 10:00:21 +00:00
|
|
|
.include <bsd.compiler.mk>
|
|
|
|
|
2019-03-16 15:01:36 +00:00
|
|
|
SHLIB_NAME= libomp.so
|
|
|
|
|
2019-12-20 19:53:05 +00:00
|
|
|
OMPSRC= ${SRCTOP}/contrib/llvm-project/openmp/runtime/src
|
2019-03-16 15:01:36 +00:00
|
|
|
ITTSRC= ${OMPSRC}/thirdparty/ittnotify
|
|
|
|
.PATH: ${OMPSRC}
|
|
|
|
.PATH: ${ITTSRC}
|
|
|
|
|
2020-01-27 18:04:28 +00:00
|
|
|
SRCS+= ittnotify_static.cpp
|
2019-03-16 15:01:36 +00:00
|
|
|
SRCS+= kmp_affinity.cpp
|
|
|
|
SRCS+= kmp_alloc.cpp
|
|
|
|
SRCS+= kmp_atomic.cpp
|
|
|
|
SRCS+= kmp_barrier.cpp
|
|
|
|
SRCS+= kmp_cancel.cpp
|
|
|
|
SRCS+= kmp_csupport.cpp
|
|
|
|
SRCS+= kmp_debug.cpp
|
|
|
|
SRCS+= kmp_dispatch.cpp
|
|
|
|
SRCS+= kmp_environment.cpp
|
|
|
|
SRCS+= kmp_error.cpp
|
|
|
|
SRCS+= kmp_ftn_cdecl.cpp
|
|
|
|
SRCS+= kmp_ftn_extra.cpp
|
|
|
|
SRCS+= kmp_global.cpp
|
|
|
|
SRCS+= kmp_gsupport.cpp
|
|
|
|
SRCS+= kmp_i18n.cpp
|
|
|
|
SRCS+= kmp_io.cpp
|
|
|
|
SRCS+= kmp_itt.cpp
|
|
|
|
SRCS+= kmp_lock.cpp
|
|
|
|
SRCS+= kmp_runtime.cpp
|
|
|
|
SRCS+= kmp_sched.cpp
|
|
|
|
SRCS+= kmp_settings.cpp
|
|
|
|
SRCS+= kmp_str.cpp
|
|
|
|
SRCS+= kmp_taskdeps.cpp
|
|
|
|
SRCS+= kmp_tasking.cpp
|
|
|
|
SRCS+= kmp_threadprivate.cpp
|
|
|
|
SRCS+= kmp_utility.cpp
|
|
|
|
SRCS+= kmp_version.cpp
|
|
|
|
SRCS+= kmp_wait_release.cpp
|
|
|
|
SRCS+= ompt-general.cpp
|
|
|
|
SRCS+= z_Linux_asm.S
|
|
|
|
SRCS+= z_Linux_util.cpp
|
|
|
|
INCS+= omp.h
|
|
|
|
|
|
|
|
WARNS?= 1
|
|
|
|
|
|
|
|
CFLAGS+= -D__STDC_CONSTANT_MACROS
|
|
|
|
CFLAGS+= -D__STDC_FORMAT_MACROS
|
|
|
|
CFLAGS+= -D__STDC_LIMIT_MACROS
|
|
|
|
CFLAGS+= -I${.CURDIR}
|
|
|
|
CFLAGS+= -I${OMPSRC}
|
|
|
|
CFLAGS+= -I${ITTSRC}
|
|
|
|
CFLAGS+= -ffunction-sections
|
|
|
|
CFLAGS+= -fdata-sections
|
|
|
|
CXXFLAGS+= -fvisibility-inlines-hidden
|
|
|
|
CXXFLAGS+= -fno-exceptions
|
|
|
|
CXXFLAGS+= -fno-rtti
|
Standardize `-std=c++* as `CXXSTD`
CXXSTD was added as the C++ analogue to CSTD.
CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`,
otherwise for older versions of g++.
This change standardizes the CXXSTD variable, originally added to
googletest.test.inc.mk as part of r345203.
As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.
Notes:
This value is not sanity checked in bsd.sys.mk, however, given the two
most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is
likely to work with both toolchains. This method will be refined in the future
to support more variants of C++, as not all versions of clang++ and g++ (for
instance) support C++14, C++17, etc.
Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD.
Example:
Before this commit:
```
CXXFLAGS+= -std=c++14
```
After this commit:
```
CXXSTD= c++14
```
Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 1 month
MFC with: r345203, r345704, r345705
Relnotes: yes
Tested with: make tinderbox
Differential Revision: https://reviews.freebsd.org/D19732
2019-03-29 18:45:27 +00:00
|
|
|
CXXSTD= c++11
|
2019-03-16 15:01:36 +00:00
|
|
|
|
2019-09-08 10:00:21 +00:00
|
|
|
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 90000
|
|
|
|
# When targeting i386, clang 9.0.0 produces a new warning about large atomic
|
|
|
|
# operations "possibly incurring significant performance penalties", but there
|
|
|
|
# is not much we can do about it.
|
|
|
|
CWARNFLAGS+= -Wno-atomic-alignment
|
|
|
|
.endif
|
|
|
|
|
2019-03-16 15:01:36 +00:00
|
|
|
LDFLAGS+= -Wl,--warn-shared-textrel
|
|
|
|
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
|
|
|
|
|
2019-03-17 11:27:27 +00:00
|
|
|
LIBADD+= pthread
|
2019-03-18 19:11:11 +00:00
|
|
|
LIBADD+= m
|
2019-03-17 11:27:27 +00:00
|
|
|
|
2019-05-19 20:13:55 +00:00
|
|
|
SYMLINKS+= ${SHLIB_NAME} ${LIBDIR}/libgomp.so
|
|
|
|
|
2019-03-16 15:01:36 +00:00
|
|
|
.include <bsd.lib.mk>
|