[OE-core] [PATCH 1/1] meson: export native env only for native build

Alexander Kanavin alexander.kanavin at linux.intel.com
Thu Nov 16 10:14:43 UTC 2017


On 11/15/2017 07:53 PM, Martin Kelly wrote:
> Although the meson crossfile should take care of setting the right cross
> environment for a target build, meson slurps any set CFLAGS, CXXFLAGS,
> LDFLAGS, and CPPFLAGS from the environment and injects them into the
> build (see mesonbuild/environment.py:get_args_from_envvars for details).
> 
> This means that we are seeing native CFLAGS, CXXFLAGS, LDFLAGS, and
> CPPFLAGS in the target build, which is wrong and causes build failures
> when target and native have libraries in common (the linker gets
> confused and bails).
> 
> That said, we *do* need to set certain vars for all builds so that meson
> can find the right build tools. Without this, meson will fail during its
> sanity checking step because it will determine the build tools to be
> unrunnable since they output target instead of native artifacts.
> 
> The solution to all of this is to set CC, CXX, LD, and AR globally to
> the native tools while setting the other native vars *only* for the
> native build. For target builds, these vars will get overridden by the
> cross file as we expect.

Thanks; I will add this patch to my branch (so you get the credit for 
it). There's still a few failures to sort first though, discovered by AB 
(see Ross' email).

Alex



More information about the Openembedded-core mailing list