Bug 7768 - cenbuild can't rebuild gcc on Fedora 34
Summary: cenbuild can't rebuild gcc on Fedora 34
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.20.0
Assignee: Pierre Ossman
URL:
Keywords: adaha_tester, prosaic
Depends on: 8361
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-17 17:18 CEST by Linn
Modified: 2025-08-06 10:53 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Linn cendio 2021-09-17 17:18:09 CEST
Ran in to this issue when trying to update gcc in cenbuild on Fedora 34. 

Running 'rebuild' results in a build failure, and when looking in /home/cendio/cenbuild/repo/rpmbuild/build.log I see this error:

> ../../gcc/reload1.c: In function 'void init_reload()':
> ../../gcc/reload1.c:115:24: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
>   115 |   (this_target_reload->x_spill_indirect_levels)
>       |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
This error will likely happen on all distributions where we try to run .c-files with a too high version of C++.

How to reproduce:
1. Update gcc in cenbuild
2. Run 'rebuild'
Comment 1 Pierre Ossman cendio 2023-06-14 11:03:18 CEST
This simple fix seems to be sufficient to resolve things:

diff --git a/build/gcc.spec b/build/gcc.spec
index 1c1d8cd..8595ede 100644
--- a/build/gcc.spec
+++ b/build/gcc.spec
@@ -298,6 +298,10 @@ if [ "%{_cendio_host}" == "%{_cendio_target}" ]; then
 fi
 %endif
 
+%if 0%{?prebootstrap} || 0%{?bootstrap}
+export CXXFLAGS="$CXXFLAGS -std=c++11"
+%endif
+
 # We don't use %%{_cendio_configure} as gcc does its own magic with
 # regard to libdir. This is also how Red Hat configures their gcc.
 %{cbrun} ../configure \
Comment 2 Pierre Ossman cendio 2025-07-16 09:50:08 CEST
Should be fixed now that we've upgrade gcc in bug 8361.
Comment 3 Pierre Ossman cendio 2025-07-16 16:56:00 CEST
Does indeed work now. Tested on Fedora 41 (with workaround for bug 8644).
Comment 4 Adam Halim cendio 2025-08-06 10:53:29 CEST
Tested this as part of bug 8644. I was able to successfully do a no-repo build of gcc on Fedora 41 without issues.

Note You need to log in before you can comment on or make changes to this bug.