Bug 281091 - [exp-run] Update GCC_DEFAULT to 14 etc.
Summary: [exp-run] Update GCC_DEFAULT to 14 etc.
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on: 284487 284499 281190 281222 281223 281224 281225 281226 281228 281229 281230 281231 281233 281234 281235 281236 281238 281239 281241 281243 281244 281245 281246 281247 281249 284483 284484 284485 284486 284488
Blocks:
  Show dependency treegraph
 
Reported: 2024-08-27 10:56 UTC by Lorenzo Salvadore
Modified: 2025-03-12 14:35 UTC (History)
6 users (show)

See Also:
salvadore: exp-run?


Attachments
GCC_DEFAULT=14 (800 bytes, patch)
2024-08-27 10:56 UTC, Lorenzo Salvadore
no flags Details | Diff
GCC 11 update (3.79 KB, patch)
2024-08-27 10:57 UTC, Lorenzo Salvadore
no flags Details | Diff
GCC 12 update (5.32 KB, patch)
2024-08-27 10:57 UTC, Lorenzo Salvadore
no flags Details | Diff
GCC 13 update (5.34 KB, patch)
2024-08-27 10:57 UTC, Lorenzo Salvadore
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2024-08-27 10:56:45 UTC
Created attachment 253122 [details]
GCC_DEFAULT=14

Time to update GCC ports and, most importantly, GCC_DEFAULT.

Could you please run an exp-run with all the patches attached? Thanks.
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-08-27 10:57:13 UTC
Created attachment 253123 [details]
GCC 11 update
Comment 2 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-08-27 10:57:34 UTC
Created attachment 253124 [details]
GCC 12 update
Comment 3 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-08-27 10:57:56 UTC
Created attachment 253125 [details]
GCC 13 update
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2024-08-31 09:43:26 UTC
Some new failure logs:

https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/funktrackergold-1.5.2_9.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/alliance-5.1.1_6.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/graywolf-0.1.6.4_4.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/sliderule-1.0_11.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/efivar-0.15_9.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/gcc-arm-embedded-10.3.20210921.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/kBuild-0.1.9998_15.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/rhtvision-2.2.1.1_11.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/smv-2.5.4.3_11.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/emacs-devel-31.0.50.20240816,3.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/emacs-devel-nox-31.0.50.20240816,3.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/wine8-8.0.2_2.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/x49gp-20100425_9.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/shaaft-0.5.0_27.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/xbat-1.11_11.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/ezbounce-1.99.15_27.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/clisp-2.49.93+_7.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/gforth-0.7.3_15.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/opencoarrays-2.10.1_1.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/xanim-2.92.0_11.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/l2tpd-0.69_12.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/cp2k-2024.2.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/mpb-1.11.1_8.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/openmolcas-24.06.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/grub2-pcbsd-2.02q_19.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/shim-0.9_5.log
https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/kannel-1.4.4_14,1.log
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2024-09-01 15:08:36 UTC
Need review for fix build devel/kBuild: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281190
Comment 6 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-03 14:19:44 UTC
All necessary bug reports have been created.

Since no ports depending on GCC 11 and GCC 12 appear to get broken, I am going to apply the patches to update them now.

On the other hand, I am going to apply the patch to update GCC 13 and the GCC_DEFAULT update simultaneously once they are both ready, so that users building ports either directly or through poudriere save some building time.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-09-03 15:46:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0cd003615453bb5fb998e0e1b45db0344bf677cd

commit 0cd003615453bb5fb998e0e1b45db0344bf677cd
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-08-20 14:07:45 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-09-03 15:45:41 +0000

    lang/gcc12: Update to 12.4.0

    Changes: https://gcc.gnu.org/gcc-12/changes.html#12.4

    PR:             281091
    Tested by:      exp-run (antoine)

 lang/gcc12/Makefile                                |  2 +-
 lang/gcc12/distinfo                                |  6 ++--
 lang/gcc12/files/patch-gcc_configure (new)         | 22 ++++++++++++
 lang/gcc12/files/patch-gcc_system.h (gone)         | 42 ----------------------
 .../files/patch-libcc1_libcc1plugin.cc (gone)      | 19 ----------
 .../files/patch-libcc1_libcp1plugin.cc (gone)      | 19 ----------
 6 files changed, 26 insertions(+), 84 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-09-03 15:46:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9a71c5a6bd3b3a5365a6a94c191f2e7472677f01

commit 9a71c5a6bd3b3a5365a6a94c191f2e7472677f01
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-08-20 14:12:21 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-09-03 15:45:41 +0000

    lang/gcc11: Update to 11.5.0

    Changes: https://gcc.gnu.org/gcc-11/changes.html#11.5

    PR:             281091
    Tested by:      exp-run (antoine)

 lang/gcc11/Makefile                        |  3 +--
 lang/gcc11/distinfo                        |  6 ++---
 lang/gcc11/files/patch-gcc_configure (new) | 22 ++++++++++++++++
 lang/gcc11/files/patch-gcc_system.h (gone) | 42 ------------------------------
 4 files changed, 26 insertions(+), 47 deletions(-)
Comment 9 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-03 15:47:33 UTC
Comment on attachment 253123 [details]
GCC 11 update

Make patch obsolete: it has been committed.
Comment 10 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-03 15:48:18 UTC
Comment on attachment 253124 [details]
GCC 12 update

Make patch obsolete: it has been committed.
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-09-04 08:57:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d46106eb4b6dcda7b820e52a37d1f95226376e51

commit d46106eb4b6dcda7b820e52a37d1f95226376e51
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-09-03 15:34:14 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-09-04 08:56:43 +0000

    lang/gcc14: Add jit language

    The jit language was missing by accident. Restore it.

    PR:             281091
    Reported by:    ashish

 lang/gcc14/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 12 Gerald Pfeifer freebsd_committer freebsd_triage 2024-09-04 13:53:59 UTC
(In reply to Lorenzo Salvadore from comment #6)
> On the other hand, I am going to apply the patch to update GCC 13
> and the GCC_DEFAULT update simultaneously once they are both ready

I recommend to go ahead with the GCC 13 now. That releases has its
number of fixes and improvements which I would not deprive our users
of, and GCC_DEFAULT surely is going to take a month or two?
Comment 13 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-04 14:30:13 UTC
(In reply to Gerald Pfeifer from comment #12)

You are right. Since the GCC_DEFAULT update will need a fair amount of time, it is a good idea to update lang/gcc13 now. I am going to do it right now.
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-09-04 14:32:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=546dc44194b4f9e7c62d71e140d8279243c7ec38

commit 546dc44194b4f9e7c62d71e140d8279243c7ec38
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-08-20 12:52:47 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-09-04 14:31:01 +0000

    lang/gcc13: Update to 13.3.0

    Changes: https://gcc.gnu.org/gcc-13/changes.html#13.3

    PR:             281091
    Tested by:      exp-run (antoine)

 lang/gcc13/Makefile                                |  3 +-
 lang/gcc13/distinfo                                |  6 ++--
 lang/gcc13/files/patch-gcc_configure (new)         | 22 ++++++++++++
 lang/gcc13/files/patch-gcc_system.h (gone)         | 42 ----------------------
 .../files/patch-libcc1_libcc1plugin.cc (gone)      | 19 ----------
 .../files/patch-libcc1_libcp1plugin.cc (gone)      | 19 ----------
 6 files changed, 26 insertions(+), 85 deletions(-)
Comment 15 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-09-04 14:33:22 UTC
Comment on attachment 253125 [details]
GCC 13 update

Make patch obsolete: it has been committed.
Comment 16 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-17 15:43:03 UTC
emulators/wine-proton:
dlls/ntdll/unix/virtual.c: In function 'r_debug_add_module':
dlls/ntdll/unix/virtual.c:161:32: error: assignment to 'caddr_t' {aka 'char *'} from 'INT_PTR' {aka 'long int'} makes pointer from integer without a cast [-Wint-conversion]
  161 |     if (ptr) entry->map.l_addr = offset;
      |                                ^
dlls/ntdll/unix/virtual.c:165:27: error: assignment to 'caddr_t' {aka 'char *'} from 'INT_PTR' {aka 'long int'} makes pointer from integer without a cast [-Wint-conversion]
  165 |         entry->map.l_addr = offset;
      |                           ^

Workaround:
emulators/wine-proton/Makefile:
-CFLAGS+=        -D__NR_futex="-1" -Werror=implicit-function-declaration
+CFLAGS+=        -D__NR_futex="-1" -Werror=implicit-function-declaration -Wno-int-conversion
Comment 17 Lorenzo Salvadore freebsd_committer freebsd_triage 2025-01-22 10:16:33 UTC
All known bugs have been fixed (at least as much as needed for the GCC_DEEFAULT update). Let's check if everything is alright now and then hopefully proceed with the actual commit.
Comment 19 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-25 20:19:23 UTC
(In reply to Antoine Brodin from comment #18)
Possible patch for wine-proton is here: https://bugs.freebsd.org/281091#c16
Comment 20 Lorenzo Salvadore freebsd_committer freebsd_triage 2025-01-31 14:53:27 UTC
All bug reports for the new failure have been created. I have added a reference to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281091#c16 in the appropriate report.

Thanks!
Comment 21 Matthias Andree freebsd_committer freebsd_triage 2025-01-31 21:50:08 UTC
Note that for ports that link to libc++ because they use other C++ libraries that also link against libc++, in some place for rawtherapee, a new libstdc++ 14 symbol __cxa_call_terminate somehow spills over into the libc++ world, but libc++ provides a different function with __clang_call_terminate name instead.

We cannot mix libstdc++ oriented binaries with libc++ binaries, so this requires complete investigation.  

Concrete question:

Why does switching GCC to version 14 cause applications to reference libstdc++14 symbols when compilation and linking against libc++ is requested?

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284487 (which is closed because I've version pinned its GCC reference from yes to 13).
Comment 22 Matthias Andree freebsd_committer freebsd_triage 2025-01-31 23:48:37 UTC
Following up on RawTherapee. I tried to give it a spin, but USE_GCC=14 "just works".  So, this is pretty dodgy.

I conclude that rawtherapee is working properly, but falls victim to one of its libraries being miscompiled for libstdc++, but I cannot easily identify this. 

Does someone have a machine with GCC 14 already default, the requisites built, and can build rawtherapee without LTO and identify which library fucks up rawtherapee's C++ standard library?

TIA.
Comment 23 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-01 00:05:22 UTC
(In reply to Matthias Andree from comment #22)
I have.
I already migrated to GCC 14 on all my hosts.
Build in progress. What to do next?
Comment 24 Matthias Andree freebsd_committer freebsd_triage 2025-02-01 00:12:01 UTC
How does https://lists.freebsd.org/archives/dev-commits-src-all/2024-August/044538.html fit in here?
Comment 25 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-01 00:43:54 UTC
(In reply to Vladimir Druzenko from comment #23)
graphics/rawtherapee build and run without errors on live system 14.2-p1 amd64.
        DOCS           : off
        LTO            : off
        NATIVE         : off
        OPENMP         : on
Comment 26 Matthias Andree freebsd_committer freebsd_triage 2025-02-01 09:26:20 UTC
vvd@ thanks for your assistance. I understand the issue with GCC 14 breaking some code with linker errors around __cxa_call_terminate now. It only affects 13.4-RELEASE, which is the only supported release which does not have this symbol yet in libc++, and is the one which the exp-run for rawtherapee flagged.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284499 for details - note it's a requisite if we want to have GCC 14 default ports compiler before 13.4 is EOL.
Comment 27 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-01 10:43:25 UTC
(In reply to Matthias Andree from comment #26)
Why can't we do something like this:
.if (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1400xxx)
USE_GCC=        yes
.else
USE_GCC=        13
.endif
?
Comment 28 Matthias Andree freebsd_committer freebsd_triage 2025-02-01 12:42:34 UTC
(In reply to Vladimir Druzenko from comment #27)
I consider this insufficient: Other ports (libraries that rawtherapee uses) would have been built with GCC14, and in that case, the library would cause the same error when rawtherapee is linked.  Chances are that such libraries fail the build, chances are they get away with the unresolved symbol because they are just libraries and linked lazily. Depending on their linker settings.

The only viable workaround for applications, if there were an unsurmountable decision to NOT backport/issue erratum for 13.4 to implement __cxa_call_terminate, would be to provide 14-stable's implementation as a conditional "add this object to the link" workaround in rawtherapee.
Comment 29 Lorenzo Salvadore freebsd_committer freebsd_triage 2025-02-04 11:12:52 UTC
(In reply to Vladimir Druzenko from comment #27)

Maybe we could move the conditional into bsd.default-versions.mk:

.if (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1400xxx)
GCC_DEFAULT=        14
.else
GCC_DEFAULT=        13
.endif

According to what I read in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284499#c0 and https://www.freebsd.org/security/#sup the conditional could (and should) be removed on June 30, 2025 (hopefully we are able to close the exp-run and commit the fix before that date...).

Gerald: Thoughts about this? As past maintainer of the GCC ports do you have any reason to recommend against it?
Comment 30 Gerald Pfeifer freebsd_committer freebsd_triage 2025-02-07 14:11:18 UTC
We have not done this before (to the best of my memory), as a
transitionary measure for less than half a year I would give it 
a try, though.
Comment 31 Matthias Andree freebsd_committer freebsd_triage 2025-02-07 20:39:01 UTC
(In reply to Lorenzo Salvadore from comment #29)
I wouldn't favor this suggestion because we then get split-horizon default GCC for ports, and that raises testing efforts considerably for ports.

I would still like to hear from re@ or secteam@ about MFHing that missing function back onto 13.4 via errata (and OSVERSION bump please so we can centrally add a kill switch to ports and request the base libc++ update from Errata for certain ports).
Comment 32 Fernando Apesteguía freebsd_committer freebsd_triage 2025-02-21 18:51:57 UTC
(In reply to Antoine Brodin from comment #18)
lang/nhc98 has just been removed in https://cgit.FreeBSD.org/ports/commit/?id=0a0fe572a65c40631b71306be94e078c1fbe0a94