Module Name: src
Committed By: mrg
Date: Thu Jun 20 04:13:35 UTC 2024
Modified Files:
src/external/apache2/llvm/lib: Makefile.inc
src/external/apache2/llvm/lib/libclangSema: Makefile
Log Message:
fix building llvm with GCC 12 as a native host.
there's a specific header in llvm that is triggering a warning-as-error.
apply some ${CC_WNO_MISSING_TEMPLATE_KEYWORD} to avoid eg:
external/apache2/llvm/lib/libLLVMAArch64AsmParser/../../dist/llvm/include/llvm/ADT/PointerSumType.h:275:21:
error: expected 'template' keyword before dependent template name
[-Werror=missing-template-keyword]
275 | return SumType::create<SomeTag>(SomePointerInfo::getEmptyKey());
| ^~~~~~
additionally, for libclangSema, this error is avoided:
external/apache2/llvm/lib/libclangSema/../../dist/llvm/include/llvm/ADT/APInt.h:338:18:
error: 'void operator delete [](void*)' called on a pointer to an unallocated
object '1' [-Werror=free-nonheap-object]
338 | delete[] U.pVal;
| ^~~~
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/apache2/llvm/lib/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/external/apache2/llvm/lib/libclangSema/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/apache2/llvm/lib/Makefile.inc
diff -u src/external/apache2/llvm/lib/Makefile.inc:1.1 src/external/apache2/llvm/lib/Makefile.inc:1.2
--- src/external/apache2/llvm/lib/Makefile.inc:1.1 Mon Nov 11 22:45:02 2019
+++ src/external/apache2/llvm/lib/Makefile.inc Thu Jun 20 04:13:35 2024
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.1 2019/11/11 22:45:02 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.2 2024/06/20 04:13:35 mrg Exp $
LIBISPRIVATE= yes
.include "${.PARSEDIR}/../Makefile.inc"
+
+CXXFLAGS+= ${CC_WNO_MISSING_TEMPLATE_KEYWORD}
Index: src/external/apache2/llvm/lib/libclangSema/Makefile
diff -u src/external/apache2/llvm/lib/libclangSema/Makefile:1.2 src/external/apache2/llvm/lib/libclangSema/Makefile:1.3
--- src/external/apache2/llvm/lib/libclangSema/Makefile:1.2 Sun May 30 01:56:57 2021
+++ src/external/apache2/llvm/lib/libclangSema/Makefile Thu Jun 20 04:13:35 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2021/05/30 01:56:57 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2024/06/20 04:13:35 mrg Exp $
LIB= clangSema
@@ -69,3 +69,5 @@ CLANG_TABLEGEN_OUTPUT= \
.else
.include <bsd.lib.mk>
.endif
+
+CWARNFLAGS.gcc+= -Wno-free-nonheap-object