Add build infrastructure for the libclang_rt.profile library.
authorfcambus <fcambus@openbsd.org>
Wed, 15 Sep 2021 10:21:30 +0000 (10:21 +0000)
committerfcambus <fcambus@openbsd.org>
Wed, 15 Sep 2021 10:21:30 +0000 (10:21 +0000)
Not linking it to the build yet.

"go for it" mortimer@

gnu/lib/libclang_rt/profile/Makefile [new file with mode: 0644]

diff --git a/gnu/lib/libclang_rt/profile/Makefile b/gnu/lib/libclang_rt/profile/Makefile
new file mode 100644 (file)
index 0000000..8442ee1
--- /dev/null
@@ -0,0 +1,52 @@
+# $OpenBSD: Makefile,v 1.1 2021/09/15 10:21:30 fcambus Exp $
+
+.include <bsd.own.mk>
+
+LLVM_V=                11.1.0
+LIBDIR=                /usr/lib/clang/${LLVM_V}/lib
+
+.if ${COMPILER_VERSION:L} != "clang"
+CC=            clang
+CXX=           clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
+
+LIB=   clang_rt.profile
+NOPIC=
+NOPROFILE=
+
+CFLAGS+=       -fPIC -std=gnu99 -fvisibility=hidden -fno-stack-protector
+CFLAGS+=       -DCOMPILER_RT_HAS_ATOMICS=1
+CFLAGS+=       -DCOMPILER_RT_HAS_FCNTL_LCK=1
+CFLAGS+=       -DCOMPILER_RT_HAS_UNAME=1
+CPPFLAGS+=     -DVISIBILITY_HIDDEN
+CPPFLAGS+=     -I${BSDSRCDIR}/gnu/llvm/compiler-rt/include/
+
+.PATH: ${.CURDIR}/../../../llvm/compiler-rt/lib/profile
+
+SRCS+=         GCDAProfiling.c \
+               InstrProfiling.c \
+               InstrProfilingBiasVar.c \
+               InstrProfilingBuffer.c \
+               InstrProfilingFile.c \
+               InstrProfilingInternal.c \
+               InstrProfilingMerge.c \
+               InstrProfilingMergeFile.c \
+               InstrProfilingNameVar.c \
+               InstrProfilingPlatformOther.c \
+               InstrProfilingRuntime.cpp \
+               InstrProfilingUtil.c \
+               InstrProfilingValue.c \
+               InstrProfilingWriter.c
+
+beforeinstall:
+       ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${DIRMODE} \
+               ${DESTDIR}${LIBDIR}
+
+.include <bsd.lib.mk>
+
+.else
+NOPROG=
+.include <bsd.prog.mk>
+.endif