Commit Graph

26 Commits

Author SHA1 Message Date
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Richard Purdie 04db2f5238 uninative: Parameterise the use of STAGING_DIR
This means that a user can change TMPDIR in a multiconfig situation
and still only have one path to the uninative setup. Without this change
its not possile to make such a setup work.

(From OE-Core rev: 779422c5458f5f643b3a4a0dedaa4d9ad709367a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 12:36:40 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ed Bartosh c21cec8488 uninative: rebuild uninative for gcc 4.8 and 4.9
Some c++ libraries fail to build if uninative is built
with gcc 5.x and host gcc version is either 4.8 or 4.9.

The issue should be solved by making separate uninative sstate
directory structure sstate-cache/universal-<gcc version> for host gcc
versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc
is either 4.8 or 4.9 and it doesn't match gcc version used to build
uninative.

[YOCTO #10441]

(From OE-Core rev: d36f41e5658bbbb6080ee833027879c119edf3e0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ross Burton 5fd4cada2e conf: add C++ flags for uninative interoperatility
Create a common include file for compiler flags which allow native binaries to
be interoperable on a wide range of hosts. In particular the C++ ABI is
problematic so choose the CXX11 version to allow interoperation between gcc4 and
gcc5 based hosts. Moving this to a common include instead of uninative.bbclass
allows uninative to be configured later and used in the eSDK (where its
mandatory) even if the base configuration doesn't enable uninative by default
(e.g. nodistro in OE-Core).

[ YOCTO #10645 ]

(From OE-Core rev: 60c912ae9306532bdd4c5e09a65863ee77c12f43)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-28 15:49:15 +00:00
Richard Purdie 1b2df6e942 uninative: Switch md5sum -> sha256
There are various concerns about md5 so use sha256 instead.

(From OE-Core rev: a88603cb2ffd4f995e16349a389902eb884252e5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:15:03 +01:00
Ross Burton 07f0af3d33 uninative: don't try to relocate static binaries
patchelf will understandably error out if there isn't a .interp section to
relocate, so don't try to relocate static binaries.

(From OE-Core rev: 2a1803e64174825d9392094ae6e680a1ac96eb4a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Ross Burton 10b6037624 uninative: ensure patchelf errors are visible
(From OE-Core rev: 9840bfbe7d860bdb7ad9ac444a82f95510d48c2d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Richard Purdie 637b3c8259 uninative: Add a fix for icu-native to use the correct ABI
If no -std= option is passed to icu's configure, it defaults to CXX11.
This isn't what we want for uninative, so pass an explicit option
which selects an older ABI on newer versions of g++.

This avoids the __cxa_bad_array_new_length@CXXABI_1.3.8 symbol
being used.

(From OE-Core rev: ac59063bee0e32d0737340974f657341717a6abe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:48 +00:00
Richard Purdie d27644e2b8 uninative: Handle relocate of GCONV_PATH in libc
uninative hand codes the list of files which need relocation, add the libc
to that list to ensure GCONF_PATH is updated.

(From OE-Core rev: f8a9819a2ef3ebf4b40633e9308b66671aa9af83)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 12:41:38 +00:00
Richard Purdie 0523499799 uninative: Add checksum support
We need to be able to update uninative if the version changes. To do this,
stash a checksum of the installed uninative tarball into a file. If this
changes, we update uninative.

For cleaner download messages, we place the tarballs into directories
based on the checksum.

(From OE-Core rev: f767f94295032792d84fd323bffee137a6467e01)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 12:41:38 +00:00
Richard Purdie 73265d10da uninative: Refactor common code
Move duplicate code into a common function

(From OE-Core rev: 1a6b39ccd55e6b26f9eb4e05089b8b97396d53d5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 12:41:38 +00:00
Richard Purdie 4feb00df18 uninative: Use CXX11 ABI for interoperation between gcc4 and gcc5
We may see binaries built with gcc5 run or linked into gcc4 environment
so use the older libstdc++ standard for now until we don't support gcc4
on the host system. https://wiki.debian.org/GCC5 has more details about this.

(From OE-Core rev: 1925ead3828dcd50ef96212c2d1ea9c35bc9f13c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 12:41:38 +00:00
Ross Burton 013dd24bce uninative: correctly enable uninative
The previous attempt at soft-failing when uninative was enabled didn't actually
work, because the workers didn't evaluate the function that actually enabled
uninative.

In a BuildStarted handler we can check if we need to download or extract the
uninative tarball.

In a ConfigParsed handler on the workers we can check if the uninative loader is
present, and if so enable it.

(From OE-Core rev: 75fc9a8d408640d97481d310084b212a01dc5f8b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 12:41:38 +00:00
Ross Burton 55ae56687a uninative.bbclass: if the loader can't be found disable instead of failing
(From OE-Core rev: 99ae0859ba5fa83c9cfd75a814f8281624e8987e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:59 +00:00
Ross Burton 50b8740fba uninative: use check_output instead of Popen directly
(From OE-Core rev: 938687db0255d749ed8110d68628e505967b7131)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:59 +00:00
Ross Burton 4495e8bae0 lib/oe/qa: add explicit exception for 'file isn't an ELF'
(From OE-Core rev: 4c1fe0cbcb98b0a69ad5b3a04432055d773ee4ba)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:32:59 +00:00
Ross Burton 7a700f59d9 lib/qa.py: raise ValueError if file isn't an ELF
Instead of raising a generic Exception that can't be handled specifically, raise
a ValueError.  Also update the callers so any unexpected exceptions are not
ignored.

Also, rename isBigEngian() to isBigEndian().

(From OE-Core rev: c136652f9c0b35aafa393e63567daf029ae03929)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 11:17:10 +00:00
Patrick Ohly c38f25377b uninative.bbclass: capture stdout/err from patchelf-uninative
When patchelf-uninative fails, reporting only the exit code
as done by subprocess.check_call() is not enough to understand
the problem. We also need to capture and report the output
of the command.

(From OE-Core rev: 87e744791e59806d0c87b37d72ff32a96bbcb929)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 12:31:43 +00:00
Richard Purdie 0cc825f13e uninative: Improve error handling
We need to improve the error handling here, things were breaking and
yet the user wasn't seeing the issues. We need to skip libraries as
we process the files.

(From OE-Core rev: 95b161a6661faf654fed5c69b905157e927bcb5f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06 23:10:45 +00:00
Ross Burton cac47db9c5 uninative: handle UNINATIVE_URL being file:///
If the local fetcher is used then files are not actually fetched into DL_DIR, so
check if this happened and if required add a symlink to the real file.

(From OE-Core rev: a13b0a0b79cf4db9f247facf71c03344b60be890)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:31:58 +00:00
Ross Burton 99958140a2 uninative: fix path to patchelf-uninative
When uninative was changed to use it's own sysroot the path to patchelf lost
${bindir_native}, so add it back.

(From OE-Core rev: d986f90937b7b4c60128003ef5d30d01ac1653e3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:31:58 +00:00
Richard Purdie e66599f374 uninative: Fix conflicts with normal sysroot
Currently this code installs into the standard sysroot, however this causes
some conflicts when linking since the linker can look specifically for
versioned .so files (e.g. like libpthreads.so.0). This breaks builds
of util-linux-native for example.

The easiest solution is to install uninative into its own separate sysroot.

(From OE-Core rev: e2403bc637e2967a028718058f987cc8841a6edc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:34 +00:00
Richard Purdie 29c5edaf46 uninative: Add fetch capability
Originally, the idea was that the init environment would handle
fetching or providing the binary shim that uninative needs.

This turns out to be ugly, especially when you consider proxy
environments and so on getting involved. Instead, lets therefore
support our fetcher which already handles all this.

The distro is expected to setup configuration like:

UNINATIVE_URL ?= "http://mydomain/mypath/"
UNINATIVE_CHECKSUM[i586] =
"md5sum1"
UNINATIVE_CHECKSUM[x86_64] = "md5sum2"

and then it should all work if the user inherits the uninative class.

This patch also improves the error handling in the class to give more
user readable error messages.

If the shim binary is already provided, the system will just use that
and ignore the url information.

(From OE-Core rev: 89097d2d7bf058136b01ec982b9453b49052b1d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:34 +00:00
Randy Witt a5dd1dd890 uninative.bbclass: Choose the correct loader based on BUILD_ARCH
Previously UNINATIVE_LOADER was always ld-linux-x86-64.so.2. That is
incorrect when the host is 32-bit.

This change also changes to using ?= so the user can override
UNINATIVE_LOADER if so desired.

[YOCTO #8124]

(From OE-Core rev: b78fa0bcadd54bb29b6f1bb3a9308d4c454bf4e2)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-16 12:12:15 +00:00
Richard Purdie 2cbab459e4 uninative: Add uninative - a way of reusing native/cross over multiple distros
These patches are the start of a new idea, a way of allowing a single set of
cross/native sstate to work over mutliple distros, even old ones.

The assumption is that our own C library is basically up to date. We build
and share a small tarball (~2MB) of a prebuilt copy of this along with a
patchelf binary (which sadly is C++ based so libstdc++ is in there). This
tarball can be generated from our usual SDK generation process through
the supplied recipe, uninative-tarball.

At the start of the build, if its not been extracted into the sysroot, this
tarball is extracted there and configured for the specified path.

When we install binaries from a "uninative" sstate feed, we change the
dynamic loader to point at this dynamic loader and C librbary. This works
exactly the same way as our relocatable SDK does. The only real difference
is a switch to use patchelf, so even if the interpreter section is too small,
it can still adjust the binary.

Right now this implements a working proof of concept. If you build the tarball
and place it at the head of the tree (in COREBASE), you can run a build from
sstate and successfully build packages and construct images.

There is some improvement needed, its hardcoded for x86_64 right now, its trivial
to add 32 bit support too. The tarball isn't fetched right now, there is just a
harcoded path assumption and there is no error handling. I haven't figured
out the best delivery mechanism for that yet. BuildStarted is probably not
the right event to hook on either.

I've merged this to illustrate how with a small change, we might make the
native/cross sstate much more reusable and hence improve the accessibility
of lower overhead builds. With this change, its possible the Yocto Project may
be able to support a configured sstate mirror out the box. This also has
positive implications for our developer workflow/SDK improvements.

(From OE-Core rev: e66c96ae9c7ba21ebd04a4807390f0031238a85a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-23 20:31:18 +01:00