Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-04-29 Thread Hemraj, Deepthi via lists.openembedded.org
[Edited Message Follows]

Hello Randy,

I verified rust.sh and cargo.sh in the installed sdk those are generated 
differently based on the multilib tuning.
...poky/build/tmp/deploy/sdk/install > fd rust.sh
sysroots/x86_64-pokysdk-linux/environment-setup.d/rust.sh
sysroots/x86_64-pokysdk-linux/environment-setup.d/lib32-rust.sh

...poky/build/tmp/deploy/sdk/install > fd cargo.sh
sysroots/x86_64-pokysdk-linux/environment-setup.d/cargo.sh
sysroots/x86_64-pokysdk-linux/environment-setup.d/lib32-cargo.sh

I tested a sample program on 32 and 64 bit targets and its working. Below are 
the steps:
I copied the Rust compiler binaries generated for both 
armv7at2hf-neon-pokymllib32-linux-gnueabi and cortexa57-poky-linux into a QEMU 
environment and executed a simple "Hello, World!" program using these binaries.

...poky/build/tmp/work/armv7at2hf-neon-pokymllib32-linux-gnueabi/lib32-rust/1.74.1/image/usr/bin
 > scp -r rustc root@192.168.7.6:/arm32/
rustc                                        100%   13KB   2.2MB/s   00:00

root@qemuarm64:/arm32# cat hello.rs
fn main() {
println!("Hello, World!");
}

root@qemuarm64:/arm32# ./rustc hello.rs
root@qemuarm64:/arm32# ./hello
Hello, World!


...poky/build/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/build/aarch64-poky-linux-gnu/stage2/bin
 > scp  rustc root@192.168.7.6:/arm64
rustc                                                                           
            100%   74KB   4.6MB/s   00:00

root@qemuarm64:/arm64# ls
rustc
root@qemuarm64:/arm64# vi hello.rs
root@qemuarm64:/arm64# cat hello.rs
fn main() {
println!("Hello, World!");
}
root@qemuarm64:/arm64# ./rustc hello.rs
root@qemuarm64:/arm64# ./hello
Hello, World!

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-04-29 Thread Hemraj, Deepthi via lists.openembedded.org
[Edited Message Follows]

Hi Randy,

I copied the Rust compiler binaries generated for both 
armv7at2hf-neon-pokymllib32-linux-gnueabi and cortexa57-poky-linux into a QEMU 
environment and executed a simple "Hello, World!" program using these binaries. 
Below are the steps I followed:

...poky/build/tmp/work/armv7at2hf-neon-pokymllib32-linux-gnueabi/lib32-rust/1.74.1/image/usr/bin
 > scp -r rustc root@192.168.7.6:/arm32/
rustc                                        100%   13KB   2.2MB/s   00:00

root@qemuarm64:/arm32# cat hello.rs
fn main() {
println!("Hello, World!");
}

root@qemuarm64:/arm32# ./rustc hello.rs
root@qemuarm64:/arm32# ./hello
Hello, World!


...poky/build/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/build/aarch64-poky-linux-gnu/stage2/bin
 > scp  rustc root@192.168.7.6:/arm64
rustc                                                                           
            100%   74KB   4.6MB/s   00:00

root@qemuarm64:/arm64# ls
rustc
root@qemuarm64:/arm64# vi hello.rs
root@qemuarm64:/arm64# cat hello.rs
fn main() {
println!("Hello, World!");
}
root@qemuarm64:/arm64# ./rustc hello.rs
root@qemuarm64:/arm64# ./hello
Hello, World!

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-04-29 Thread Hemraj, Deepthi via lists.openembedded.org
[Edited Message Follows]

Hi Randy,

I couldn't reproduce the same issue with the latest commits. Below is the issue 
reproduced on the latest sources:

file /usr/include/finclude/math-vector-fortran.h conflicts between attempted 
installs of lib32-libc6-dev-2.39+git0+6d1e3fb07b-r0.armv7at2hf_neon and 
libc6-dev-2.39+git0+6d1e3fb07b-r0.cortexa57

So I reverted to older commits and was able to reproduce the issue. Following 
the commands you provided:

...poky/build > rustc --version

rustc 1.72.1 (d5c2e9c34 2023-09-13) (built from a source tarball)

