xref: /freebsd/lib/libomp/Makefile (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
1*82854693SAndrew Turner# z_Linux_asm.S is missing BTI support
2*82854693SAndrew TurnerMK_BRANCH_PROTECTION=no
3*82854693SAndrew Turner
4022d9287SDimitry Andric.include <bsd.compiler.mk>
5022d9287SDimitry Andric
63c6bb671SDimitry AndricSHLIB_NAME=	libomp.so
73c6bb671SDimitry Andric
80b57cec5SDimitry AndricOMPSRC=		${SRCTOP}/contrib/llvm-project/openmp/runtime/src
93c6bb671SDimitry AndricITTSRC=		${OMPSRC}/thirdparty/ittnotify
103c6bb671SDimitry Andric.PATH:		${OMPSRC}
113c6bb671SDimitry Andric.PATH:		${ITTSRC}
123c6bb671SDimitry Andric
133eaa9debSDimitry AndricSRCS+=		ittnotify_static.cpp
143c6bb671SDimitry AndricSRCS+=		kmp_affinity.cpp
153c6bb671SDimitry AndricSRCS+=		kmp_alloc.cpp
163c6bb671SDimitry AndricSRCS+=		kmp_atomic.cpp
173c6bb671SDimitry AndricSRCS+=		kmp_barrier.cpp
183c6bb671SDimitry AndricSRCS+=		kmp_cancel.cpp
193c6bb671SDimitry AndricSRCS+=		kmp_csupport.cpp
203c6bb671SDimitry AndricSRCS+=		kmp_debug.cpp
213c6bb671SDimitry AndricSRCS+=		kmp_dispatch.cpp
223c6bb671SDimitry AndricSRCS+=		kmp_environment.cpp
233c6bb671SDimitry AndricSRCS+=		kmp_error.cpp
243c6bb671SDimitry AndricSRCS+=		kmp_ftn_cdecl.cpp
253c6bb671SDimitry AndricSRCS+=		kmp_ftn_extra.cpp
263c6bb671SDimitry AndricSRCS+=		kmp_global.cpp
273c6bb671SDimitry AndricSRCS+=		kmp_gsupport.cpp
283c6bb671SDimitry AndricSRCS+=		kmp_i18n.cpp
293c6bb671SDimitry AndricSRCS+=		kmp_io.cpp
303c6bb671SDimitry AndricSRCS+=		kmp_itt.cpp
313c6bb671SDimitry AndricSRCS+=		kmp_lock.cpp
323c6bb671SDimitry AndricSRCS+=		kmp_runtime.cpp
333c6bb671SDimitry AndricSRCS+=		kmp_sched.cpp
343c6bb671SDimitry AndricSRCS+=		kmp_settings.cpp
353c6bb671SDimitry AndricSRCS+=		kmp_str.cpp
363c6bb671SDimitry AndricSRCS+=		kmp_taskdeps.cpp
373c6bb671SDimitry AndricSRCS+=		kmp_tasking.cpp
383c6bb671SDimitry AndricSRCS+=		kmp_threadprivate.cpp
393c6bb671SDimitry AndricSRCS+=		kmp_utility.cpp
403c6bb671SDimitry AndricSRCS+=		kmp_version.cpp
413c6bb671SDimitry AndricSRCS+=		kmp_wait_release.cpp
423c6bb671SDimitry AndricSRCS+=		ompt-general.cpp
433c6bb671SDimitry AndricSRCS+=		z_Linux_asm.S
443c6bb671SDimitry AndricSRCS+=		z_Linux_util.cpp
453c6bb671SDimitry AndricINCS+=		omp.h
463c6bb671SDimitry Andric
473c6bb671SDimitry AndricWARNS?=		1
483c6bb671SDimitry Andric
493c6bb671SDimitry AndricCFLAGS+=	-D__STDC_CONSTANT_MACROS
503c6bb671SDimitry AndricCFLAGS+=	-D__STDC_FORMAT_MACROS
513c6bb671SDimitry AndricCFLAGS+=	-D__STDC_LIMIT_MACROS
523c6bb671SDimitry AndricCFLAGS+=	-I${.CURDIR}
533c6bb671SDimitry AndricCFLAGS+=	-I${OMPSRC}
543c6bb671SDimitry AndricCFLAGS+=	-I${ITTSRC}
553c6bb671SDimitry AndricCFLAGS+=	-ffunction-sections
563c6bb671SDimitry AndricCFLAGS+=	-fdata-sections
573c6bb671SDimitry AndricCXXFLAGS+=	-fvisibility-inlines-hidden
583c6bb671SDimitry AndricCXXFLAGS+=	-fno-exceptions
593c6bb671SDimitry AndricCXXFLAGS+=	-fno-rtti
6006c3fb27SDimitry AndricCXXSTD=		c++17
613c6bb671SDimitry Andric
625f757f3fSDimitry Andric.if ${COMPILER_TYPE} == "clang"
635f757f3fSDimitry Andric.if ${MACHINE_CPUARCH} == "i386"
6406c3fb27SDimitry Andric.if ${COMPILER_VERSION} >= 90000
65022d9287SDimitry Andric# When targeting i386, clang 9.0.0 produces a new warning about large atomic
66022d9287SDimitry Andric# operations "possibly incurring significant performance penalties", but there
67022d9287SDimitry Andric# is not much we can do about it.
68022d9287SDimitry AndricCWARNFLAGS+=	-Wno-atomic-alignment
69022d9287SDimitry Andric.endif
7006c3fb27SDimitry Andric.if ${COMPILER_VERSION} >= 170000
7106c3fb27SDimitry Andric# When targeting i386, clang 17.0.0 produces a new warning that __sync
7206c3fb27SDimitry Andric# builtin operations must have natural alignment, but there is not much we
7306c3fb27SDimitry Andric# can do about it.
7406c3fb27SDimitry AndricCWARNFLAGS+=	-Wno-sync-alignment
755f757f3fSDimitry Andric.endif # COMPILER_VERSION >= 170000
765f757f3fSDimitry Andric.endif # MACHINE_CPUARCH == i386
775f757f3fSDimitry Andric.if ${COMPILER_VERSION} >= 180000
785f757f3fSDimitry Andric# clang 18.0.0 introduces a new warning about variable length arrays in C++,
795f757f3fSDimitry Andric# which OpenMP makes use of in several sources.
805f757f3fSDimitry AndricCXXWARNFLAGS+=	-Wno-vla-cxx-extension
815f757f3fSDimitry Andric.endif # COMPILER_VERSION >= 180000
825f757f3fSDimitry Andric.endif # COMPILER_TYPE == clang
83022d9287SDimitry Andric
843c6bb671SDimitry AndricLDFLAGS+=	-Wl,--warn-shared-textrel
853c6bb671SDimitry AndricLDFLAGS+=	-Wl,--gc-sections
863c6bb671SDimitry AndricLDFLAGS+=	-Wl,-z,noexecstack
873c6bb671SDimitry AndricLDFLAGS+=	-Wl,-fini=__kmp_internal_end_fini
883c6bb671SDimitry AndricLDFLAGS+=	-Wl,-soname,libomp.so
893c6bb671SDimitry Andric
903c6bb671SDimitry AndricVERSION_MAP=	${OMPSRC}/exports_so.txt
913c6bb671SDimitry Andric
921d0078a2SDimitry AndricLIBADD+=	pthread
93db7591a8SDimitry AndricLIBADD+=	m
941d0078a2SDimitry Andric
95001ec17eSDimitry AndricSYMLINKS+=	${SHLIB_NAME} ${LIBDIR}/libgomp.so
96001ec17eSDimitry Andric
973c6bb671SDimitry Andric.include <bsd.lib.mk>
98