Skip to content
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

Add GCC 14.1.0. #675

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Add GCC 14.1.0. #675

wants to merge 7 commits into from

Conversation

Guyutongxue
Copy link
Contributor

@Guyutongxue Guyutongxue commented May 9, 2024

Sorry for a so big PR, but it might be necessary to change these files.

Here is what it does:

  • Add build scripts for gcc-14.1.0 and gcc-14-branch;
  • Bump expat version (this suppresses Update expat to 2.6.2 #671 and fixes Update expat to 2.6.2 #672), because v2.5.0 no longer available to download due to vulnerability;
  • Because GCC 14 starts to following ISO C standard strictly (and do not connivance "traditional" K&R C features like implicit function declaration etc.), some sub-targets failed when building with the newly-built GCC 14. That's why more changes are made:
  • A test file modified.
  • Upgrade gdb to 14.2. (Original version failed under GCC 14)
  • Sub-target termcap and python-3 needs CFLAGS like -fpermissive or -Wno-error=implicit-function-declaration now.
  • For python-3, an additional patch applied.
  • For termcap, an additional patch applied (wtf the original Makefile do not use CFLAGS); AND ALSO, change the way to pass CFLAGS etc. to the configure script.
    • The original configure script doesn't recognize FOO=bar in command line arguments as environment variable (that's why in previous version, those CFLAGS settings are commented out).
    • I change the code to deal with PKG_CONFIGURE_FLAGS in func_configure, so that CFLAGS etc. are exported as environment variables instead of passing them as command line arguments.
    • In order to keep the PKG_CONFIGURE_FLAGS array structure as-is, now I'm using -n flag (a.k.a. pass array argument by reference) that supports from Bash 5.3 (ref, and ref). As a benefit, we can now remove all extra "escaped quotation mark" in *FLAGS settings.

I've tested these changes and successfully built GCC 14.1.0 with SEH, Win32, UCRT and v11 runtime. Let's wait for GitHub Actions' result.

Instead of "serialize" the arguments , this commit uses by-reference argument passing (Bash 5.3+).
We now can pass array as-is so we later can enumerate them, select C|CXX|LDFLAGS from them,
and made them as environment variable.
As as result, now we can correctly run the configure scripts who doesn't support list FOO=bar as argument (like termcap).
@starg2
Copy link
Contributor

starg2 commented May 9, 2024

You might want to update .github/workflows/build_cmake.yml and func_map_gcc_name_to_gcc_version in library/functions.sh as well.

  • Sub-target termcap and python-3 needs CFLAGS like -fpermissive or -Wno-error=implicit-function-declaration now.

Is it possible to actually fix code rather than silencing warnings?

@starg2 starg2 mentioned this pull request May 9, 2024
@Guyutongxue
Copy link
Contributor Author

You might want to update .github/workflows/build_cmake.yml and func_map_gcc_name_to_gcc_version in library/functions.sh as well.

Fixed, thanks!

Is it possible to actually fix code rather than silencing warnings?

Sure we can make many patches instead of silence warnings. But analyzing these errors is, somehow, quite difficult. For example in termcap, we don't have free declaration because <stdlib.h> not included, and that's because STDC_HEADERS is not defined, and that's because in Autoconf, AC_STDC_HEADERS will set ac_cv_header_stdc=no if we are cross-compiling (sad). That's just one error. In python-3, there are too many errors like this (and some errors about pointer const-ness is really hard to fix).

On the other hand, If we add (unnecessary) patches today, we will have more work to do in the future: maintaining these patches once the upstream has update. That's not what I expected, at least -- I just want a stable build script, that means updating packages should be an easy work.

At least, one may think these "-Wno-error" introduce some "bad smell"... probably yes, but actually it does not change anything from previous version since it just makes implicit options explicit.

@starg2
Copy link
Contributor

starg2 commented May 11, 2024

At least, one may think these "-Wno-error" introduce some "bad smell"... probably yes, but actually it does not change anything from previous version since it just makes implicit options explicit.

Fair enough.

Fsu0413 added a commit to Fsu0413/Fs-scripts that referenced this pull request May 29, 2024
Atrifact is from GitHub Actions, which comes from a PR. It is not product build so no release
https://github.com/niXman/mingw-builds/actions/runs/9028969794
niXman/mingw-builds#675
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.

Update expat to 2.6.2
2 participants