diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-01-26 11:27:40 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:48:09 +0000 |
commit | 614f764707e53acb346a6ab017871f689f114d09 (patch) | |
tree | c1c4015339078735a894f712f84ac7c7c6177d60 /meta/recipes-devtools/ruby | |
parent | d52913fe1991b41c5d5f68dd591a7a77cd6b4728 (diff) | |
download | poky-614f764707e53acb346a6ab017871f689f114d09.tar.gz |
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
(From OE-Core rev: b4f0df9a0e998af746bcd84cb81ea4ba0107f989)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/ruby')
-rw-r--r-- | meta/recipes-devtools/ruby/ruby/remove_has_include_macros.patch | 26 | ||||
-rw-r--r-- | meta/recipes-devtools/ruby/ruby_2.6.5.bb | 1 |
2 files changed, 27 insertions, 0 deletions
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 0000000000..a1e6330445 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/remove_has_include_macros.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Filter out __has_include* compiler defines | ||
2 | |||
3 | They are internal to compiler and this header is later on includes in C | ||
4 | files, but newer gcc >= 10 complains about it. | ||
5 | |||
6 | error in initial header file: | ||
7 | | In file included from /tmp/20200124-86625-14hiju4.c:1: | ||
8 | | /tmp/20200124-86625-11y6l6i.h:13849:9: error: "__has_include" cannot be used as a macro name | ||
9 | | 13849 | #define __has_include __has_include | ||
10 | | | ^~~~~~~~~~~~~ | ||
11 | | compilation terminated due to -Wfatal-errors. | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | |||
16 | --- a/common.mk | ||
17 | +++ b/common.mk | ||
18 | @@ -221,6 +221,8 @@ $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT | ||
19 | $(TIMESTAMPDIR)/$(arch)/.time | ||
20 | $(ECHO) building $(@F:.time=.h) | ||
21 | $(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new | ||
22 | + $(Q)sed -i -e "/#define __has_include __has_include/d" $(@F:.time=.h).new | ||
23 | + $(Q)sed -i -e "/#define __has_include_next __has_include_next/d" $(@F:.time=.h).new | ||
24 | $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new | ||
25 | |||
26 | $(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 1828f65d51..0cdf6ee09f 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 | |||
2 | 2 | ||
3 | SRC_URI += " \ | 3 | SRC_URI += " \ |
4 | file://0003-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ | 4 | file://0003-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ |
5 | file://remove_has_include_macros.patch \ | ||
5 | file://run-ptest \ | 6 | file://run-ptest \ |
6 | " | 7 | " |
7 | 8 | ||