Skip to content

gcc-15 fixes: segfault on fpm install (#1149) and metapackages #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jun 20, 2025

Conversation

krystophny
Copy link
Contributor

@krystophny krystophny commented Jun 14, 2025

This is a small fix for fpm install segfaulting when compiled with GFortran 15.1.1 on Archlinux. It also adds a workaround for failing compilation on -Wall due to upstream GCC bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120470 / https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119928 that have been fixed in git but exists up to including 15.1 .

@krystophny krystophny force-pushed the main branch 2 times, most recently from 3c42228 to 75325c8 Compare June 14, 2025 10:42
@krystophny krystophny marked this pull request as ready for review June 14, 2025 10:51
@krystophny
Copy link
Contributor Author

@perazz this is ready to review. Unfortunately due to the upstream bug in GCC 15, we cannot pass bootstrapped tests, so I didn't add it in the CI/CD yet. The bump to GCC default version 15 in Homebrew independently causes the mpich and openmpi to fail on macos, but this is another issue. This one here is ready to merge.

Copy link
Member

@perazz perazz left a comment

Choose a reason for hiding this comment

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

Thank you for your fix @krystophny.

I was a bit hesitant to add the no-interface-checking flag to the debug builds (though I understand it's necessary to build code with the buggy gcc-15 - see #1145 and fortran-lang/test-drive#49).

However, when the option is not recognized (gcc<=14), gcc only errors out for the positive form (-Wexternal-argument-mismatch) but not the negative form (-Wno-...). gcc.gnu.org

So I think it's a good practical fix imho.

@perazz
Copy link
Member

perazz commented Jun 16, 2025

I fixed the metapackage CI steps for gcc-15, but there are now more errors (tests not passed by fpm), it seems related to paths. I will investigate as soon as possible.

@krystophny
Copy link
Contributor Author

Thank you for your fix @krystophny.

I was a bit hesitant to add the no-interface-checking flag to the debug builds (though I understand it's necessary to build code with the buggy gcc-15 - see #1145 and fortran-lang/test-drive#49).

However, when the option is not recognized (gcc<=14), gcc only errors out for the positive form (-Wexternal-argument-mismatch) but not the negative form (-Wno-...). gcc.gnu.org

So I think it's a good practical fix imho.

@perazz these are exactly my thoughts. We are kind of forced to do this, since there is a realistic risk that major distributions or cluster environments will go with GCC 15.1 . Honestly, I am disappointed by GFortran how multiple issues like this could happen. The option -Wexternal-argument-mismatch didn't exist before, so it will do no harm to add the negative one. What we could do is limit the fix to some GCC versions. For this I create a new issue.

@perazz perazz mentioned this pull request Jun 20, 2025
@perazz
Copy link
Member

perazz commented Jun 20, 2025

@krystophny I've opened a PR (krystophny#1) towards your branch to avoid duplication.

Unfortunately it seems like array reallocation with the array constructor is broken in gcc-15 (a = [a, b]), that is what was causing the failing metapackage tests.

Please look at that one and once that is merged into this one, we can merge this upstream too imho.

@krystophny
Copy link
Contributor Author

@krystophny I've opened a PR (krystophny#1) towards your branch to avoid duplication.

Unfortunately it seems like array reallocation with the array constructor is broken in gcc-15 (a = [a, b]), that is what was causing the failing metapackage tests.

Please look at that one and once that is merged into this one, we can merge this upstream too imho.

done!

@perazz perazz changed the title Fix #1149 segfault on fpm install gcc-15 fixes: segfault on fpm install (#1149) and metapackages Jun 20, 2025
@perazz
Copy link
Member

perazz commented Jun 20, 2025

Merging, thank you @krystophny

@perazz perazz merged commit e6ea0c6 into fortran-lang:main Jun 20, 2025
27 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.

2 participants