commit: 09b4524862a03f6e11a9e42d7913f82c66e65b63
Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 8 08:23:12 2024 +0000
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Fri Dec 13 13:10:51 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09b45248
ruby-fakegem.eclass: compile ruby31 extensions with gnu17
The varargs implementation in Ruby 3.2 is not compatible with gnu23. Ruby
3.1 is in security maintenance mode upstream so it is unlikely that the
fixes from Ruby 3.2 will be backported. Ruby 3.1 is EOL in March 2025
and will be removed from Gentoo around that time.
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
eclass/ruby-fakegem.eclass | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index eb6257a50cf9..fc78428be714 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -23,6 +23,8 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
+# flag-o-matic is only required for ruby31 support.
+inherit flag-o-matic
inherit ruby-ng
# @ECLASS_VARIABLE: RUBY_FAKEGEM_NAME
@@ -424,6 +426,16 @@ EOF
each_fakegem_configure() {
debug-print-function ${FUNCNAME} "$@"
+ # Ruby 3.1 has a varargs implementation that is not compatible with
+ # gnu23. Ruby 3.1 is EOL in March 2025 and will be removed shortly
+ # after that.
+ case ${RUBY} in
+ *ruby31)
+ append-flags -std=gnu17
+ filter-flags -std=gnu23
+ ;;
+ esac
+
tc-export PKG_CONFIG
for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
CC=$(tc-getCC) ${RUBY} --disable=did_you_mean -C
${extension%/*} ${extension##*/} --with-cflags="${CFLAGS}"
--with-ldflags="${LDFLAGS}" ${RUBY_FAKEGEM_EXTENSION_OPTIONS} || die