...poky/build > rustc --print=target-list | rg linux | wc -l

70

...poky/build > rustc --print=target-list | rg linux | head

aarch64-linux-android

aarch64-unknown-linux-gnu

aarch64-unknown-linux-gnu_ilp32

aarch64-unknown-linux-musl

aarch64-unknown-linux-ohos

aarch64_be-unknown-linux-gnu

aarch64_be-unknown-linux-gnu_ilp32

arm-linux-androideabi

arm-unknown-linux-gnueabi

arm-unknown-linux-gnueabihf

The cargo.sh and rust.sh scripts generated for multilib libraries are 
identical, except for the file paths, which are different for 32-bit and 64-bit 
target architectures. This resolves the conflict issue between attempted 
installs of rust-cross-canadian-arm and rust-cross-canadian-aarch64. I will 
investigate on it further and inform.

Thank you,

Deepthi

*From:* MacLeod, Randy 
*Sent:* Saturday, February 3, 2024 1:46:09 AM
*To:* Ross Burton ; Hemraj, Deepthi 

*Cc:* OE Core mailing list ; Gowda, 
Naveen ; Moodalappa, Shivaprasad 
; Kokkonda, Sundeep 
; alex.kier...@gmail.com 

*Subject:* Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for 
arm and aarch64

Add Alex, who might actually be using YP Rust with multilib support.

On 2023-12-22 9:40 a.m., Ross Burton wrote:

> 
> On 16 Dec 2023, at 08:56, Hemraj, Deepthi via lists.openembedded.org 
> 
> ( Deepthi.Hemraj=windriver@lists.openembedded.org ) wrote:
> 
>> The current patch modifies CARGO_ENV_SETUP_SH and RUST_ENV_SETUP_SH macros
>> that uses MLPREFIX based on the multilib architecture.
>> Hence, creates
>> different file names for the environment setup scripts and resolves the
>> issue.
>> 
> 
> This solves the file conflicts if you put a 32-bit and 64-bit rust
> cross-compiler into a SDK, but is that actually a usable setup if the
> environment scripts are both overwriting the same environment variables?
> 
> Ross

I think what Ross is asking is how would we actually use rust in the SDK if we 
wanted to target different multilibs?

The rust compiler , unlike gcc, can actually target multiple target ABIs 
(x86-64, arm64, x86, arm) using a single binary:

Try running one of :

❯ rustc --print=[target-list, target-cpus, target-features]

eg on my laptop:

❯ rustc --version
rustc 1.71.1 (eb26296b5 2023-08-03)

❯ rustc --print=target-list | rg linux | wc -l
70

❯ rustc --print=target-list | rg linux | head
aarch64-linux-android
aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu_ilp32
aarch64-unknown-linux-musl
aarch64-unknown-linux-ohos
aarch64_be-unknown-linux-gnu
aarch64_be-unknown-linux-gnu_ilp32
arm-linux-androideabi
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf

Please reply to this thread if you have a question or
once you have confirmed that theses commands also work in a 32 and 64 bit SDKs 
from a Yocto build.

Furthermore, if you have just one version of Rust, can you (easily) compile, 
link on the dev box and then copy the executable to
a qemu instance and run hello-world for both multilibs. Please show each step 
to confirm that you are using the SDK
version of Rust and then you aren't getting any help (rust or linker) from the 
host distro.

The linker is target specific as shown, for Ubuntu, here:
https://medium.com/swlh/compiling-rust-for-raspberry-pi-arm-922b55dbb050 ( 
https://medium.com/swlh/compiling-rust-for-raspberry-pi-arm-922b55dbb050 )

Does it make sense to have two versions of cargo.sh ? I suspect that it would 
not but I haven't worked with multlib SDKs very much, at least not recently.

Also, I'm not sure off-hand, exactly how we should fix the original bug but 
maybe we should be adding code that just checks for multilib configuration and 
'magically' decides which recipe will provide the Rust compiler and only 
installs the version of the linker needed or the non-default tune.

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-04-29 Thread Hemraj, Deepthi via lists.openembedded.org
[Edited Message Follows]

Hi Randy,

I copied the Rust compiler binaries generated for both 
armv7at2hf-neon-pokymllib32-linux-gnueabi and cortexa57-poky-linux into a QEMU 
environment and executed a simple "Hello, World!" program using these binaries. 
Below are the steps I followed:

