summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild')
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild24
1 files changed, 22 insertions, 2 deletions
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild
index 85f71ffaf47b..3cfa2914c936 100644
--- a/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit flag-o-matic libtool linux-info systemd
+inherit libtool linux-info systemd
if [[ ${PV} == "9999" ]] ; then
inherit git-r3 autotools
@@ -46,12 +46,15 @@ pkg_setup() {
src_prepare() {
default
+
+ # Append PURGATORY_EXTRA_CFLAGS flags set by configure, instead of overriding them completely.
+ sed -e "/^PURGATORY_EXTRA_CFLAGS =/s/=/+=/" -i Makefile.in || die
+
if [[ "${PV}" == 9999 ]] ; then
eautoreconf
else
elibtoolize
fi
- filter-flags '-mindirect-branch=thunk*'
}
src_configure() {
@@ -64,6 +67,23 @@ src_configure() {
econf "${myeconfargs[@]}"
}
+src_compile() {
+ # Respect CFLAGS for purgatory.
+ # purgatory/Makefile uses PURGATORY_EXTRA_CFLAGS variable.
+ # -mfunction-return=thunk and -mindirect-branch=thunk conflict with
+ # -mcmodel=large which is added by build system.
+ # Replace them with -mfunction-return=thunk-inline and -mindirect-branch=thunk-inline.
+ local flag flags=()
+ for flag in ${CFLAGS}; do
+ [[ ${flag} == -mfunction-return=thunk ]] && flag="-mfunction-return=thunk-inline"
+ [[ ${flag} == -mindirect-branch=thunk ]] && flag="-mindirect-branch=thunk-inline"
+ flags+=("${flag}")
+ done
+ local -x PURGATORY_EXTRA_CFLAGS="${flags[*]}"
+
+ default
+}
+
src_install() {
default