Skip to content

Fix native extension build with GCC 15#231

Merged
composerinteralia merged 3 commits intotrilogy-libraries:mainfrom
davue:main
Aug 4, 2025
Merged

Fix native extension build with GCC 15#231
composerinteralia merged 3 commits intotrilogy-libraries:mainfrom
davue:main

Conversation

@davue
Copy link
Copy Markdown
Contributor

@davue davue commented Jul 3, 2025

OS: Fedora 42
Ruby: 3.2.1
GCC: 15.1.1

The native extension build is broken with GCC 15 resulting in the same errors as described here: https://bugs.ruby-lang.org/issues/21290

CFLAGS should be appended with append_cflags instead of directly appending them which fixes the problem.

@sudoremo
Copy link
Copy Markdown

Any chance this will get merged in the coming weeks? Many thanks.

@davue
Copy link
Copy Markdown
Contributor Author

davue commented Jul 29, 2025

Duplicate of #229

@davue davue closed this Jul 29, 2025
@davue
Copy link
Copy Markdown
Contributor Author

davue commented Jul 29, 2025

I cannot reopen the older PR because it is not mine so I'm tracking this here.

I still think we should merge this for two reasons:

  • It is generally recommended to use append_cflags instead of manually appending it (or is there a reason it was done like this here?)
  • To support Ruby versions < 3.4.5

@davue davue reopened this Jul 29, 2025
Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
@davue davue requested a review from composerinteralia July 29, 2025 14:47
Copy link
Copy Markdown
Collaborator

@composerinteralia composerinteralia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using append_cflags makes sense to me and matches what the docs recommend: https://docs.ruby-lang.org/en/master/extension_rdoc.html#label-Prepare+extconf.rb

@composerinteralia composerinteralia merged commit 12358cf into trilogy-libraries:main Aug 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants