Missing file /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h

Bug #2026829 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cross-toolchain-base-ports (Ubuntu)
New
Undecided
Unassigned

Bug Description

When trying to build EDK II with -mabi=lp64 on riscv64 we are hitting missing include /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The RISC-V architecture uses different privilege levels (M-mode, S-mode, U-mode). Depending on the mode different extensions of the instruction set are available. See the RISC-V profile specification in https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc.

As in S-mode no floating point extensions are available floats and doubles have to be passed in integer registers. This is the lp64 ABI. Currently we lack a toolchain for softfloat (__riscv_float_abi_soft) RISC-V binaries.

Revision history for this message
Akeo (pbatard) wrote :

Please bear in mind that simply symlinking/copying /usr/riscv64-linux-gnu/include/gnu/stubs-lp64d.h as /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h does solve the compilation issues.

Right now, and for the past couple of years, people compiling EDK2 projects for RISC-V on Ubuntu (which includes anybody using GitHub Actions) will face an error unless they manually duplicate/symlink stubs-lp64d.h as stubs-lp64.h (See for instance the extra step needed in https://github.com/pbatard/EfiFs/blob/d77c3ab5f4ad990d5a685f9f11c6d5fac54b5ed1/.github/workflows/linux_gcc_edk2.yml#L64-L66), so I believe that the header should be added to the package installation regardless, especially as all it seems to do is provide empty stub definitions...

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

EDK II and SCT for riscv64 build just fine without creating a stubs-lp64.h symlink.

See https://github.com/xypron/sct_release_test/blob/main/build_sct_riscv64/Dockerfile

Best regards

Heinrich

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.