Skip to content

Install Error with gcc 15.1.0 #315

@Watson1978

Description

@Watson1978

After I updated gcc version to 15.1, it can't install bigdecimal with following compile error.

PS C:\> ruby -v
ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [i386-mingw32]

PS C:\> ridk exec gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/Ruby34/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.2.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-14.2.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --enable-checking=release --with-arch=pentium4 --with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++,fortran --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --disable-sjlj-exceptions --with-dwarf2 --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (Rev3, Built by MSYS2 project)

PS C:\> gem install bigdecimal
Building native extensions. This could take a while...
Successfully installed bigdecimal-3.1.9
1 gem installed


PS C:\> ridk exec pacman -Syyu
:: パッケージデータベースの同期中...
 clangarm64                                                                                          471.9 KiB   133 KiB/s 00:04 [#############################################################################] 100%
 mingw32                                                                                             145.0 KiB  50.9 KiB/s 00:03 [#############################################################################] 100%
 mingw64                                                                                             458.6 KiB   213 KiB/s 00:02 [#############################################################################] 100%
 ucrt64                                                                                              498.8 KiB   257 KiB/s 00:02 [#############################################################################] 100%
 clang64                                                                                             486.2 KiB   248 KiB/s 00:02 [#############################################################################] 100%
 msys                                                                                                492.3 KiB   218 KiB/s 00:02 [#############################################################################] 100%
:: コアシステムの更新を開始...
 何も行うことがありません
:: システム全体の更新を開始...
:: mingw-w64-i686-pkg-config を mingw32/mingw-w64-i686-pkgconf に置き換えますか? [Y/n] y
依存関係を解決しています...
衝突するパッケージがないか確認しています...

パッケージ (11) mingw-w64-i686-crt-git-12.0.0.r679.g71699efcb-1  mingw-w64-i686-gcc-15.1.0-1  mingw-w64-i686-gcc-libs-15.1.0-1  mingw-w64-i686-gettext-runtime-0.24-2
                mingw-w64-i686-headers-git-12.0.0.r679.g71699efcb-1  mingw-w64-i686-libmangle-git-12.0.0.r679.g71699efcb-1  mingw-w64-i686-libwinpthread-git-12.0.0.r679.g71699efcb-1
                mingw-w64-i686-pkg-config-0.29.2-6 [削除]  mingw-w64-i686-pkgconf-1~2.3.0-1  mingw-w64-i686-tools-git-12.0.0.r679.g71699efcb-1  mingw-w64-i686-winpthreads-git-12.0.0.r679.g71699efcb-1

合計ダウンロード容量:         56.45 MiB
合計インストール容量:        399.36 MiB
最終的なアップグレード容量:   10.90 MiB

:: インストールを行いますか? [Y/n] 
:: パッケージを取得します...
 mingw-w64-i686-tools-git-12.0.0.r679.g71699efcb-1-any                                               322.6 KiB   287 KiB/s 00:01 [#############################################################################] 100%
 mingw-w64-i686-gcc-libs-15.1.0-1-any                                                               1101.8 KiB   517 KiB/s 00:02 [#############################################################################] 100%
 mingw-w64-i686-headers-git-12.0.0.r679.g71699efcb-1-any                                               6.4 MiB  2.38 MiB/s 00:03 [#############################################################################] 100%
 mingw-w64-i686-gcc-15.1.0-1-any                                                                      44.4 MiB  14.4 MiB/s 00:03 [#############################################################################] 100%
 mingw-w64-i686-pkgconf-1~2.3.0-1-any                                                                 90.5 KiB  94.4 KiB/s 00:01 [#############################################################################] 100%
 mingw-w64-i686-libwinpthread-git-12.0.0.r679.g71699efcb-1-any                                        33.0 KiB  77.5 KiB/s 00:00 [#############################################################################] 100%
 mingw-w64-i686-libmangle-git-12.0.0.r679.g71699efcb-1-any                                            21.7 KiB  52.2 KiB/s 00:00 [#############################################################################] 100%
 mingw-w64-i686-winpthreads-git-12.0.0.r679.g71699efcb-1-any                                          41.0 KiB  27.5 KiB/s 00:01 [#############################################################################] 100%
 mingw-w64-i686-gettext-runtime-0.24-2-any                                                           319.3 KiB  92.5 KiB/s 00:03 [#############################################################################] 100%
 mingw-w64-i686-crt-git-12.0.0.r679.g71699efcb-1-any                                                   3.8 MiB   744 KiB/s 00:05 [#############################################################################] 100%
 合計 (10/10)                                                                                         56.4 MiB  9.88 MiB/s 00:06 [#############################################################################] 100%
(10/10) キーリングのキーを確認                                                                                                   [#############################################################################] 100%
(10/10) パッケージの整合性をチェック                                                                                             [#############################################################################] 100%
(10/10) パッケージファイルのロード                                                                                               [#############################################################################] 100%
(10/10) ファイルの衝突をチェック                                                                                                 [#############################################################################] 100%
(11/11) 空き容量を確認                                                                                                           [#############################################################################] 100%
:: パッケージの変更を処理しています...
(1/1) 削除 mingw-w64-i686-pkg-config                                                                                             [#############################################################################] 100%
( 1/10) 更新 mingw-w64-i686-headers-git                                                                                          [#############################################################################] 100%
( 2/10) 更新 mingw-w64-i686-crt-git                                                                                              [#############################################################################] 100%
( 3/10) 更新 mingw-w64-i686-libwinpthread-git                                                                                    [#############################################################################] 100%
( 4/10) 更新 mingw-w64-i686-gcc-libs                                                                                             [#############################################################################] 100%
( 5/10) 更新 mingw-w64-i686-winpthreads-git                                                                                      [#############################################################################] 100%
( 6/10) 更新 mingw-w64-i686-gettext-runtime                                                                                      [#############################################################################] 100%
( 7/10) 更新 mingw-w64-i686-gcc                                                                                                  [#############################################################################] 100%
( 8/10) 更新 mingw-w64-i686-libmangle-git                                                                                        [#############################################################################] 100%
( 9/10) インストール mingw-w64-i686-pkgconf                                                                                      [#############################################################################] 100%
(10/10) 更新 mingw-w64-i686-tools-git                                                                                            [#############################################################################] 100%


PS C:\> ridk exec gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/Ruby34/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/15.1.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-15.1.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --with-native-system-header-dir=/mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --enable-checking=release --with-arch=pentium4 --with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++,fortran --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --disable-sjlj-exceptions --with-dwarf2 --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (Rev1, Built by MSYS2 project) 


PS C:\> gem install bigdecimal --verbose
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing bigdecimal:
	ERROR: Failed to build gem native extension.

    current directory: C:/Ruby34/lib/ruby/gems/3.4.0/gems/bigdecimal-3.1.9/ext/bigdecimal
C:/Ruby34/bin/ruby.exe extconf.rb
checking for __builtin_clz()... yes
checking for __builtin_clzl()... yes
checking for __builtin_clzll()... yes
checking for float.h... yes
checking for math.h... yes
checking for stdbool.h... yes
checking for stdlib.h... yes
checking for x86intrin.h... yes
checking for _lzcnt_u32() in x86intrin.h... no
checking for _lzcnt_u64() in x86intrin.h... no
checking for intrin.h... yes
checking for __lzcnt() in intrin.h... no
checking for __lzcnt64() in intrin.h... no
checking for _BitScanReverse() in intrin.h... yes
checking for _BitScanReverse64() in intrin.h... no
checking for labs() in stdlib.h... yes
checking for llabs() in stdlib.h... yes
checking for finite() in math.h... yes
checking for isfinite() in math.h... no
checking for ruby/atomic.h... yes
checking for ruby/internal/has/builtin.h... yes
checking for ruby/internal/static_assert.h... yes
checking for rb_rational_num() in ruby.h... yes
checking for rb_rational_den() in ruby.h... yes
checking for rb_complex_real() in ruby.h... yes
checking for rb_complex_imag() in ruby.h... yes
checking for rb_opts_exception_p() in ruby.h... yes
checking for rb_category_warn() in ruby.h... yes
checking for RB_WARN_CATEGORY_DEPRECATED in ruby.h... yes
creating Makefile

current directory: C:/Ruby34/lib/ruby/gems/3.4.0/gems/bigdecimal-3.1.9/ext/bigdecimal
make DESTDIR\= sitearchdir\=./.gem.20250429-10432-kecvt8 sitelibdir\=./.gem.20250429-10432-kecvt8 clean

current directory: C:/Ruby34/lib/ruby/gems/3.4.0/gems/bigdecimal-3.1.9/ext/bigdecimal
make DESTDIR\= sitearchdir\=./.gem.20250429-10432-kecvt8 sitelibdir\=./.gem.20250429-10432-kecvt8
generating bigdecimal-i386-mingw32.def
compiling bigdecimal.c
bigdecimal.c: In function 'Init_bigdecimal':
bigdecimal.c:4439:45: error: passing argument 2 of 'rb_define_global_function' from incompatible pointer type [-Wincompatible-pointer-types]
 4439 |     rb_define_global_function("BigDecimal", f_BigDecimal, -1);
      |                                             ^~~~~~~~~~~~
      |                                             |
      |                                             VALUE (*)(int,  VALUE *, VALUE) {aka long unsigned int (*)(int,  long unsigned int *, long unsigned int)}
In file included from C:/Ruby34/include/ruby-3.4.0/ruby/internal/anyargs.h:78,
                 from C:/Ruby34/include/ruby-3.4.0/ruby/ruby.h:27,
                 from bigdecimal.h:13,
                 from bigdecimal.c:11:
C:/Ruby34/include/ruby-3.4.0/ruby/internal/method.h:124:57: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long unsigned int (*)(int,  long unsigned int *, long unsigned int)'}
  124 | void rb_define_global_function(const char *mid, VALUE (*func)(ANYARGS), int arity);
      |                                                 ~~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:3745:1: note: 'f_BigDecimal' declared here
 3745 | f_BigDecimal(int argc, VALUE *argv, VALUE self)
      | ^~~~~~~~~~~~
bigdecimal.c:4444:69: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4444 |     rb_define_singleton_method(rb_cBigDecimal, "interpret_loosely", BigDecimal_s_interpret_loosely, 1);
      |                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                     |
      |                                                                     VALUE (*)(VALUE,  VALUE) {aka long unsigned int (*)(long unsigned int,  long unsigned int)}
In file included from C:/Ruby34/include/ruby-3.4.0/ruby/internal/anyargs.h:76:
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE,  VALUE)' {aka 'long unsigned int (*)(long unsigned int,  long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:3781:1: note: 'BigDecimal_s_interpret_loosely' declared here
 3781 | BigDecimal_s_interpret_loosely(VALUE klass, VALUE str)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bigdecimal.c:4445:56: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4445 |     rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1);
      |                                                        ^~~~~~~~~~~~~~~
      |                                                        |
      |                                                        VALUE (*)(int,  VALUE *, VALUE) {aka long unsigned int (*)(int,  long unsigned int *, long unsigned int)}
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long unsigned int (*)(int,  long unsigned int *, long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:1065:1: note: 'BigDecimal_mode' declared here
 1065 | BigDecimal_mode(int argc, VALUE *argv, VALUE self)
      | ^~~~~~~~~~~~~~~
bigdecimal.c:4446:57: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4446 |     rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1);
      |                                                         ^~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         VALUE (*)(int,  VALUE *, VALUE) {aka long unsigned int (*)(int,  long unsigned int *, long unsigned int)}
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long unsigned int (*)(int,  long unsigned int *, long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:3804:1: note: 'BigDecimal_limit' declared here
 3804 | BigDecimal_limit(int argc, VALUE *argv, VALUE self)
      | ^~~~~~~~~~~~~~~~
bigdecimal.c:4447:62: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4447 |     rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0);
      |                                                              ^~~~~~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE)' {aka 'long unsigned int (*)(long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:480:1: note: 'BigDecimal_double_fig' declared here
  480 | BigDecimal_double_fig(VALUE self)
      | ^~~~~~~~~~~~~~~~~~~~~
bigdecimal.c:4448:57: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4448 |     rb_define_singleton_method(rb_cBigDecimal, "_load", BigDecimal_load, 1);
      |                                                         ^~~~~~~~~~~~~~~
      |                                                         |
      |                                                         VALUE (*)(VALUE,  VALUE) {aka long unsigned int (*)(long unsigned int,  long unsigned int)}
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE,  VALUE)' {aka 'long unsigned int (*)(long unsigned int,  long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:805:1: note: 'BigDecimal_load' declared here
  805 | BigDecimal_load(VALUE self, VALUE str)
      | ^~~~~~~~~~~~~~~

... (snip) ...


bigdecimal.c:4640:52: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
 4640 |     rb_define_singleton_method(rb_mBigMath, "log", BigMath_s_log, 2);
      |                                                    ^~~~~~~~~~~~~
      |                                                    |
      |                                                    VALUE (*)(VALUE,  VALUE,  VALUE) {aka long unsigned int (*)(long unsigned int,  long unsigned int,  long unsigned int)}
C:/Ruby34/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE,  VALUE,  VALUE)' {aka 'long unsigned int (*)(long unsigned int,  long unsigned int,  long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
bigdecimal.c:4069:1: note: 'BigMath_s_log' declared here
 4069 | BigMath_s_log(VALUE klass, VALUE x, VALUE vprec)
      | ^~~~~~~~~~~~~
make: *** [Makefile:252: bigdecimal.o] エラー 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby34/lib/ruby/gems/3.4.0/gems/bigdecimal-3.1.9 for inspection.
Results logged to C:/Ruby34/lib/ruby/gems/3.4.0/extensions/x86-mingw32/3.4.0/bigdecimal-3.1.9/gem_make.out

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions