Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930077 - sys-fs/mdadm-4.3: fails to compile when GCC doesn't set -fPIE as default
Summary: sys-fs/mdadm-4.3: fails to compile when GCC doesn't set -fPIE as default
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-15 17:48 UTC by Byron Stanoszek
Modified: 2024-04-15 17:55 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge.info,6.56 KB, text/plain)
2024-04-15 17:49 UTC, Byron Stanoszek
Details
build.log (build.log,23.38 KB, text/x-log)
2024-04-15 17:50 UTC, Byron Stanoszek
Details

Note You need to log in before you can comment on or make changes to this bug.
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