Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 865361 - app-emulation/virtualbox-6.1.36-r1: build fails with CFLAGS/CXXFLAGS -fcf-protection
Summary: app-emulation/virtualbox-6.1.36-r1: build fails with CFLAGS/CXXFLAGS -fcf-pro...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-08-16 07:13 UTC by Andreas Thalhammer
Modified: 2022-08-19 00:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (app-emulation:virtualbox-6.1.36-r1:20220816-070500.log.xz,54.98 KB, application/x-xz)
2022-08-16 07:15 UTC, Andreas Thalhammer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Thalhammer 2022-08-16 07:13:16 UTC
When I upgraded from VirtualBox 6.1.34 to 6.1.36, the build suddenly failed. From the logs I found it is due to my CFLAGS (or CXXFLAGS, which are the same):

/etc/portage/make.conf:
COMMON_FLAGS="-O2 -pipe"
COMMON_ARCH_FLAGS="-march=znver3"
COMMON_MITIGATION_FLAGS="-fstack-protector-strong -fno-plt -fexceptions -fcf-protection"
CFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}"
CXXFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}"
FCFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}"
FFLAGS="${COMMON_ARCH_FLAGS} ${COMMON_FLAGS} ${COMMON_MITIGATION_FLAGS}"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=both -Wl,-z,relro -Wl,-z,now ${COMMON_MITIGATION_FLAGS}"

Build error from the log:
cc1: error: ‘-fcf-protection’ is not compatible with this target

The build works without -fcf-protection.

Maybe it would be possible to a) filter out -fcf-protection or b) make it compile again with this flag (since we are on Gentoo Linux, it should be the users choice).

Reproducible: Always
Comment 1 Andreas Thalhammer 2022-08-16 07:15:06 UTC
Created attachment 799861 [details]
build log
Comment 2 Larry the Git Cow gentoo-dev 2022-08-18 18:43:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30a5e942654517bbb07962187a4a619b281ff3ca

commit 30a5e942654517bbb07962187a4a619b281ff3ca
Author:     Viorel Munteanu <ceamac.paragon@gmail.com>
AuthorDate: 2022-08-17 06:52:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-18 18:42:14 +0000

    app-emulation/virtualbox: Fix compilation with -fcf-protection
    
    Closes: https://bugs.gentoo.org/865361
    Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/26889
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/virtualbox-6.1.36-fcf-protection.patch         | 16 ++++++++++++++++
 app-emulation/virtualbox/virtualbox-6.1.36-r1.ebuild     |  3 +++
 2 files changed, 19 insertions(+)
Comment 3 Andreas Thalhammer 2022-08-19 00:29:33 UTC
Thanks!