From 51ea623227ae433c9b1441e59021dc753b9ac053 Mon Sep 17 00:00:00 2001 From: fcambus Date: Wed, 15 Sep 2021 10:21:30 +0000 Subject: [PATCH] Add build infrastructure for the libclang_rt.profile library. Not linking it to the build yet. "go for it" mortimer@ --- gnu/lib/libclang_rt/profile/Makefile | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 gnu/lib/libclang_rt/profile/Makefile diff --git a/gnu/lib/libclang_rt/profile/Makefile b/gnu/lib/libclang_rt/profile/Makefile new file mode 100644 index 00000000000..8442ee1d57b --- /dev/null +++ b/gnu/lib/libclang_rt/profile/Makefile @@ -0,0 +1,52 @@ +# $OpenBSD: Makefile,v 1.1 2021/09/15 10:21:30 fcambus Exp $ + +.include + +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 + +.else +NOPROG= +.include +.endif -- 2.20.1