renesas-rcar / meta-renesas

MIT License
55 stars 80 forks source link

Hardcoded paths in the toolchain generated from the yocto build #42

Closed md-sami closed 3 months ago

md-sami commented 3 months ago

Dear Renesas Support I've generated a toolchain from a Yocto Linux build running bitbake -c populate_sdk rcar-image-..., but when I check the generated compiler using ldd, it shows hard-coded paths, as shown below.

How can I remove or avoid these hard-coded paths?

for example when running the ldd command:

ldd aarch64-poky-linux-gcc
        linux-vdso.so.1 (0x00007fff33fc5000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fee4972c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fee49503000)

/path/to/sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007fee498230

Ideally it should be something like this:

ldd ./aarch64-poky-linux-gcc:
        linux-vdso.so.1 (0x00007fff4159f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2e1ecc4000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2e1ea9b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2e1edbb000)

how can I achieve this?

I've tried setting SDK_RELOCATE_AFTER_INSTALL = "1" but it didn't help:

Thanks and Best Regards Sami

DuyDang007 commented 3 months ago

Hi,

As my understanding, the path /path/to/sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 is the path of the host that the SDK is installed to, not the build host.

Do you still want to remove it?

Best Regards, Duy

md-sami commented 3 months ago

Hi Duy ,

The path /path/to/sdk/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 corresponds to the build host (the machine on which I am building this Yocto Linux).

My goal is to copy the generated toolchain to another machine and compile test applications there.

I used the following commands to generate the toolchain

bitbake -c populate_sdk core-image-weston tmp/deploy/sdk/poky-glibc-x86_64-core-image-weston-aarch64-x5h-toolchain-3.1.20.sh -d /path/to/sdk/ -y

Best Regards Sami

DuyDang007 commented 3 months ago

Hi Sami,

Do you copy the toolchain setup file or the extracted directory?

I copy poky-glibc-x86_64-core-image-weston-aarch64-x5h-toolchain-3.1.20.sh file to the target machine and then run the setup command. It always points to the target host path.

Best Regards, Duy

md-sami commented 3 months ago

Thank you Duy,

As suggested, I've tried copying the poky-glibc-x86_64-core-image-weston-aarch64-x5h-toolchain-3.1.20.sh file to the target machine and then run the setup command , this works :)

Best Regards, Sami