Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 930077

Summary: sys-fs/mdadm-4.3: fails to compile when GCC doesn't set -fPIE as default
Product: Gentoo Linux Reporter: Byron Stanoszek <gandalf>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal CC: gandalf
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build.log

Description Byron Stanoszek 2024-04-15 17:48:14 UTC
In mdadm-4.3.ebuild, the function mdadm_emake() sets CWFLAGS to a very basic "-Wall", which overrides and unsets a lot of flags that were intended to be set by the mdadm Makefile, such as -fstack-protector-strong and -fPIE. If GCC was compiled with the "-pie" use flag, then overriding CWFLAGS omits -fPIE from being passed to the compiler, even though "LDLIBS = -pie" is still applied elsewhere in the Makefile.

Solution: Set CWFLAGS to "-Wall -fstack-protector-strong -fPIE" or leave it blank (set to "") in the ebuild's mdadm_emake() so that the Makefile defaults can be used.

Reproducible: Always
Comment 1 Byron Stanoszek 2024-04-15 17:49:49 UTC
Created attachment 890884 [details]
emerge --info
Comment 2 Byron Stanoszek 2024-04-15 17:50:20 UTC
Created attachment 890885 [details]
build.log