public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Building Library link with UEFI C code in EDK2
       [not found] <SJ0P223MB06144C95DD8AC31192EA16A880F6A@SJ0P223MB0614.NAMP223.PROD.OUTLOOK.COM>
@ 2023-09-19  6:39 ` Jared Pan
  0 siblings, 0 replies; only message in thread
From: Jared Pan @ 2023-09-19  6:39 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 14354 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-19 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <SJ0P223MB06144C95DD8AC31192EA16A880F6A@SJ0P223MB0614.NAMP223.PROD.OUTLOOK.COM>
2023-09-19  6:39 ` [edk2-devel] Building Library link with UEFI C code in EDK2 Jared Pan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox