Amd64 build fails with "‘-fcf-protection=full’ is not supported for this target"

Bug #2034536 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
u-boot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Rebuilding the u-boot package on the amd64 architecture failed with:

cc1: error: ‘-fcf-protection=full’ is not supported for this target

https://launchpadlibrarian.net/685589889/buildlog_ubuntu-mantic-amd64.u-boot_2023.07+dfsg-1ubuntu1_BUILDING.txt.gz

Tags: patch
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Cross compiling should not use the flag -fcf-protection=full which is specific to the x86 architecture.

Revision history for this message
Dave Jones (waveform) wrote :

Attaching a rather hacky patch for this (excludes -fcf-protection entirely; would be nicer to do it just for the cross-built stuff but I didn't have the time to figure that out yet). Will upload shortly.

tags: added: patch
Revision history for this message
Steve Langasek (vorlon) wrote :

@Dave consider that dpkg-buildflags is sensitive to the dpkg arch env variables. E.g.:

$ DEB_HOST_ARCH=amd64 dpkg-buildflags --get CFLAGS
-g -O2 -ffile-prefix-map=/tmp=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection
$ DEB_HOST_ARCH=armhf dpkg-buildflags --get CFLAGS
-g -O2 -ffile-prefix-map=/tmp=. -fstack-protector-strong -Wformat -Werror=format-security
$

While stripping this one flag may fix the build, ideally we would have a more general fix that uses target-appropriate flags for the cross-build.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot - 2023.07+dfsg-1ubuntu2

---------------
u-boot (2023.07+dfsg-1ubuntu2) mantic; urgency=medium

  * Fix FTBFS by excluding -fcf-protection from CFLAGS; this flag isn't valid
    when cross-building (LP: #2034536)

 -- Dave Jones <email address hidden> Thu, 21 Sep 2023 12:00:38 +0100

Changed in u-boot (Ubuntu):
status: New → Fix Released
Benjamin Drung (bdrung)
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.