From 625e2143c6f32cd2a6a02e9ad089cfc087fd94d7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 9 Aug 2024 13:38:00 -0400 Subject: [PATCH] libunwind: Fix build for amd64 using CHERI LLVM The change in upstream commit 0b9e3585805e83718c3ebdab923aca51597193cd only applies to LLVM 18 and later. Defining the macro on the command line raises a -Wmacro-redefined error when using older libunwind versions. --- lib/libgcc_eh/Makefile.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libgcc_eh/Makefile.inc b/lib/libgcc_eh/Makefile.inc index ca25df4cd7eb..12e85962cb13 100644 --- a/lib/libgcc_eh/Makefile.inc +++ b/lib/libgcc_eh/Makefile.inc @@ -18,9 +18,11 @@ SRCS_EXC+= UnwindRegistersSave.S SRCS_EXC+= libunwind.cpp SRCS+= ${SRCS_EXC} +.if ${LIBUNWIND_VERSION} >= 18 .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "powerpc" CFLAGS.UnwindLevel1-gcc-ext.c+= -D_LIBUNWIND_SUPPORT_FRAME_APIS .endif +.endif .for file in ${SRCS_EXC:M*.c} CFLAGS.${file}+= -fno-exceptions -funwind-tables .if ${MK_ASAN} != "no"