From 5ad18e3550f4dec6e095733d39bcc5bc76f741d9 Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 18 Nov 2019 19:54:23 +0000 Subject: [PATCH] Use a big hammer and disabling strict aliasing for the tools build or when using GCC. --- external/apache2/llvm/Makefile.inc | 6 +++--- external/apache2/llvm/lib/libclangAST/Makefile | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/external/apache2/llvm/Makefile.inc b/external/apache2/llvm/Makefile.inc index ac10ad291896..802dff3fc436 100644 --- a/external/apache2/llvm/Makefile.inc +++ b/external/apache2/llvm/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.2 2019/11/14 13:16:35 martin Exp $ +# $NetBSD: Makefile.inc,v 1.3 2019/11/18 19:54:23 joerg Exp $ .if !defined(LLVM_TOPLEVEL_MK) LLVM_TOPLEVEL_MK= @@ -28,7 +28,7 @@ CLANG_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR} LLVM_TOOLCONF_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR} HOST_CPPFLAGS+= ${CPPFLAGS} -HOST_CXXFLAGS+= -O2 -fno-rtti -fno-exceptions +HOST_CXXFLAGS+= -O2 -fno-rtti -fno-exceptions HOST_CPPFLAGS+= -std=c++14 LLVM_TARGETS= x86,powerpc,sparc,aarch64,arm,mips .else @@ -38,7 +38,7 @@ LLVM_INCLUDE_OBJDIR!= cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR} LLVM_TARGETS= x86,powerpc,sparc,aarch64,arm,mips,amdgpu CXXFLAGS+= -std=c++14 -CXXFLAGS+= -fno-rtti -fno-exceptions +CXXFLAGS+= -fno-rtti -fno-exceptions ${${ACTIVE_CC} == "gcc" :? -fno-strict-aliasing :} CXXFLAGS+= -ffunction-sections -fdata-sections LDFLAGS+= -Wl,--gc-sections DPADD+= ${LIBEXECINFO} diff --git a/external/apache2/llvm/lib/libclangAST/Makefile b/external/apache2/llvm/lib/libclangAST/Makefile index 361806b4dcae..06675f53ef76 100644 --- a/external/apache2/llvm/lib/libclangAST/Makefile +++ b/external/apache2/llvm/lib/libclangAST/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2019/11/16 15:51:26 joerg Exp $ +# $NetBSD: Makefile,v 1.3 2019/11/18 19:54:23 joerg Exp $ LIB= clangAST @@ -112,10 +112,6 @@ CLANG_TABLEGEN_OUTPUT= \ .if defined(HOSTLIB) .include -BAD_GCC_VERSION!= case `${HOST_CXX} --version 2> /dev/null` in [cg]++*7.4*) echo yes ;; *) echo no ;; esac -. if ${BAD_GCC_VERSION} == "yes" -HOST_CXXFLAGS+= -O0 -. endif .else .include .endif