On Wed, 2022-06-22 at 11:54 +0530, Sundeep KOKKONDA wrote:
> Hi,
>  
> 
> 
> 
>  In Yocto, the Rust upgrade from 1.60.0 -> 1.61.0 enables a dependency on the 
> libstdc++-static library for rust-llvm. With this upgrade build is aborted 
> for 'bitbake core-image-minimal -cpopulate_sdk' with below error.
>  
> 
> 
> 
>  ======= Error Text =======
>  | error: could not compile `rustc_llvm` due to previous error
>  | 
>  | Caused by:
>  |   process didn't exit successfully: 
> `/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/bootstrap/debug/rustc
>  --crate-name rustc_llvm --edition=2021 compiler/rustc_llvm/src/lib.rs 
> --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat 
> --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C 
> embed-bitcode=no -C debuginfo=0 -C metadata=5acc17ffb3ce44a9 -C 
> extra-filename=-5acc17ffb3ce44a9 --out-dir 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps
>  --target x86_64-unknown-linux-gnu -C 
> linker=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/wrapper/build-rust-ccld
>  -L 
> dependency=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps
>  -L 
> dependency=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps
>  --extern 
> libc=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-be8f25d7c5c0a059.rmeta
>  --cfg=bootstrap -Csymbol-mangling-version=v0 -Zmacro-backtrace 
> -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' 
> -Ztls-model=initial-exec -Zunstable-options '-Wrustc::internal' 
> -Cprefer-dynamic -Z binary-dep-depinfo -L 
> native=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-688051e8c720f5a9/out
>  -L 
> native=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/recipe-sysroot-native/usr/lib/llvm-rust/lib
>  -L 
> native=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-llvm-native/1.61.0-r0/recipe-sysroot-native/usr/lib
>  -L 
> native=/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-llvm-native/1.61.0-r0/recipe-sysroot-native/lib
>  -L native= --cfg 'llvm_component="aarch64"' --cfg 'llvm_component="arm"' 
> --cfg 'llvm_component="asmparser"' --cfg 'llvm_component="bitreader"' --cfg 
> 'llvm_component="bitwriter"' --cfg 'llvm_component="coverage"' --cfg 
> 'llvm_component="instrumentation"' --cfg 'llvm_component="ipo"' --cfg 
> 'llvm_component="linker"' --cfg 'llvm_component="lto"' --cfg 
> 'llvm_component="mips"' --cfg 'llvm_component="powerpc"' --cfg 
> 'llvm_component="riscv"' --cfg 'llvm_component="x86"' -l static=llvm-wrapper 
> -l static=LLVMX86TargetMCA -l static=LLVMMCA -l static=LLVMX86Disassembler -l 
> static=LLVMX86AsmParser -l static=LLVMX86CodeGen -l static=LLVMX86Desc -l 
> static=LLVMX86Info -l static=LLVMRISCVDisassembler -l 
> static=LLVMRISCVAsmParser -l static=LLVMRISCVCodeGen -l static=LLVMRISCVDesc 
> -l static=LLVMRISCVInfo -l static=LLVMPowerPCDisassembler -l 
> static=LLVMPowerPCAsmParser -l static=LLVMPowerPCCodeGen -l 
> static=LLVMPowerPCDesc -l static=LLVMPowerPCInfo -l 
> static=LLVMMipsDisassembler -l static=LLVMMipsAsmParser -l 
> static=LLVMMipsCodeGen -l static=LLVMMipsDesc -l static=LLVMMipsInfo -l 
> static=LLVMLTO -l static=LLVMPasses -l static=LLVMCoroutines -l 
> static=LLVMObjCARCOpts -l static=LLVMExtensions -l static=LLVMCoverage -l 
> static=LLVMARMDisassembler -l static=LLVMARMAsmParser -l 
> static=LLVMARMCodeGen -l static=LLVMipo -l static=LLVMInstrumentation -l 
> static=LLVMVectorize -l static=LLVMLinker -l static=LLVMIRReader -l 
> static=LLVMAsmParser -l static=LLVMFrontendOpenMP -l static=LLVMARMDesc -l 
> static=LLVMARMUtils -l static=LLVMARMInfo -l static=LLVMAArch64Disassembler 
> -l static=LLVMMCDisassembler -l static=LLVMAArch64AsmParser -l 
> static=LLVMAArch64CodeGen -l static=LLVMCFGuard -l static=LLVMGlobalISel -l 
> static=LLVMSelectionDAG -l static=LLVMAsmPrinter -l static=LLVMDebugInfoMSF 
> -l static=LLVMCodeGen -l static=LLVMTarget -l static=LLVMScalarOpts -l 
> static=LLVMInstCombine -l static=LLVMAggressiveInstCombine -l 
> static=LLVMTransformUtils -l static=LLVMBitWriter -l static=LLVMAnalysis -l 
> static=LLVMProfileData -l static=LLVMDebugInfoDWARF -l static=LLVMObject -l 
> static=LLVMTextAPI -l static=LLVMMCParser -l static=LLVMBitReader -l 
> static=LLVMCore -l static=LLVMRemarks -l static=LLVMBitstreamReader -l 
> static=LLVMAArch64Desc -l static=LLVMAArch64Utils -l static=LLVMAArch64Info 
> -l static=LLVMMC -l static=LLVMDebugInfoCodeView -l static=LLVMBinaryFormat 
> -l static=LLVMSupport -l static=LLVMDemangle -l dylib=rt -l dylib=dl -l 
> dylib=pthread -l dylib=m -l static=stdc++` (exit status: 1)
>  | warning: build failed, waiting for other jobs to finish...
>  |     Building [====================>    ] 186/218: rustc_ast_passes, 
> rustc_e...
>  |     Building [====================>    ] 187/218: rustc_expand, 
> rustc_parse...
>  |     Building [====================>    ] 188/218: rustc_expand, 
> rustc_parse...
>  |     Building [====================>    ] 189/218: rustc_parse, 
> rustc_builti...
>  |     Building [====================>    ] 190/218: rustc_parse, rustc_middle
>  |     Building [====================>    ] 191/218: rustc_middle
>  | error: build failed
>  | command did not execute successfully: 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rust-snapshot/bin/cargo"
>  "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" 
> "16" "-v" "--release" "--frozen" "--features" "llvm max_level_info" 
> "--manifest-path" 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/compiler/rustc/Cargo.toml"
>  "--message-format" "json-render-diagnostics"
>  | expected success, got: exit status: 101
>  | Traceback (most recent call last):
>  |   File 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/src/bootstrap/bootstrap.py",
>  line 1341, in <module>
>  |     main()
>  |   File 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/src/bootstrap/bootstrap.py",
>  line 1324, in main
>  |     bootstrap(help_triggered)
>  |   File 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/src/bootstrap/bootstrap.py",
>  line 1310, in bootstrap
>  |     run(args, env=env, verbose=build.verbose, is_bootstrap=True)
>  |   File 
> "/home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/src/bootstrap/bootstrap.py",
>  line 185, in run
>  |     raise RuntimeError(err)
>  | RuntimeError: failed to run: 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/rustc-1.61.0-src/build/bootstrap/debug/bootstrap
>  -j 16 build --stage 2 --verbose
>  | WARNING: 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/temp/run.do_compile.175104:179
>  exit 1 from 'python3 src/bootstrap/bootstrap.py -j 16 "$@" --verbose'
>  | WARNING: Backtrace (BB generated script):
>  |     #1: rust_runx, 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/temp/run.do_compile.175104,
>  line 179
>  |     #2: do_compile, 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/temp/run.do_compile.175104,
>  line 162
>  |     #3: main, 
> /home/pokybuild/yocto-worker/qemumips-alt/build/build/tmp/work/x86_64-linux/rust-native/1.61.0-r0/temp/run.do_compile.175104,
>  line 202
>  NOTE: recipe rust-native-1.61.0-r0: task do_compile: Failed
>  ==========================================
>  
> 
> 
> 
>  The build error is solved by adding the libstdc++.a library on the
> Host (in my case Ubuntu) machine. Now, I am working on to add this
> library to the Yocto nativesdk sysroot to avoid the dependency on the
> Host machine. I made several attempts to add the libstdc++ lib to the
> nativesdk sysroot before the rust / rust-llvm recipe 'do_compile'
> task is executed. In the build directory I can see the libstdc++.a is
> available but it is not considered by the rust recipe and still the
> above mentoned error is appearing. When I added dependencies, I
> observed  errors like 'nothing provides libstdc++ / libstdc++-static
> / libstdc++-staticdev / virtual/nativesdk-libstdc++-staticdev ...
> etc'.
>  


Reading the discussion I think things got a little off track. Note that
this error is in rust-native so it will be using libstdc++ from the
host system.

This fills me with a lot of worry since if it does that, it will likely
struggle with uninative as once uninative swaps out the libc for the
uninative one, that will not match the static one. Depending on what
rust is doing, it may be fine but we need to check that.

I suspect we don't require a static libstdc++ on the host either in
that we don't check for it's presence in sanity.bbclass or list it in
our quick start docs in the lists of packages to install. That may or
may not therefore also be an issue.

Not sure what the solution is but it is concerning.

Cheers,

Richard




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167235): 
https://lists.openembedded.org/g/openembedded-core/message/167235
Mute This Topic: https://lists.openembedded.org/mt/91480159/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to