Skip to content

Error building apps for ARM64 using Clang #1873

Description

@CristianAndrei1423

Describe the bug

Building nginx, sqlite and redis for ARM64 with Clang 18 results in an error.
This bug has been documented in Issue#1494 and fixed in this PR but later in an update the fp_arm64.c file was deleted and some functionality relocated to plat/native/arch/arm64/ectx.c , with the following regression in the plat/native/Makefile.c:25 :

LIBUKPLAT_NATIVE_SRCS-$(CONFIG_LIBUKPLAT_NATIVE_ECTX)   += $(LIBUKPLAT_NATIVE_BASE)/arch/arm64/ectx.c|isr

The fix mirrors the old PR in that the suffix |isr is to be removed. This fix has been manually tested for all the above mentioned apps and shown to work.

Steps to reproduce

Make sure you have clang installed on your system and available in the system path. Then follow the steps below:

  1. Clone the catalog-core repository and run the setup.sh script:
cd catalog-core/
./setup.sh
  1. Cd into one of the apps (nginx) and run the setup script there:
cd nginx/
./setup.sh
  1. Run the build for arm64 with Clang (make sure your clang version is 18 with clang --version)
./.scripts/build/qemu.arm64

This will output the exact error featured below in the section Relevant log output.

The fix mentioned should be done in the nginx/workdir/unikraft/plat/native/arch/arm64/ectx.c file.

Expected behavior

Should build without any errors.

Which architectures were you using or does this bug affect?

x86_64

Which platforms were you using or does this bug affect?

kvm

Relevant log output

/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:36:3: error: expected readable system register
   36 |                 "mrs    %0, fpcr\n"
      |                 ^
<inline asm>:1:10: note: instantiated into assembly here
    1 |         mrs     x8, fpcr
      |                     ^
/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:37:4: error: expected readable system register
   37 |                 "mrs    %1, fpsr\n"
      |                  ^
<inline asm>:2:9: note: instantiated into assembly here
    2 | mrs     x9, fpsr
      |             ^
/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:38:4: error: instruction requires: fp-armv8
   38 |                 "stp    q0,  q1,  [%2, #16 *  0]\n"
      |                  ^
<inline asm>:3:1: note: instantiated into assembly here
    3 | stp     q0,  q1,  [x0, #16 *  0]
      | ^
/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:39:4: error: instruction requires: fp-armv8
   39 |                 "stp    q2,  q3,  [%2, #16 *  2]\6 warnings generated.
n"
      |                  ^
<inline asm>:4:1: note: instantiated into assembly here
    4 | stp     q2,  q3,  [x0, #16 *  2]
      | ^
/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:40:4: error: instruction requires: fp-armv8
   40 |                 "stp    q4,  q5,  [%2, #16 *  4]\n"
      |                  ^
<inline asm>:5:1: note: instantiated into assembly here
    5 | stp     q4,  q5,  [x0, #16 *  4]
      | ^
/home/unikraft/andreic/catalog-core/repos/unikraft/plat/native/arch/arm64/ectx.c:41:4: error: instruction requires: fp-armv8
   41 |                 "stp    q6,  q7,  [%2, #16 *  6]\n"
      |                  ^
<inline asm>:6:1: note: instantiated into assembly here
    6 | stp     q6,  q7,  [x0, #16 *  6]
      | ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions