* [ruby-core:124855] [Ruby Bug#21920] LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
@ 2026-02-20 21:24 larskanis (Lars Kanis) via ruby-core
2026-02-21 7:55 ` [ruby-core:124859] " byroot (Jean Boussier) via ruby-core
0 siblings, 1 reply; 2+ messages in thread
From: larskanis (Lars Kanis) via ruby-core @ 2026-02-20 21:24 UTC (permalink / raw)
To: ruby-core; +Cc: larskanis (Lars Kanis)
Issue #21920 has been reported by larskanis (Lars Kanis).
----------------------------------------
Bug #21920: LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
https://bugs.ruby-lang.org/issues/21920
* Author: larskanis (Lars Kanis)
* Status: Open
* ruby -v: ruby 4.1.0dev (2026-02-21 master e730ac41be) +PRISM [aarch64-mingw-ucrt]
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN
----------------------------------------
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
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-core:124859] [Ruby Bug#21920] LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
2026-02-20 21:24 [ruby-core:124855] [Ruby Bug#21920] LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking larskanis (Lars Kanis) via ruby-core
@ 2026-02-21 7:55 ` byroot (Jean Boussier) via ruby-core
0 siblings, 0 replies; 2+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2026-02-21 7:55 UTC (permalink / raw)
To: ruby-core; +Cc: byroot (Jean Boussier)
Issue #21920 has been updated by byroot (Jean Boussier).
Status changed from Open to Closed
Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONTNEED
The commit was reverted https://github.com/ruby/ruby/pull/16212, it should be fixed now.
----------------------------------------
Bug #21920: LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking
https://bugs.ruby-lang.org/issues/21920#change-116513
* Author: larskanis (Lars Kanis)
* Status: Closed
* ruby -v: ruby 4.1.0dev (2026-02-21 master e730ac41be) +PRISM [aarch64-mingw-ucrt]
* Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONTNEED
----------------------------------------
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
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-21 7:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-20 21:24 [ruby-core:124855] [Ruby Bug#21920] LIBRUBYARG_SHARED contains -lgmp and other libraries for static linking larskanis (Lars Kanis) via ruby-core
2026-02-21 7:55 ` [ruby-core:124859] " byroot (Jean Boussier) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).