Bug 7768 - cenbuild can't rebuild gcc on Fedora 34
Summary: cenbuild can't rebuild gcc on Fedora 34
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-17 17:18 CEST by Linn
Modified: 2024-06-10 12:48 CEST (History)
0 users

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 \

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