Bug 8064 - Cannot build packages on Fedora 36
Summary: Cannot build packages on Fedora 36
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.15.0
Assignee: Pierre Ossman
URL:
Keywords: frifl_tester, prosaic
Depends on:
Blocks:
 
Reported: 2023-01-02 13:15 CET by Pierre Ossman
Modified: 2023-01-17 12:42 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2023-01-02 13:15:11 CET
Trying to build our build system packages on Fedora 36 results in:

> gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

The reason for this is:

https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck

tl;dr: The now implicitly set CFLAGS and friends at the start of %build, and their flags are incompatible with our builds.
Comment 7 Pierre Ossman cendio 2023-01-03 09:07:54 CET
I figured it was best to try to mimic what Fedora does for us as well. There are two complications, however:

 * They do a lot of other magical stuff that we don't want

 * We build our packages using the system's rpm, which means we don't know which version, or which distribution, or even if the distro macros are installed

So, I did a general clean up where we try to avoid the distro magic a bit more, and rely more on the base functionality of rpm itself. I then added the new stuff Fedora has added directly in to our macros.

The new basic principle is that our macros correspond to the macros Fedora add on top of the basic rpm macros.
Comment 8 Pierre Ossman cendio 2023-01-03 09:08:55 CET
Packages built using the new macros seem to work fine. I can see CFLAGS and friends being set correctly in the build log.

I also rebuilt the entire build system on a RHEL 8 VM, so no obvious side effects.

Good enough for me.
Comment 9 Frida cendio 2023-01-10 16:37:04 CET
Tried to reproduce the issue by building everything on a fresh Fedora 36 VM. It failed, but I got another error. When building cendio-build-gmp-bootstrap-i386 I get:  

> checking size of mp_limb_t... 4
> configure: error: Oops, mp_limb_t is 32 bits, but the assembler code
> in this configuration expects 64 bits.
> You appear to have set $CFLAGS, perhaps you also need to tell GMP the
> intended ABI, see "ABI and ISA" in the manual.

I don't know if it's the same issue. I have not tried to build after the fixes on this bug. 

NOTE: I had to install some dependencies in order to get this far:
> dnf install -y make gcc rpmdevtools rpm-sign zlib-devel flex glibc-devel.i686 perl
Comment 10 Pierre Ossman cendio 2023-01-11 12:51:52 CET
Hmm... Builds just fine on my Fedora 36 VM. Must be something subtle going on here.
Comment 11 Frida cendio 2023-01-17 12:27:59 CET
To clarify, the error in comment #9 was found when trying to reproduce the error in the description. When building the current version of cenbuild, with Pierres fixes, I don't get that error. So this seems to be another symptom of the same issue.
Comment 12 Frida cendio 2023-01-17 12:42:12 CET
Tested on Fedora 36, and it builds without any errors. Also did a complete rebuild on RHEL 8.

Tested that the resulting build systems worked by building ThinLinc client and server and tested those. Everything seems to work just fine. 

Checked the code changes and they look good.

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