aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
AgeCommit message (Collapse)Author
2018-10-29meson: map powerpc64 TARGET_ARCH to ppc64 for the cross fileVictor Kamensky
Meson uses 'ppc64' for 64 bit powerpc. Issue came up while building systemd for MACHINE that uses ppc64e5500 tune. Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-12meson.bbclass: Fix build issues with /tmp mounted with noexecMark Asselstine
Since commit d297f7ebf3f6 [fribidi: use Meson instead of autotools] build failures have been observed with this package. The immediate issue was related to improperly named #defines per https://github.com/fribidi/fribidi/commit/46f52d588ab5, however, the root cause was FRIBIDI_SIZEOF_INT getting a value of "-1". After searching the meson logs the following was found: Could not run: /tmp/tmp2fxe6ha1/output.exe (error: [Errno 13] Permission denied) Checking for size of "int": -1 Which pointed to the real root cause being /tmp mounted with noexec, a common configuration on Redhat and other distros. This issues has been raised in the meson community: https://github.com/mesonbuild/meson/issues/2972 but is yet to be addressed. Using the discussion from issue#2972 and the fact that the underlying code makes use of python 'tempfile' we can simply create a 'tmp' directory and make use of TMPDIR to avoid this issue. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25meson: stop Meson using target CFLAGS in native buildsRoss Burton
With the goal of autoconf-compatibility Meson respects $CFLAGS et al in builds. In cross-compiled build the cross file is the one true source of flags and the environment isn't used, but in a native build the environment will still be respected. As this can lead to target flags being used in the build for native binaries (including a single native binary inside a target recipe), export CFLAGS=${BUILD_CFLAGS) et al. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25meson: pass correct endian in the cross fileRoss Burton
Meson doesn't care for the value of the endian field, but packages may want to use it and Meson master now validates the value. Use siteinfo to obtain the endianism and write the correct value. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02meson: don't dump full error log on failureRoss Burton
If the configure fails then we don't really want to see hundreds of lines of test output (this would be similar to dumping out autoconf's config.log). The error includes the path of the full log if further debugging is required. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10meson: improve code styleRoss Burton
Use elif for consistency. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06meson: map mipsel TARGET_ARCH to mips for the cross fileRoss Burton
Meson uses 'mips' for both big- and little-endian MIPS machines, so map mipsel to mips. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04meson: map architecture to correct values in cross fileRoss Burton
The cross file specifies the host/target cpu_family, which should be one of a defined set of values[1] but if it isn't Meson won't complain and instead recipes may behave unexpectedly. [1] http://mesonbuild.com/Reference-tables.html#cpu-families Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04meson: various class improvementsRoss Burton
- Ensure that the PACKAGECONFIG arguments are always in EXTRA_OEMESON - Log the arguments that are being passed in do_configure. - Do verbose builds so the compile logs are useful for debugging build problems Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18meson: only use lists of commands in cross file if requiredRoss Burton
There's a bug in Meson[1] where it find_program("foo") will fail if foo is defined in the cross file as a list. This is causing the Meson build of libdrm to fail, but for this instance we can work around the problem by only using lists in the cross file if there are arguments, and just using a string if there are not. [1] https://github.com/mesonbuild/meson/issues/3737 Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-03meson.bbclass: refactor native overrideMartin Kelly
The native override is specified in two different places, so let's move it into a function to reduce code duplication. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06meson.bbclass: fix to build for more projectsChen Qi
We should use the value of CC for the c compiler setting in cross compilation configuration file for meson. For example, if we only use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following do_compile failure for systemd. cc1: fatal error: linux/capability.h: No such file or directory Do the same change for LD, AR, NM, STRIP and READELF. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-24meson.bbclass: Add support for nativesdkPeter Kjellerstedt
We need to use the meson.cross file when building for nativesdk. Additionally, we need to trick meson's sanity tests, just as it is done for target builds. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29meson: Adjust for clang compilerKhem Raj
Remove hardcoding c/c++ compiler to be gcc alone, its possible to use clang as replacement for cross compilers from meta-clang, therefore set clang/clang++ if TOOLCHAIN = "clang" Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19meson.bbclass: add MESON_LINK_ARGS to vardepsMartin Kelly
Currently, we include MESON_C_ARGS in write_config[vardeps], but we don't include MESON_LINK_ARGS, which also affects meson.cross. In addition, we include TOOLCHAIN_OPTIONS, from which both are derived. Add MESON_LINK_ARGS, and remove TOOLCHAIN_OPTIONS, which does not directly appear in meson.cross and should be pulled in indirectly by MESON_C_ARGS and MESON_LINK_ARGS. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-19meson.bbclass: include C{, XX}FLAGS in cross argsMartin Kelly
Currently, CFLAGS and CXXFLAGS are not making it into the compile line. This is because meson appends CFLAGS/CXXFLAGS from the environment only for native but not for cross builds (probably to keep cross-builds more isolated). As a result, we need to make sure these vars goes into meson.cross. This is similar to what cmake.bbclass does with OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS. Change c_args and cpp_args in meson.cross to include these vars, and update write_config[vardeps] accordingly. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-19meson.bbclass: compile with --buildtype plainMartin Kelly
OE manages all the compile flags, so we don't want meson to inject its own flags. Currently, it's injecting -O0 and causing build breaks when security flags are enabled (because _FORTIFY_SOURCE requires an optimized build and meson defaults to a debug -O0 build). Add --buildtype plain so meson will not add its own optimization flags. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-12meson.bbclass: use HOST_CC_ARCH, not TARGET_CC_ARCHChristopher Larson
Using TARGET_CC_ARCH is inconsistent with CC, which uses HOST_CC_ARCH, and the rest of meson.bbclass, which uses HOST_PREFIX, HOST_OS, etc. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05meson: export native env only for native buildMartin Kelly
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. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04meson: add a recipe and class from meta-oeAlexander Kanavin
The original recipe has been provided and improved by: Ross Burton <ross.burton@intel.com> Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Adam C. Foltzer <acfoltzer@galois.com> Peter Kjellerstedt <peter.kjellerstedt@axis.com> Linus Svensson <linussn@axis.com> I have added patches to fix up gtk-doc and gobject-introspection in cross-compilation environments, and also change the order of linker arguments to replicate autotools more closely (and fix linking errors in some corner cases). Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>