* [ruby-core:122289] [Ruby Bug#21372] Ruby is passing clang specific flags to GCC 15 and native gem doesn't build.
@ 2025-05-25 14:51 skatkov (Stanislav (Stas) Katkov) via ruby-core
2025-05-28 14:30 ` [ruby-core:122329] " alanwu (Alan Wu) via ruby-core
0 siblings, 1 reply; 2+ messages in thread
From: skatkov (Stanislav (Stas) Katkov) via ruby-core @ 2025-05-25 14:51 UTC (permalink / raw)
To: ruby-core; +Cc: skatkov (Stanislav (Stas) Katkov)
Issue #21372 has been reported by skatkov (Stanislav (Stas) Katkov).
----------------------------------------
Bug #21372: Ruby is passing clang specific flags to GCC 15 and native gem doesn't build.
https://bugs.ruby-lang.org/issues/21372
* Author: skatkov (Stanislav (Stas) Katkov)
* Status: Open
* ruby -v: ruby 3.4.4
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Fedora 42 has ompilation errors while running `gem install extlz4`.
```sh
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
make: *** [Makefile:251: blockapi.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/sk/.local/share/mise/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/extlz4-0.3.4 for inspection.
Results logged to /home/sk/.local/share/mise/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/extensions/x86_64-linux/3.4.0/extlz4-0.3.4/gem_make.out
```
I have submitted a ticket with a gem, but I have hunch that this might not be an issue with a gem, but rather a ruby compatibility issue with the new GCC (15).
@see https://github.com/dearblue/ruby-extlz4/issues/6
I have very little experience with C and how compilation works. But as far as I can understand, ruby was compiled with clang and is now passing some CLANG specifics flags to GCC 15 during native gem compilation - this causes a compilation error.
```sh
ruby -rrbconfig -e 'puts RbConfig::CONFIG["warnflags"].split(/\s+/).grep(/-Wno-/).sort'
-Wno-cast-function-type
-Wno-constant-logical-operand
-Wno-long-long
-Wno-missing-field-initializers
-Wno-overlength-strings
-Wno-packed-bitfield-compat
-Wno-parentheses-equality
-Wno-self-assign
-Wno-tautological-compare
-Wno-unused-parameter
-Wno-unused-value
```
```
ruby -rrbconfig -e 'system RbConfig::CONFIG["CC"], "--version"'
gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
All my attept to overwrite compiler to use clang don't work either. I tried the following:
```
gem install extlz4 -- --with-cc=clang
CC=clang gem install extlz4
CC=/usr/bin/clang gem install extlz4
```
## System
os: fedora 42
ruby: ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [x86_64-linux] (but also tried it with 3.3.8, with no success)
gcc: gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
## Workaround
I run the following script and then it's possible to complete "bundle install" process.
https://gist.github.com/skatkov/df4db6f8b76e58fc8eefaa92592f2c1a
--
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:122329] [Ruby Bug#21372] Ruby is passing clang specific flags to GCC 15 and native gem doesn't build.
2025-05-25 14:51 [ruby-core:122289] [Ruby Bug#21372] Ruby is passing clang specific flags to GCC 15 and native gem doesn't build skatkov (Stanislav (Stas) Katkov) via ruby-core
@ 2025-05-28 14:30 ` alanwu (Alan Wu) via ruby-core
0 siblings, 0 replies; 2+ messages in thread
From: alanwu (Alan Wu) via ruby-core @ 2025-05-28 14:30 UTC (permalink / raw)
To: ruby-core; +Cc: alanwu (Alan Wu)
Issue #21372 has been updated by alanwu (Alan Wu).
Status changed from Open to Third Party's Issue
Resolved downstream; wasn't about the options passed.
----------------------------------------
Bug #21372: Ruby is passing clang specific flags to GCC 15 and native gem doesn't build.
https://bugs.ruby-lang.org/issues/21372#change-113476
* Author: skatkov (Stanislav (Stas) Katkov)
* Status: Third Party's Issue
* ruby -v: ruby 3.4.4
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Fedora 42 has ompilation errors while running `gem install extlz4`.
```sh
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
make: *** [Makefile:251: blockapi.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/sk/.local/share/mise/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/extlz4-0.3.4 for inspection.
Results logged to /home/sk/.local/share/mise/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/extensions/x86_64-linux/3.4.0/extlz4-0.3.4/gem_make.out
```
I have submitted a ticket with a gem, but I have hunch that this might not be an issue with a gem, but rather a ruby compatibility issue with the new GCC (15).
@see https://github.com/dearblue/ruby-extlz4/issues/6
I have very little experience with C and how compilation works. But as far as I can understand, ruby was compiled with clang and is now passing some CLANG specifics flags to GCC 15 during native gem compilation - this causes a compilation error.
```sh
ruby -rrbconfig -e 'puts RbConfig::CONFIG["warnflags"].split(/\s+/).grep(/-Wno-/).sort'
-Wno-cast-function-type
-Wno-constant-logical-operand
-Wno-long-long
-Wno-missing-field-initializers
-Wno-overlength-strings
-Wno-packed-bitfield-compat
-Wno-parentheses-equality
-Wno-self-assign
-Wno-tautological-compare
-Wno-unused-parameter
-Wno-unused-value
```
```
ruby -rrbconfig -e 'system RbConfig::CONFIG["CC"], "--version"'
gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
All my attept to overwrite compiler to use clang don't work either. I tried the following:
```
gem install extlz4 -- --with-cc=clang
CC=clang gem install extlz4
CC=/usr/bin/clang gem install extlz4
```
## System
os: fedora 42
ruby: ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [x86_64-linux] (but also tried it with 3.3.8, with no success)
gcc: gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
## Workaround
I run the following script and then it's possible to complete "bundle install" process.
https://gist.github.com/skatkov/df4db6f8b76e58fc8eefaa92592f2c1a
--
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:[~2025-05-28 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-25 14:51 [ruby-core:122289] [Ruby Bug#21372] Ruby is passing clang specific flags to GCC 15 and native gem doesn't build skatkov (Stanislav (Stas) Katkov) via ruby-core
2025-05-28 14:30 ` [ruby-core:122329] " alanwu (Alan Wu) 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).