Actions
Bug #21920
closedLIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
Bug #21920:
LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-02-21 master e730ac41be) +PRISM [aarch64-mingw-ucrt]
Description
That recent commit introduced MAINLIBS into LIBRUBYARG_SHARED: https://github.com/ruby/ruby/commit/d256629bf9e194838d1837be74dcc0b8ff0bcfd6
Before that commit:
CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME)"
CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static $(MAINLIBS)"
RbConfig::CONFIG["LIBRUBYARG_SHARED"] # => "-laarch64-ucrt-ruby410"
After that commit:
CONFIG["LIBRUBYARG_SHARED"] = "-l$(RUBY_SO_NAME) $(MAINLIBS)"
CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static $(MAINLIBS)"
RbConfig::CONFIG["LIBRUBYARG_SHARED"] # => "-laarch64-ucrt-ruby410 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt"
To my understanding MAINLIBS are only for static linking and these libraries are not necessary for shared linking.
This breaks RubyInstaller for Windows, since all C extensions are linked with LIBRUBYARG_SHARED and the RubyInstaller distribution ships libgmp-10.dll only but not related the libgmp.a file. The same happens on x86_64. It is probably an issue on other operating systems as well.
A CI failure log is here: https://github.com/oneclick/rubyinstaller2/actions/runs/22238372563/job/64335608163#step:36:32
Actions