| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If there is insufficent space to change the interpreter, we were
printing an error here but the overall script did not return an error
code, and thus the SDK installation appeared to succeed - but some of
the binaries will not be in a working state. Allow the relocation to
proceed (so we still get a full list of the failures) but error out at
the end so that the installation is halted.
(From OE-Core rev: c5a9a448e462d3e5457e8403c5a1a54148ecd224)
Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
relocate_sdk.py was developed for little-endian architures and when tries
to install SDK for big-endian machines errors like below will be shown.
Error: struct.error: unpack requires a string argument of length 32. SDK could
not be set up. Relocate script failed. Abort!
Error: IOError: [Errno 22] Invalid argument. SDK could not be set up. Relocate
script failed. Abort!
To fix this, script is modified to support big-endian architecture.
(From OE-Core rev: 7d6f4b1373e4dfafc63702ef2426cd45100f18a3)
Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds SPDX license headers in place of the wide assortment of things
currently in our script headers. We default to GPL-2.0-only except for the
oeqa code where it was clearly submitted and marked as MIT on the most part
or some scripts which had the "or later" GPL versioning.
The patch also drops other obsolete bits of file headers where they were
encoountered such as editor modelines, obsolete maintainer information or
the phrase "All rights reserved" which is now obsolete and not required in
copyright headers (in this case its actually confusing for licensing as all
rights were not reserved).
More work is needed for OE-Core but this takes care of the bulk of the scripts
and meta/lib directories.
The top level LICENSE files are tweaked to match the new structure and the
SPDX naming.
(From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 6671a4d980c8bef8f402780a308f6c43a25044aa.
This breaks uninative tarball since the call of relocate_sdk.py from uninative.bbclass
wasn't updated to account for this change. It isn't clear what value that code could
pass in and this isn't simple to fix so revert until a better fix can be found
that doesn't break uninative.
(From OE-Core rev: b247392b4ced57cfe694656032f6a6723740a9e8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes hardcodes added to relocate_sdk.py
during SDK build, making it flexible and reusable.
Now default SDK path is passed to the script as
parameter rather then harcoded inside it.
This allows to reuse this script for multiple
relocations, and adds possibility to relocate
SDK multiple times
(From OE-Core rev: 6671a4d980c8bef8f402780a308f6c43a25044aa)
Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debug files only have debug symbols hence don't need
to be relocated. Relocation script throws errors when
run on the debug files. This change skips these files
that have zero size.
(From OE-Core rev: 132e8bfd499c713eb63075fd6380317b60f0bd27)
(From OE-Core rev: 93b73b2495f9cb18741837c5437de629adfd3780)
Signed-off-by: Nikunj Kela <nkela@cisco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
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>
|
|
|
|
|
|
|
| |
(From OE-Core rev: 4b544ff388497cac82b0585f237900595523e1cb)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When installing SDK in a non-default location and the path length
of the SDK install location is longer than the path length of the
default SDK location, relocation of .ldsochache section will overwrite
file location outside of the .ldsocache section size.
In addition, additional checks were added to ensure that any
path in sections .gccrelocprefix and .ldsochache will not exceed
the space allocated for it within the file, which would also result
in file corruption.
[YOCTO #9268]
(From OE-Core rev: 4d949da965a99ab33798af49e5584c8bb9f0f626)
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When fixing paths for .gccrelocprefix section, it will corrupt the next
entry during updating the current one if "new_prefix" length is more
than "DEFAULT_INSTALL_DIR", this problem is obvious on the code, but it's
only found when install sdk onto a net file system.
(From OE-Core rev: c43192c46bb1759bf6909190b89d3b60918777c5)
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Being able to build a nativesdk gcc is useful, particularly in cases
where the host compiler may be of an incompatible version (or a 32
bit compiler is needed).
Sadly, building nativesdk-gcc is not straight forward. We install
nativesdk-gcc into a relocatable location and this means that its
library locations can change. "Normal" sysroot support doesn't help
in this case since the values of paths like "libdir" change, not just
base root directory of the system.
In order to handle this we do two things:
a) Add %r into spec file markup which can be used for injected paths
such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
b) Add other paths which need relocation into a .gccrelocprefix section
which the relocation code will notice and adjust automatically.
This patch adds tweaks to the relocation script to handle the
new section too.
(From OE-Core rev: cd3d874fced2ee4c950d9964d30c0588fd8772e7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When toolchain directory is changed to execute mode, some non-executable
files or empty files are sorted. This will lead to the below error:
Extracting SDK...done
Setting it up...Traceback (most recent call last):
File "..._SDK/relocate_sdk.py", line 208, in <module>
arch = get_arch()
File "..._SDK/relocate_sdk.py", line 39, in get_arch
ei_mag0,ei_mag1_3,ei_class = struct.unpack("<B3sB11x", e_ident)
struct.error: unpack requires a string argument of length 16
To call get_arch and parse_elf_header, we should ensure the sorted file
is bigger than 64 byte.
(From OE-Core rev: 3b973f1c9c9ee3fbe64903036ad93eb9e928b185)
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 2.4 does not support the 'b' string literal or the
keyword 'as' in exception handling. Python 3 does not accept
the old method of exception handling and defaults to unicode.
The b() function converts strings to bytes on Python 3 and
using sys.exc_info() avoids the exception handling syntax.
(From OE-Core rev: 1e2ec5f576f167673d7980737826987fefdc74a9)
Signed-off-by: Konrad Scherer <Konrad.Scherer@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Strings in Python 3, by default, are assumed to contain unicode
characters. In previous versions of python (<3), unicode strings are
explicitly declared with u"abc". If not, than they're automatically
converted to bytes. This doesn't happen anymore in Python 3.
Since we're dealing with binary files, opened in byte mode, make sure
that we explicitly convert all strings to bytes to make both python 2
and 3 happy.
Other changes:
* add a safety check to make sure relocation did not change the file
size;
* a couple of cosmetic changes (wrap long lines so that we don't have
to scroll to reach the end of them);
(From OE-Core rev: 175f20e27eadc79df16109961f5ce6232705e96f)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid the chicken / egg problem of an SDK that provides a working
python but requires that version of python to extract itself. The
RHEL 5.x systems and some other enterprise Linux systems ship with
python 2.4.x as the default python. We need to at least be able to
extract work executables even if we never use the the host provided
python again.
(From OE-Core rev: e1d42db8749b0b965ddc6cfba4f3b93ee96ed4f4)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two cases of corruption that the relocate_sdk.py was not correctly
dealing with.
1) SDK Extras should be left alone
Extra external binaries included in an SDK that were linked against the
host's version of /usr/lib/ld-so.so should not get a relocation applied.
In the case that was discovered these were LSB compliant binaries that
already worked on many hosts.
2) If the interp section is too small generate an error
In the case of the qemu user code, it was using its own .ld file
to link the executables which overrides the default in the nativesdk
binutils. This generated host executables which had a interp section
that was too small to relocate.
Now the relocate_sdk.py will print an error and continue on such that
the error can be fixed by a developer without having to do the
difficult task of debugging why it is crashing or not loading correctly.
(From OE-Core rev: 3752a9c6d772b39bbe04d62ef4d3527b4c7198c1)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem: SDK binaries were not properly relocated when the SDK
was installed into a path that had a length less than the default one.
Apparently, there were two problems here: the padding was done wrong
(the size of one program header table entry was used instead of the
program section size) and the new padded string was not used at all.
[YOCTO #3655]
(From OE-Core rev: 3815030c5f31c11495893c1ae28d56c1aff31d97)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the files being relocated are already used by other processes the
relocate script will fail with a traceback. This patch will trap any IO
errors when opening such a file and gracefully report them to the user.
Also change the exit code from 1 to -1 for a better adt-installer user
experience (like pointing the user to the adt_installer.log).
[YOCTO #3164]
(From OE-Core rev: 26daec758b2eaeb208356d5aa8a9a191bd366751)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
This script will be embedded in the SDK tarball and will be called by
the SDK installer. It replaces the interpreter path in all binaries and
it also changes the ld.so.cache and SYSDIRS in dynamic loader.
(From OE-Core rev: 3d366f4953962566f33a3d77d65ed0bd2c48f922)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|