diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-03-06 08:13:55 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-03-06 08:13:55 +0000 |
commit | e7901272c51556557c87bcdf278c392f3c264dd3 (patch) | |
tree | 7091ccc7e68bcb6cf7a8bd3b79f14463294d580e /gnu/usr.bin/clang | |
parent | e5d538f8ac60586743024390762a43835d9787e4 (diff) |
Define LLVM_NATIVE_* in llvm-config.h like the result of a cmake
build so external users of Support/TargetSelect.h will work correctly.
Previously these were defined via -D in CPPFLAGS.
Fixes llvmpipe erroring out due to no targets being registered.
ok patrick@
Diffstat (limited to 'gnu/usr.bin/clang')
-rw-r--r-- | gnu/usr.bin/clang/Makefile.inc | 11 | ||||
-rw-r--r-- | gnu/usr.bin/clang/include/llvm/Config/Makefile | 15 | ||||
-rw-r--r-- | gnu/usr.bin/clang/include/llvm/Config/llvm-config.h.in | 27 |
3 files changed, 12 insertions, 41 deletions
diff --git a/gnu/usr.bin/clang/Makefile.inc b/gnu/usr.bin/clang/Makefile.inc index 5c5685548c4..fdaf8133a36 100644 --- a/gnu/usr.bin/clang/Makefile.inc +++ b/gnu/usr.bin/clang/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.12 2019/01/19 00:02:15 tedu Exp $ +# $OpenBSD: Makefile.inc,v 1.13 2019/03/06 08:13:54 jsg Exp $ LLVM_SRCS?= ${.CURDIR}/../../../llvm @@ -40,17 +40,8 @@ TRIPLE= armv7-unknown-openbsd${OSREV}-gnueabi .else TRIPLE= ${MACHINE_ARCH}-unknown-openbsd${OSREV} .endif -CPPFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TRIPLE}\" -CPPFLAGS+= -DLLVM_HOST_TRIPLE=\"${TRIPLE}\" CPPFLAGS+= -DLLVM_PREFIX=\"/usr\" .include "Makefile.arch" -CPPFLAGS+=-DLLVM_NATIVE_ARCH=\"${LLVM_ARCH}\" -CPPFLAGS+=-DLLVM_NATIVE_ASMPARSER=LLVMInitialize${LLVM_ARCH}AsmParser -CPPFLAGS+=-DLLVM_NATIVE_ASMPRINTER=LLVMInitialize${LLVM_ARCH}AsmPrinter -CPPFLAGS+=-DLLVM_NATIVE_DISASSEMBLER=LLVMInitialize${LLVM_ARCH}Disassembler -CPPFLAGS+=-DLLVM_NATIVE_TARGET=LLVMInitialize${LLVM_ARCH}Target -CPPFLAGS+=-DLLVM_NATIVE_TARGETINFO=LLVMInitialize${LLVM_ARCH}TargetInfo -CPPFLAGS+=-DLLVM_NATIVE_TARGETMC=LLVMInitialize${LLVM_ARCH}TargetMC CPPFLAGS+=-DLLDB_DISABLE_PYTHON # upstream defaults diff --git a/gnu/usr.bin/clang/include/llvm/Config/Makefile b/gnu/usr.bin/clang/include/llvm/Config/Makefile index a4042a33210..a8d29f2b0f0 100644 --- a/gnu/usr.bin/clang/include/llvm/Config/Makefile +++ b/gnu/usr.bin/clang/include/llvm/Config/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2019/03/05 09:44:39 jsg Exp $ +# $OpenBSD: Makefile,v 1.6 2019/03/06 08:13:54 jsg Exp $ .include <bsd.own.mk> @@ -27,9 +27,16 @@ Targets.def: llvm-config.h: llvm-config.h.in cp ${.CURDIR}/llvm-config.h.in $@ - echo "\n#define LLVM_DEFAULT_TARGET_TRIPLE \"${TRIPLE}\"" >> $@ - echo "#define LLVM_HOST_TRIPLE \"${TRIPLE}\"" >> $@ - echo "\n#endif" >> $@ + printf "\n#define LLVM_DEFAULT_TARGET_TRIPLE \"${TRIPLE}\"\n" >> $@ + printf "#define LLVM_HOST_TRIPLE \"${TRIPLE}\"\n" >> $@ + printf "#define LLVM_NATIVE_ARCH ${LLVM_ARCH}\n" >> $@ + printf "#define LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_ARCH}AsmParser\n" >> $@ + printf "#define LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_ARCH}AsmPrinter\n" >> $@ + printf "#define LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_ARCH}Disassembler\n" >> $@ + printf "#define LLVM_NATIVE_TARGET LLVMInitialize${LLVM_ARCH}Target\n" >> $@ + printf "#define LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_ARCH}TargetInfo\n" >> $@ + printf "#define LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_ARCH}TargetMC\n" >> $@ + printf "\n#endif\n" >> $@ install includes: ${DEFS} ${INSTALL} -d -m 755 ${DESTDIR}${INCDIR} diff --git a/gnu/usr.bin/clang/include/llvm/Config/llvm-config.h.in b/gnu/usr.bin/clang/include/llvm/Config/llvm-config.h.in index 13c04b5983c..ffde9035a98 100644 --- a/gnu/usr.bin/clang/include/llvm/Config/llvm-config.h.in +++ b/gnu/usr.bin/clang/include/llvm/Config/llvm-config.h.in @@ -32,39 +32,12 @@ /* Define if we link Polly to the tools */ /* #undef LINK_POLLY_INTO_TOOLS */ -/* Target triple LLVM will generate code for by default */ -/* #define LLVM_DEFAULT_TARGET_TRIPLE "amd64-unknown-openbsd6.0" */ - /* Define if threads enabled */ #define LLVM_ENABLE_THREADS 1 /* Has gcc/MSVC atomic intrinsics */ #define LLVM_HAS_ATOMICS 1 -/* Host triple LLVM will be executed on */ -/* #define LLVM_HOST_TRIPLE "amd64-unknown-openbsd6.0" */ - -/* LLVM architecture name for the native architecture, if available */ -/* #define LLVM_NATIVE_ARCH X86 */ - -/* LLVM name for the native AsmParser init function, if available */ -/* #define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser */ - -/* LLVM name for the native AsmPrinter init function, if available */ -/* #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter */ - -/* LLVM name for the native Disassembler init function, if available */ -/* #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler */ - -/* LLVM name for the native Target init function, if available */ -/* #define LLVM_NATIVE_TARGET LLVMInitializeX86Target */ - -/* LLVM name for the native TargetInfo init function, if available */ -/* #define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo */ - -/* LLVM name for the native target MC init function, if available */ -/* #define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC */ - /* Define if this is Unixish platform */ #define LLVM_ON_UNIX 1 |