diff --git a/config/patches/ruby/ruby-3.1.6-configure.patch b/config/patches/ruby/ruby-3.1.6-configure.patch new file mode 100644 index 000000000..c4b3e464f --- /dev/null +++ b/config/patches/ruby/ruby-3.1.6-configure.patch @@ -0,0 +1,31 @@ +diff --git i/configure.ac w/configure.ac +index fcae66f775e..c933ed8b91f 100644 +--- i/configure.ac ++++ w/configure.ac +@@ -363,6 +363,13 @@ AS_IF([test "$GCC" = yes], [ + icc_version=`echo =__ICC | $CC -E -xc - | sed '/^=/!d;s///;/^__ICC/d'` + test -n "$icc_version" || icc_version=0 + # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"]) ++ ++ AC_CACHE_CHECK([if thread-local storage is supported], [rb_cv_tls_supported], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int __thread conftest;]])], ++ [rb_cv_tls_supported=yes], ++ [rb_cv_tls_supported=no])]) ++ AS_IF([test x"$rb_cv_tls_supported" != xyes], ++ [AC_DEFINE(RB_THREAD_LOCAL_SPECIFIER_IS_UNSUPPORTED)]) + ], [ + linker_flag= + ]) +diff --git i/thread_pthread.h w/thread_pthread.h +index 2ac354046c0..7d4df3e2785 100644 +--- i/thread_pthread.h ++++ w/thread_pthread.h +@@ -72,7 +72,7 @@ typedef struct rb_global_vm_lock_struct { + + #if __STDC_VERSION__ >= 201112 + #define RB_THREAD_LOCAL_SPECIFIER _Thread_local +-#elif defined(__GNUC__) ++#elif defined(__GNUC__) && !defined(RB_THREAD_LOCAL_SPECIFIER_IS_UNSUPPORTED) + /* note that ICC (linux) and Clang are covered by __GNUC__ */ + #define RB_THREAD_LOCAL_SPECIFIER __thread + #else \ No newline at end of file diff --git a/config/software/ruby-msys2-devkit.rb b/config/software/ruby-msys2-devkit.rb index 4a977be9a..a6d4898dd 100644 --- a/config/software/ruby-msys2-devkit.rb +++ b/config/software/ruby-msys2-devkit.rb @@ -60,7 +60,7 @@ version "3.1.6-1" do source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-#{version}-x64.exe", - sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + sha256: "42f71849f0ae053df8d40182e00ee82a98ac5faa69d815fa850566f2d3711174" internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe", authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}" end diff --git a/config/software/ruby.rb b/config/software/ruby.rb index ceb340a88..eec86a720 100644 --- a/config/software/ruby.rb +++ b/config/software/ruby.rb @@ -168,6 +168,10 @@ if suse? && version.satisfies?("= 3.1.4") patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env end + if suse? && version.satisfies?("= 3.1.6") + patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_env + end + # RHEL6 has a base compiler that does not support -fstack-protector-strong, but we # cannot build modern ruby on the RHEL6 base compiler, and the configure script # determines that it supports that flag and so includes it and then ultimately @@ -181,6 +185,8 @@ if rhel? && platform_version.satisfies?(">=7") if version.satisfies?("= 3.1.4") patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env + elsif version.satisfies?("= 3.1.6") + patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_en end end end