meson.eclass: Don't mix host *FLAGS with build *FLAGS
authorRaul E Rangel <rrangel@chromium.org>
Mon, 23 Apr 2018 16:15:59 +0000 (10:15 -0600)
committerMike Gilbert <floppym@gentoo.org>
Sat, 5 May 2018 20:15:55 +0000 (16:15 -0400)
commitc8570bc0e2618e502c2fdab7ff972786a12899e0
treea71e74dcd8852e88e1378fd81575c93e2435b323
parent2dd9b21e7b9003c1dd6e7e71578449d01302d610
meson.eclass: Don't mix host *FLAGS with build *FLAGS

meson gets the build flags from the environment. When cross compiling it
will get the host flags from the cross file. The ebuild was not passing
the correct build flags when cross compiling.

By using tc-env_build the build environment flags are set when calling
meson. This results in not mixing host and build flags:

Example output:
Native C compiler: x86_64-pc-linux-gnu-clang (clang 7.0)
Appending CFLAGS from environment: '-O1 -pipe'
Appending LDFLAGS from environment: ' '
Appending CPPFLAGS from environment: ' '
Cross C compiler: armv7a-cros-linux-gnueabi-clang (clang 7.0)
Host machine cpu family: arm
Host machine cpu: armv7a
Target machine cpu family: arm
Target machine cpu: armv7a
Build machine cpu family: x86_64
Build machine cpu: x86_64

tc-env_build does not seem to load the actual build flags, but it's
better than using host flags as build flags.

See https://bugs.gentoo.org/653902 for upstream patch

BUG=b:78351764
BRANCH=none
TEST=emerge-grunt and verified mosys runs

Change-Id: I802b58cb089b27b9253a034ac00dd183e0f1955a
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Closes: https://bugs.gentoo.org/653902
eclass/meson.eclass