[oe-commits] [openembedded-core] 19/32: ruby: Remove __has_include and __has_include_next from preprocessed header file

git at git.openembedded.org git at git.openembedded.org
Sun Jan 26 22:33:42 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6de06d49555e86240fd66d101ecb11cd44984867
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Sun Jan 26 11:27:40 2020 -0800

    ruby: Remove __has_include and __has_include_next from preprocessed header file
    
    one of the build steps ruby has is that it generated rb_mjit_header.h
    during configure using gcc preprocessor using -dD which emits built-in
    defines as well, problem happens when this header is later included in
    subsequent compiles, where compiler errors out stating that an existing
    internal define is redefined
    
    | /tmp/20200123-2021083-2c601q.h:13849:9: error: "__has_include" cannot be used as a macro name
    | 13849 | #define __has_include __has_include
    |       |         ^~~~~~~~~~~~~
    | compilation terminated due to -Wfatal-errors.
    
    Since compiler already will take care of it internally we can edit it
    out from this header file
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../ruby/ruby/remove_has_include_macros.patch      | 26 ++++++++++++++++++++++
 meta/recipes-devtools/ruby/ruby_2.6.5.bb           |  1 +
 2 files changed, 27 insertions(+)

diff --git a/meta/recipes-devtools/ruby/ruby/remove_has_include_macros.patch b/meta/recipes-devtools/ruby/ruby/remove_has_include_macros.patch
new file mode 100644
index 0000000..a1e6330
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/remove_has_include_macros.patch
@@ -0,0 +1,26 @@
+Filter out __has_include* compiler defines
+
+They are internal to compiler and this header is later on includes in C
+files, but newer gcc >= 10 complains about it.
+
+error in initial header file:
+| In file included from /tmp/20200124-86625-14hiju4.c:1:
+| /tmp/20200124-86625-11y6l6i.h:13849:9: error: "__has_include" cannot be used as a macro name
+| 13849 | #define __has_include __has_include
+|       |         ^~~~~~~~~~~~~
+| compilation terminated due to -Wfatal-errors.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+
+--- a/common.mk
++++ b/common.mk
+@@ -221,6 +221,8 @@ $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT
+ 		$(TIMESTAMPDIR)/$(arch)/.time
+ 	$(ECHO) building $(@F:.time=.h)
+ 	$(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new
++	$(Q)sed -i -e "/#define __has_include __has_include/d" $(@F:.time=.h).new
++	$(Q)sed -i -e "/#define __has_include_next __has_include_next/d" $(@F:.time=.h).new
+ 	$(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new
+ 
+ $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time
diff --git a/meta/recipes-devtools/ruby/ruby_2.6.5.bb b/meta/recipes-devtools/ruby/ruby_2.6.5.bb
index 1828f65..0cdf6ee 100644
--- a/meta/recipes-devtools/ruby/ruby_2.6.5.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.6.5.bb
@@ -2,6 +2,7 @@ require ruby.inc
 
 SRC_URI += " \
            file://0003-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \
+           file://remove_has_include_macros.patch \
            file://run-ptest \
            "
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list