Add a /lib64 -> /lib symlink in case the build appliance is 64-bit.

Building rust-native requires cargo to be run. The native cargo is linked to
look for /lib64/ld-linux-x86-64.so.2 and can't be run without it. The build
produces the following error, even though that file does exist:

        FileNotFoundError: [Errno 2] No such file or directory: 
'/home/builder/poky/build/tmp/work/x86_64-linux/rust-native/1.66.1-r0/rust-snapshot/bin/cargo'

Trying to run this binary on its own gives:

        qemux86-64:~/poky/build$ 
tmp/work/x86_64-linux/rust-native/1.66.1-r0/rust-snapshot/bin/cargo
        -sh: 
tmp/work/x86_64-linux/rust-native/1.66.1-r0/rust-snapshot/bin/cargo: cannot 
execute: required file not found

Signed-off-by: Trevor Woerner <twoer...@gmail.com>
---
 meta/recipes-core/images/build-appliance-image_15.0.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/images/build-appliance-image_15.0.0.bb 
b/meta/recipes-core/images/build-appliance-image_15.0.0.bb
index ad5ea92b3eda..3a84de0a2b43 100644
--- a/meta/recipes-core/images/build-appliance-image_15.0.0.bb
+++ b/meta/recipes-core/images/build-appliance-image_15.0.0.bb
@@ -109,7 +109,13 @@ fakeroot do_populate_poky_src () {
        chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache
 }
 
-IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
+fakeroot do_tweak_image () {
+       # add a /lib64 symlink
+       # this is needed for building rust-native on a 64-bit build appliance
+       ln -rs ${IMAGE_ROOTFS}/lib ${IMAGE_ROOTFS}/lib64
+}
+
+IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; do_tweak_image; "
 # For pip usage above
 do_image[network] = "1"
 
-- 
2.36.0.rc2.17.g4027e30c53

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#177545): 
https://lists.openembedded.org/g/openembedded-core/message/177545
Mute This Topic: https://lists.openembedded.org/mt/97118450/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to