Commit Graph

16 Commits

Author SHA1 Message Date
Jonas Gorski
b5381de5ba linuxloader: add -armhf on arm only for TARGET_FPU 'hard'
There are two types of soft FPU options for arm, soft and softfp, and if
using the latter the wrong dynamic loader will be used.

E.g. go will link against ld-linux-armhf.so.3, but libc6 will only ship
a ld-linux.so.3, so go programs will fail to start.

Fix this by instead checking for TARGET_FPU being 'hard' and then
applying the suffix.

(From OE-Core rev: c7426629245db2ea8d9f3cf25b575ac31b5a83b0)

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 07b4c7a2bd23f8645810e13439e814caaaf9cd94)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-07-09 06:06:09 -07:00
Khem Raj
987ab9f860 linuxloader.bbclass: Add entry for ppc64 LE glibc loader
(From OE-Core rev: 6f0d401a508b55f30c11eec8cd875524eb75c40a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-17 13:42:31 +01:00
Khem Raj
a5517f5021 linuxloader: Be aware of riscv32 ldso
(From OE-Core rev: 0d7aa00663e1e41980afb24d0ada2d76e8723e2b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-17 13:42:31 +01:00
Khem Raj
1963444d58 linuxloader: Deal with little-endian ppc64 ldso name
On ppc64le 'le' should be appended to ldso name

(From OE-Core rev: dd221cdc8630a5adba1f87ff7a237021e9a95548)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-23 22:35:00 +00:00
Richard Purdie
e90cea97d2 linuxloader: Avoid confusing string concat errors
None is a bad choice of return value for functions used in variables
(strings) as a failure results in concatination errors. Use a string
with a clear meaning that can be searched for instead.

(From OE-Core rev: c04f04e714ede5d3904058ec82459139ed5e42fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-19 17:18:07 +00:00
Jon Mason
ceefa75ac0 Space-comma Cleanups
Multiple files have " ," instead of ", " in expressions.  This changes
them to conform to the way the rest of them are done.

Found and corrected via:
git ls-files | xargs sed --follow-symlinks -i 's/ ,d/, d/g'

(From OE-Core rev: 36c3afd2dd8bded02ea8f255e89a09ebd75c795b)

Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-30 15:01:51 +01:00
Khem Raj
17bac2333e linuxloader.bbclass: Define riscv32 ldso for musl
(From OE-Core rev: c178a5609b2f3cca52532a8b6d6a5927cad386db)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-12 14:49:00 +01:00
Khem Raj
9b7daa6650 linuxloader: Add get_musl_loader_arch function
get_musl_loader_arch returns the arch part of ldso for musl, this is
used in get_musl_loader() as well as independently usable, which is
needed for multilib support in musl. Musl stores all ldso in /lib
be it multilib or not, therefore do not use base_libdir instead directly
use /lib

[YOCTO #11971]

(From OE-Core rev: 0b694592c417c1d21913905f5032d300c9635866)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-21 22:39:00 +00:00
Alex Kiernan
7a6f7688b4 linuxloader: Correct loader for glibc on armhf
Fix the naming of the loader on armhf to match what glibc expects:

  #define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
  #define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"

(From OE-Core rev: 7ad531093d620f18c04d487d79e9dad9f5a96232)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30 23:39:09 +00:00
Khem Raj
c47b8300be linuxloader: Add entries for riscv64
(From OE-Core rev: 1cd6ffcabea2036fde6493f75687e546c6fe003c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-14 17:33:49 +01:00
Khem Raj
244caa1dbf linuxloader.bbclass: Refactor to have seprate functions for musl/glibc loader
this makes it possible to use this for musl where we are trying to
create a glibc compat package

Add missing aarch64 loader definition for glibc function

(From OE-Core rev: 0a02ea79ec522582b46138a027eb166819e5647d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-21 18:45:46 -07:00
Richard Purdie
516697bed6 linuxloader: Convert to python function
We could do with one decent general purpose python function to query the
path to the dynamic loader. Convert the shell code into python.

Also correct baremetal to return "None", not musl loaders.

(From OE-Core rev: 73fab4ede12d8ae31be72b5cb4ab29d7ef7dae17)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-23 17:58:59 +01:00
Ming Liu
59ec03c5bc linuxloader.bbclass: add musl libc support
Current linuxloader.bbclass does not support musl libc ldso, so add it
in.

After changing, now the linuxloader function will call a subfunction
according to which virtual/libc is being used, glibc or musl, the
linuxloader_musl function is made on top of the LDSO macro defined
in musl source, by mapping related OE variables to it.

Change tested on following machines:
"genericx86"
"genericx86-64"
"beaglebone"
"qemumips64"
"qemuarm64"
"mpc8315e-rdb"
"edgerouter"
"qemumips"
"kc705-microblazeel" - meta-xilinx
"qemuppc"

(From OE-Core rev: 5d4acaed81a811912e60d85c507bee819623369e)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-08 13:34:46 +01:00
Mark Hatle
1ddd23c542 linuxloader.bbclass: Adjust mips to cover all mips/mips64
[YOCTO #10389]

Use a glob (*) to match all mips (not previously matched).  This will ensure
that the linuxloader is properly returned for mips, mipsel, mips64,
mips64el and their n32 variants.

See: https://sourceware.org/glibc/wiki/ABIList#mips for the official list
of loaders.

(From OE-Core rev: b90d68fda3d14b4d19b7ffcb5b80ed28563a616d)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Zubair Lutfullah Kakakhel
8535ed9867 linuxloader.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA. The loader is located at a
new place for multiarch.

For more details, check https://wiki.debian.org/Multiarch
and https://sourceware.org/glibc/wiki/ABIList#mips

(From OE-Core rev: 27537d146f3f143b06819102c348c8914287ec8e)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Richard Purdie
ae85c4b9a6 linuxloader/image-prelink/image-mklibs: Fix non-standard path prelinking
Prelinking on x86-64 wasn't working out the box as it uses /lib and
not /lib64 for libs. Prelink was refusing to link as the dynamic loader
didn't match its idea of the right path. Passing in the --dyanmic-linker
option avoids this.

We can share code from image-mklibs so abstract that into a new class,
linuxloader.bbclass.

This does break prelinking of multilib images, I've opened a bug so we
can loop back and fix that problem, the code would need to iterate the
dynamic loaders (and setup ld.so.conf files for it).

(From OE-Core rev: 7c3f2f61536cc8e0322087558cdcfe29ee2fac6d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 00:11:40 +00:00