Commit Graph

25 Commits

Author SHA1 Message Date
Lei Maohui
919d8bd056 meson.bbclass: Make meson support aarch64_be.
Added aarch64_be into cpu family.

(From OE-Core rev: 40187613038aa9c1ca16eaa46d0669f69f80a398)

Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-27 17:06:34 +01:00
Alexander Kanavin
259e9a11e1 llvm: fix more places where '8.0' version of llvm was hardcoded
So that it says '8.0.0' to reflect the recent PV change.

(From OE-Core rev: 3b4049157a72bcd984f93405a75946a39c045f2d)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-01 14:48:44 +01:00
Anuj Mittal
bd5c9ca7c8 meson.bbclass: point to llvm-config
Allow packages using llvm-config to find it using meson's dependency
interface.

(From OE-Core rev: e2e733c813e1eabaaff795a30b82e703dfeecfe7)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15 16:05:37 +00:00
Lei Maohui
d7d492af8e Added armeb into meson.bbclass.
(From OE-Core rev: b0021e3d33ba0fb60a340d4553267b18d296b2be)

Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 12:35:53 +00:00
Andrea Adami
3c6751ee7a meson.bbclass: map mips64el TARGET_ARCH to mips64 for the cross file
Meson uses 'mips64' for both big- and little-endian MIPS64 machines,
so map mips64el to mips64.

(From OE-Core rev: 8d1023f222f32ef64d37c3cb15b7dcf9c3e5990d)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:02 +00:00
Victor Kamensky
4f7deccda2 meson: map powerpc64 TARGET_ARCH to ppc64 for the cross file
Meson uses 'ppc64' for 64 bit powerpc. Issue came up while
building systemd for MACHINE that uses ppc64e5500 tune.

(From OE-Core rev: eccd5414c37be26df63a90154c1808f6f5618b7d)

Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-29 17:26:47 +00:00
Mark Asselstine
6dd32df4b4 meson.bbclass: Fix build issues with /tmp mounted with noexec
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.

(From OE-Core rev: 9800daf59d2235bc492d1aeb600e46ad62303510)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-12 16:57:21 +01:00
Ross Burton
feb5e7ed50 meson: stop Meson using target CFLAGS in native builds
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.

(From OE-Core rev: 4ca0002860dca771836c0ce1c7a92b79a5f2db3f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25 23:15:49 +01:00
Ross Burton
16729efc18 meson: pass correct endian in the cross file
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.

(From OE-Core rev: 2f9adf05efdddf8dae9c58976ae56cf32d9e57f0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25 23:15:49 +01:00
Ross Burton
1b52a28de8 meson: don't dump full error log on failure
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.

(From OE-Core rev: 09917f582aa1a7b752fa96303e06f9f4712a1d86)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 09:30:11 +01:00
Ross Burton
7af5e3bad3 meson: improve code style
Use elif for consistency.

(From OE-Core rev: 2ad89f12c9819326b29588a8a6c642aaae990f18)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:33:00 +01:00
Ross Burton
1276f1755b meson: map mipsel TARGET_ARCH to mips for the cross file
Meson uses 'mips' for both big- and little-endian MIPS machines, so map mipsel
to mips.

(From OE-Core rev: 23734432a24da77aa838ad4bdcbcc294cde08348)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Ross Burton
5193aedb45 meson: map architecture to correct values in cross file
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

(From OE-Core rev: e33b902a1dc4294dac148715f4d3ca5b0a6ee1b7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 00:22:08 +01:00
Ross Burton
c2ba7177f1 meson: various class improvements
- 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

(From OE-Core rev: 3112ff268d095a65ecb893dd6ca88a85b0f70446)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 00:22:08 +01:00
Ross Burton
c76ca2c65b meson: only use lists of commands in cross file if required
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

(From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Martin Kelly
34bb960160 meson.bbclass: refactor native override
The native override is specified in two different places, so let's move
it into a function to reduce code duplication.

(From OE-Core rev: c455ec4a12d4966524da9436722476aa2d428765)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
d1e6aa57f7 meson.bbclass: fix to build for more projects
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.

(From OE-Core rev: 177bd96a531fcc85e62baff04aba327e2bccee07)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Peter Kjellerstedt
eaa9356744 meson.bbclass: Add support for nativesdk
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.

(From OE-Core rev: abcb330c462c2c06d36f8f3681a6bd07d562c1fe)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:47 +00:00
Khem Raj
e13b6f76c7 meson: Adjust for clang compiler
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"

(From OE-Core rev: 05789489d25a5ceac0403613ad789d78198be6ee)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 08:49:50 +00:00
Martin Kelly
9ce6fa9a8f meson.bbclass: add MESON_LINK_ARGS to vardeps
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.

(From OE-Core rev: 4db37cc8d9139076682e2528d29e92fad2eb1c90)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Martin Kelly
ff5634ad88 meson.bbclass: include C{, XX}FLAGS in cross args
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.

(From OE-Core rev: f435d1b75d3775f6ec0df6027766008b40209fd7)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Martin Kelly
b895d11862 meson.bbclass: compile with --buildtype plain
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.

(From OE-Core rev: 73ff85986d82c8da601d7c7cf9a02961f2f66a09)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Christopher Larson
ac18f28e22 meson.bbclass: use HOST_CC_ARCH, not TARGET_CC_ARCH
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.

(From OE-Core rev: 8a61e0c0c53275ebc623296f46676d920b11eb3b)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-13 10:15:20 +00:00
Martin Kelly
f437138784 meson: export native env only for native build
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.

(From OE-Core rev: de7ae028c65a978969b2e06fdc1a2d08bc141a5b)

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-05 12:02:37 +00:00
Alexander Kanavin
0d2020fcff meson: add a recipe and class from meta-oe
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).

(From OE-Core rev: 1f8dea686cdfd6d360ba4a97f62d274c39eaeb8e)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 11:55:35 +00:00