From 2c8d90f4ac9df93020014604a39cdca6b8356cce Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sun, 3 May 2020 11:18:12 -0400 Subject: [PATCH] meson.eclass: only default BUILD_FLAGS to FLAGS if not cross-compiling Bug: https://bugs.gentoo.org/720818 Signed-off-by: Mike Gilbert --- eclass/meson.eclass | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index dce5fffd894c..13daa961c7bd 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -288,9 +288,15 @@ meson_src_configure() { debug-print-function ${FUNCNAME} "$@" tc-export_build_env - : ${BUILD_FCFLAGS:=${FCFLAGS}} - : ${BUILD_OBJCFLAGS:=${OBJCFLAGS}} - : ${BUILD_OBJCXXFLAGS:=${OBJCXXFLAGS}} + if tc-is-cross-compiler; then + : ${BUILD_FCFLAGS:=-O1 -pipe} + : ${BUILD_OBJCFLAGS:=-O1 -pipe} + : ${BUILD_OBJCXXFLAGS:=-O1 -pipe} + else + : ${BUILD_FCFLAGS:=${FCFLAGS}} + : ${BUILD_OBJCFLAGS:=${OBJCFLAGS}} + : ${BUILD_OBJCXXFLAGS:=${OBJCXXFLAGS}} + fi local mesonargs=( meson setup -- 2.26.2