**** BEGIN LOGGING AT Mon Aug 22 02:59:56 2022 Aug 22 08:26:11 looking in to adding rust in SDK after the refactoring and clean up RP has done in oe-core around packagegroup-rust-cross-canadian.bb. But building my rust app ands up in the error message "error: linker `x86_64-pokysdk-linux-gcc` not found". Anyone that can help with some tip how to add 'x86_64-pokysdk-linux-gcc' to SDK? I can't find it. My MACHINE is qemuarm64 with a standard Poky setup. Aug 22 09:02:07 pbergin: it should be using target-rust-ccld Aug 22 09:02:27 i.e. that is the wrong linker Aug 22 09:04:52 RP: the file .../sysroots/x86_64-pokysdk-linux/usr/lib/aarch64-poky-linux/rustlib/x86_64-pokysdk-linux-gnu.json have a row "linker": "x86_64-pokysdk-linux-gcc" Aug 22 09:05:07 RP: is ot wrong? Aug 22 09:35:12 pbergin: that is the json for the host, not the target Aug 22 09:37:25 RP: yes. got it. so it seems that my rust project is somehow using the host linker for some package. then looking for 'x86_64-pokysdk-linux-gcc' which is not present. can that be a correct analyze? Aug 22 09:38:48 pbergin: yes Aug 22 09:38:51 RP: Shouldn't the the "linker" statement for the host point to something that exists in the SDK? Aug 22 10:19:09 pbergin: arguably that json shouldn't really be there at all Aug 22 10:20:16 pbergin: it is basically saying "this is the config that built the rust compiler in the SDK" Aug 22 10:34:51 ok. but it is causing problem that needs to be solved in some way. I have been able to understand one step further. some crate have a build.rs script file that is first compiled with host tools then used for building for target with target tools. so there must be a sane config for host tools also. Aug 22 10:36:51 RP: here is a way to reproduce: "cargo new hello;cd hello;echo "fn main(){}" > build.rs;cargo build -v" Aug 22 10:59:34 pbergin: we currently don't include a host rust compiler in the SDK so that would be the issue Aug 22 11:00:34 pbergin: that could be nice as an SDK test in the test suite Aug 22 11:01:09 pbergin: https://git.yoctoproject.org/poky/tree/meta/lib/oeqa/sdk/cases/rust.py Aug 22 11:40:15 RP: do you think adding rust host compiler to SDK is a big job? I can try to help out but probably need some pointers. Aug 22 11:49:52 pbergin: actually, now I think about it we have the appropriate rust compiler, we just don't have a compiler itself. You could add nativesdk-gcc to the SDK and that might work Aug 22 11:51:04 pbergin: or we patch/symlink it to the host gcc Aug 22 11:53:28 RP: how do I run the rust.py SDK testcase in my own setup? Aug 22 12:07:56 pbergin: bitbake -c populate_sdk; bitbake -c testsdk Aug 22 12:08:09 with an in the second too Aug 22 12:18:12 RP: adding nativesdk-gcc to my sdk takes me one step further. the x86_64-pokysdk-linux-gcc is present in sdk but my reproducer ends up in a segmentation fault in 'ld' Aug 22 12:22:41 pbergin: ah. That is a known problem :( Aug 22 12:22:52 rust sets LD_LIBRARY_PATH and this breaks sdk binaries Aug 22 12:25:24 well, it breaks host libraries due to interference from the sdk ones Aug 22 12:36:29 RP: known problem hard to fix or known problem soon to be solved? Aug 22 12:37:18 pbergin: so far it was a known issue running the linker for the target and we have a plan for that Aug 22 12:37:53 pbergin: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14892 Aug 22 12:40:53 RP: thanks! Aug 22 14:07:22 how is the go toolchain actually supposed to be used with bitbake? Aug 22 14:36:37 RP: by adding "nativesdk-binutils nativesdk-gcc nativesdk-glibc-dev nativesdk-libgcc-dev" to TOOLCHAIN_HOST_TASK my simple rust example with host compilation of build.rs works. is that a suitable way forward to ass those to packagegroup-rust-cross-canadian? or do you want to wait for another fix in the issue you linked? Aug 22 14:36:58 *add Aug 22 14:44:55 pbergin: I guess that is reasonable but those are heavy dependencies to add :/ Aug 22 14:45:14 pbergin: the issue I linked to is still relevant and will also still need fixing Aug 22 14:47:00 RP: do you want me to send a patch or keep it as a local workaround? I will still send a patch with addition to test case. Aug 22 14:58:24 pbergin: please send so we can discuss, I'd like to see what others think. You won't be the only one to run into this Aug 22 14:58:34 vmeson: ^^^ Aug 22 16:20:19 I'm adding `nativesdk-go` to TOOLCHAIN_HOST_TASK, yet I don't end up with an aarch64-poky-linux-go in the SDK. I do end up with a binary called `go`, but that seems to be meant to design stuff for the host rather than for the target, it has GOROOT set to the x86_64-pokysdk-linux sysroot Aug 22 16:20:44 what package would you usually add to include aarch64-poky-linux-gcc in the sdk? Is there a similar package to include aarch64-poky-linux-go? Aug 22 17:03:46 I've read the history, shame that pbergin has left. I've logged the discussion in the associated bug. Aug 22 22:25:21 why it is not recommended to pre-generate /etc/ssh/keys at the image build time ? I have slow CPU and my first ssh connection takes about 1 min **** ENDING LOGGING AT Tue Aug 23 02:59:56 2022