Re: [OE-core] [PATCH] rust-cross-canadian: Fix for the linker issues caused by using the shell

Richard Purdie
2022-09-05T11:54:02Z

On Mon, 2022-09-05 at 00:12 -0700, Sundeep KOKKONDA wrote:
> Using CC args causing linker error "unknown executable format" so I
> called linker directly.
> Also, I wrote my initial code without any hardcoded symbols and that
> test code works in my local machine but when the same code executed
> in Yocto build environment SIGSEGV faults are reported. And to debug
> the issue in Yocto build environment the printf/echo outputs are not
> shown in console/log file. So, I modified my code to check whether
> this solution works in AB machine or not.
>
> Can you let me know what is the error in AB machine
> with unsetenv("LD_LIBRARY_PATH"); ? Is it the same relocation error?

The issues would be due to the issues I mentioned in reply to your
patch on the mailing list. The fixed length string and number of
arguments issues.

In the interests of moving forward, I put the binary shim in front of
the shell script which can make the environment manipulations more
easily.

https://git.yoctoproject.org/poky/commit/?h=master-next&id=7a1bfb2f800c00d3d2bea9e20e5d31d32f247129

The version of the code above seems to work, I ran some tests
specifically on ubuntu1804.

I added in some comments so we know in future why the code is doing
this.

I wondered if we could make that script MIT license rather than GPL-2.0
just to try and keep our licensing fractionally simpler?

Cheers,

Richard