...poky/build/tmp/work/armv7at2hf-neon-pokymllib32-linux-gnueabi/lib32-rust/1.74.1/image/usr/bin
 > scp -r rustc root@192.168.7.6:/arm32/
rustc                                        100%   13KB   2.2MB/s   00:00

root@qemuarm64:/arm32# cat hello.rs
fn main() {
println!("Hello, World!");
}

root@qemuarm64:/arm32# ./rustc hello.rs
root@qemuarm64:/arm32# ./hello
Hello, World!


...poky/build/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/build/aarch64-poky-linux-gnu/stage2/bin
 > scp  rustc root@192.168.7.6:/arm64
rustc                                                                           
            100%   74KB   4.6MB/s   00:00

root@qemuarm64:/arm64# ls
rustc
root@qemuarm64:/arm64# vi hello.rs
root@qemuarm64:/arm64# cat hello.rs
fn main() {
println!("Hello, World!");
}
root@qemuarm64:/arm64# ./rustc hello.rs
root@qemuarm64:/arm64# ./hello
Hello, World!

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-04-29 Thread Hemraj, Deepthi via lists.openembedded.org
Hi Randy,

I copied the Rust compiler binaries generated for both 
armv7at2hf-neon-pokymllib32-linux-gnueabi and cortexa57-poky-linux into a QEMU 
environment and executed a simple "Hello, World!" program using these binaries. 
Below are the steps I followed:

/ala-lpggp31/dhemraj/master/15061/poky/build/tmp/work/armv7at2hf-neon-pokymllib32-linux-gnueabi/lib32-rust/1.74.1/image/usr/bin
 > scp -r rustc root@192.168.7.6:/arm32/
rustc                                        100%   13KB   2.2MB/s   00:00

root@qemuarm64:/arm32# cat hello.rs
fn main() {
println!("Hello, World!");
}

root@qemuarm64:/arm32# ./rustc hello.rs
root@qemuarm64:/arm32# ./hello
Hello, World!


/ala-lpggp31/dhemraj/master/15061/poky/build/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/build/aarch64-poky-linux-gnu/stage2/bin
 > scp  rustc root@192.168.7.6:/arm64
rustc                                                                           
            100%   74KB   4.6MB/s   00:00

root@qemuarm64:/arm64# ls
rustc
root@qemuarm64:/arm64# vi hello.rs
root@qemuarm64:/arm64# cat hello.rs
fn main() {
println!("Hello, World!");
}
root@qemuarm64:/arm64# ./rustc hello.rs
root@qemuarm64:/arm64# ./hello
Hello, World!

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-01-11 Thread Hemraj, Deepthi via lists.openembedded.org
[Edited Message Follows]

Hi Ross,

May I know if any changes are required for this patch? If not, when it is 
planned to take into Kirkstone branch.

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2024-01-11 Thread Hemraj, Deepthi via lists.openembedded.org
Hi Ross,

May I know if any changes are required for this patch?

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2023-12-28 Thread Hemraj, Deepthi via lists.openembedded.org
Hi Ross,

>> if the environment scripts are both overwriting the same environment 
>> variables?

The environment script variables are generated based on the architectures.
Please find the environment variables generated in the script file:
RUST_TARGET_PATH="$OECORE_NATIVE_SYSROOT/usr/lib/aarch64-poky-linux/rustlib"
RUST_TARGET_PATH="$OECORE_NATIVE_SYSROOT/usr/lib/arm-pokymllib32-linux-gnueabi/rustlib"
Please let me know if this was your query or did I misinterrupted it?

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



Re: [OE-core] [PATCH V3] rust-cross-canadian: Fix file conflicts for arm and aarch64

2023-12-22 Thread Ross Burton
On 16 Dec 2023, at 08:56, Hemraj, Deepthi via lists.openembedded.org 
 wrote:
> The current patch modifies CARGO_ENV_SETUP_SH and RUST_ENV_SETUP_SH macros 
> that uses MLPREFIX based on the multilib architecture.
> Hence, creates different file names for the environment setup scripts and 
> resolves the issue.

This solves the file conflicts if you put a 32-bit and 64-bit rust 
cross-compiler into a SDK, but is that actually a usable setup if the 
environment scripts are both overwriting the same environment variables?

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