diff options
-rw-r--r-- | meta/classes/image-mklibs.bbclass | 23 | ||||
-rw-r--r-- | meta/classes/image-prelink.bbclass | 6 | ||||
-rw-r--r-- | meta/classes/linuxloader.bbclass | 24 |
3 files changed, 32 insertions, 21 deletions
diff --git a/meta/classes/image-mklibs.bbclass b/meta/classes/image-mklibs.bbclass index cfb3ffc91e..6c0e8dcf35 100644 --- a/meta/classes/image-mklibs.bbclass +++ b/meta/classes/image-mklibs.bbclass | |||
@@ -2,6 +2,8 @@ do_rootfs[depends] += "mklibs-native:do_populate_sysroot" | |||
2 | 2 | ||
3 | IMAGE_PREPROCESS_COMMAND += "mklibs_optimize_image; " | 3 | IMAGE_PREPROCESS_COMMAND += "mklibs_optimize_image; " |
4 | 4 | ||
5 | inherit linuxloader | ||
6 | |||
5 | mklibs_optimize_image_doit() { | 7 | mklibs_optimize_image_doit() { |
6 | rm -rf ${WORKDIR}/mklibs | 8 | rm -rf ${WORKDIR}/mklibs |
7 | mkdir -p ${WORKDIR}/mklibs/dest | 9 | mkdir -p ${WORKDIR}/mklibs/dest |
@@ -15,26 +17,7 @@ mklibs_optimize_image_doit() { | |||
15 | | sed "s+^\./++" \ | 17 | | sed "s+^\./++" \ |
16 | > ${WORKDIR}/mklibs/executables.list | 18 | > ${WORKDIR}/mklibs/executables.list |
17 | 19 | ||
18 | case ${TARGET_ARCH} in | 20 | dynamic_loader=$(linuxloader) |
19 | powerpc | mips | mipsel | microblaze ) | ||
20 | dynamic_loader="${base_libdir}/ld.so.1" | ||
21 | ;; | ||
22 | powerpc64) | ||
23 | dynamic_loader="${base_libdir}/ld64.so.1" | ||
24 | ;; | ||
25 | x86_64) | ||
26 | dynamic_loader="${base_libdir}/ld-linux-x86-64.so.2" | ||
27 | ;; | ||
28 | i*86 ) | ||
29 | dynamic_loader="${base_libdir}/ld-linux.so.2" | ||
30 | ;; | ||
31 | arm ) | ||
32 | dynamic_loader="${base_libdir}/ld-linux.so.3" | ||
33 | ;; | ||
34 | * ) | ||
35 | dynamic_loader="/unknown_dynamic_linker" | ||
36 | ;; | ||
37 | esac | ||
38 | 21 | ||
39 | mklibs -v \ | 22 | mklibs -v \ |
40 | --ldlib ${dynamic_loader} \ | 23 | --ldlib ${dynamic_loader} \ |
diff --git a/meta/classes/image-prelink.bbclass b/meta/classes/image-prelink.bbclass index 53c4b0b112..e153f47881 100644 --- a/meta/classes/image-prelink.bbclass +++ b/meta/classes/image-prelink.bbclass | |||
@@ -6,6 +6,8 @@ python prelink_setup () { | |||
6 | oe.utils.write_ld_so_conf(d) | 6 | oe.utils.write_ld_so_conf(d) |
7 | } | 7 | } |
8 | 8 | ||
9 | inherit linuxloader | ||
10 | |||
9 | prelink_image () { | 11 | prelink_image () { |
10 | # export PSEUDO_DEBUG=4 | 12 | # export PSEUDO_DEBUG=4 |
11 | # /bin/env | /bin/grep PSEUDO | 13 | # /bin/env | /bin/grep PSEUDO |
@@ -31,8 +33,10 @@ prelink_image () { | |||
31 | fi | 33 | fi |
32 | cat ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf >> $ldsoconf | 34 | cat ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf >> $ldsoconf |
33 | 35 | ||
36 | dynamic_loader=$(linuxloader) | ||
37 | |||
34 | # prelink! | 38 | # prelink! |
35 | ${STAGING_DIR_NATIVE}${sbindir_native}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf | 39 | ${STAGING_DIR_NATIVE}${sbindir_native}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader |
36 | 40 | ||
37 | # Remove the prelink.conf if we had to add it. | 41 | # Remove the prelink.conf if we had to add it. |
38 | if [ "$dummy_prelink_conf" = "true" ]; then | 42 | if [ "$dummy_prelink_conf" = "true" ]; then |
diff --git a/meta/classes/linuxloader.bbclass b/meta/classes/linuxloader.bbclass new file mode 100644 index 0000000000..5c4dc5c51b --- /dev/null +++ b/meta/classes/linuxloader.bbclass | |||
@@ -0,0 +1,24 @@ | |||
1 | |||
2 | linuxloader () { | ||
3 | case ${TARGET_ARCH} in | ||
4 | powerpc | mips | mipsel | microblaze ) | ||
5 | dynamic_loader="${base_libdir}/ld.so.1" | ||
6 | ;; | ||
7 | powerpc64) | ||
8 | dynamic_loader="${base_libdir}/ld64.so.1" | ||
9 | ;; | ||
10 | x86_64) | ||
11 | dynamic_loader="${base_libdir}/ld-linux-x86-64.so.2" | ||
12 | ;; | ||
13 | i*86 ) | ||
14 | dynamic_loader="${base_libdir}/ld-linux.so.2" | ||
15 | ;; | ||
16 | arm ) | ||
17 | dynamic_loader="${base_libdir}/ld-linux.so.3" | ||
18 | ;; | ||
19 | * ) | ||
20 | dynamic_loader="/unknown_dynamic_linker" | ||
21 | ;; | ||
22 | esac | ||
23 | echo $dynamic_loader | ||
24 | } | ||