1From e74b57febec9bd806e29025e6eeb8091e7021d75 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Sun, 26 Jan 2020 11:27:40 -0800 4Subject: [PATCH] Filter out __has_include* compiler defines 5 6They are internal to compiler and this header is later on includes in C 7files, but newer gcc >= 10 complains about it. 8 9error in initial header file: 10| In file included from /tmp/20200124-86625-14hiju4.c:1: 11| /tmp/20200124-86625-11y6l6i.h:13849:9: error: "__has_include" cannot be used as a macro name 12| 13849 | #define __has_include __has_include 13| | ^~~~~~~~~~~~~ 14| compilation terminated due to -Wfatal-errors. 15 16Upstream-Status: Pending 17Signed-off-by: Khem Raj <raj.khem@gmail.com> 18 19--- 20 common.mk | 2 ++ 21 1 file changed, 2 insertions(+) 22 23diff --git a/common.mk b/common.mk 24index 664f750..3b8fbe6 100644 25--- a/common.mk 26+++ b/common.mk 27@@ -238,6 +238,8 @@ $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJE 28 $(ECHO) building $(@F:.time=.h) 29 $(Q)$(MINIRUBY) $(tooldir)/mjit_tabs.rb "$(MJIT_TABS)" \ 30 $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new 31+ $(Q)sed -i -e "/#define __has_include __has_include/d" $(@F:.time=.h).new 32+ $(Q)sed -i -e "/#define __has_include_next __has_include_next/d" $(@F:.time=.h).new 33 $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new 34 35 $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time 36