[edk2-devel] Building Library link with UEFI C code in EDK2

Jared Pan Jared_Pan at phoenix.com
Tue Sep 19 06:39:39 UTC 2023


Hi all,

There is a test for prebuild Rust library link with UEFI C code in GCC build as below. But I will encounter some build problems.
Case 1: prebuild Rust library with aarch64-unknown-uefi target command, it will encounter "error adding symbols: file format not recognized".
Case 2: I tried another similar target aarch64-unknown-none which also supports no-std lib, it will successfully link in GCC build. However, when I use alloc::vec::Vec and alloc::string::String lib in Rust library, the build will encounters build error that WriteSections64(): AARCH64 relative relocations require identical ELF and PE/COFF section offsets. But they won't happen in Window build environment.

Does anyone have any experience about this problem?

Build Target on Arm VirtQemu Platform

  *   ArmVirtPkg/ArmVirtQemu.dsc
Prebuild library in Rust

  *   cargo build --release --target aarch64-unknown-uefi
  *   cargo build --release --target aarch64-unknown-none
EKD2 build environment in Ubuntu

  *   gcc-aarch64-linux-gnu



Thanks and regards,
Jared Pan



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108833): https://edk2.groups.io/g/devel/message/108833
Mute This Topic: https://groups.io/mt/101456575/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230919/8ba34977/attachment-0001.htm>


More information about the edk2-devel-archive mailing list