Hi All, I try to build Hafnium v2.8 on Armv8-A device, but I got some compile errors. Here are my building scripts:
``` cd hafnium PATH=$PWD/prebuilts/linux-x64/clang/bin:$PWD/prebuilts/linux-x64/dtc:$PATH make PROJECT=reference ```
Here are some compile errors (The remainings are similar.)
``` [66/3042] CC aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o FAILED: aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o clang -MMD -MF aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -I../../test/inc -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../test/arch/dlog_test.c -o aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o In file included from ../../test/arch/dlog_test.c:9: ../../inc/hf/dlog.h:11:10: fatal error: 'stdarg.h' file not found #include <stdarg.h> ^~~~~~~~~~ 1 error generated.
[67/3042] CC aem_v8a_fvp_clang/obj/src/vm.vm.o FAILED: aem_v8a_fvp_clang/obj/src/vm.vm.o clang -MMD -MF aem_v8a_fvp_clang/obj/src/vm.vm.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../src/vm.c -o aem_v8a_fvp_clang/obj/src/vm.vm.o In file included from ../../src/vm.c:9: ../../inc/hf/vm.h:11:10: fatal error: 'stdatomic.h' file not found #include <stdatomic.h> ^~~~~~~~~~~~~ 1 error generated.
```
Can someone help me?
Sincerely, WANG Chenxu
Hi,
I try to build Hafnium v2.8 on Armv8-A device, but I got some compile errors.
It seems you are trying to build Hafnium on a Linux aarch64 host. Would you be able to confirm?
If that is the case, from the build script you sent, it seems you are using the toolchain that is part of hafnium/prebuilts. The toolchain is for an x86 linux host.
For Linux aarch64 hosts, you should install the respective toolchain for your host OS. And add it to your system PATH.
Could you please try the following steps?
- Download torball that relates to your host OS, from https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.6 (Linux aarch64 look for: clang+llvm-15.0.6-aarch64-linux-gnu) - Extract the toolchain into your local workspace. - Add it to your path. (export PATH=”<your local toolchain directory>/ clang+llvm-15.0.6-aarch64-linux-gnu/bin:$PATH”) - Build hafnium: cd <your local hafnium directory> && make PROJECT=reference
Let me know if you are still facing any issues with this.
Best regards, João Alves
From: Chenxu Wang via Hafnium hafnium@lists.trustedfirmware.org Date: Monday, 11 September 2023 at 13:15 To: Chenxu Wang via Hafnium hafnium@lists.trustedfirmware.org Subject: [Hafnium] Compile errors when building Hafnium on Arm devices Hi All, I try to build Hafnium v2.8 on Armv8-A device, but I got some compile errors. Here are my building scripts:
``` cd hafnium PATH=$PWD/prebuilts/linux-x64/clang/bin:$PWD/prebuilts/linux-x64/dtc:$PATH make PROJECT=reference ```
Here are some compile errors (The remainings are similar.)
``` [66/3042] CC aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o FAILED: aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o clang -MMD -MF aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -I../../test/inc -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../test/arch/dlog_test.c -o aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o In file included from ../../test/arch/dlog_test.c:9: ../../inc/hf/dlog.h:11:10: fatal error: 'stdarg.h' file not found #include <stdarg.h> ^~~~~~~~~~ 1 error generated.
[67/3042] CC aem_v8a_fvp_clang/obj/src/vm.vm.o FAILED: aem_v8a_fvp_clang/obj/src/vm.vm.o clang -MMD -MF aem_v8a_fvp_clang/obj/src/vm.vm.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../src/vm.c -o aem_v8a_fvp_clang/obj/src/vm.vm.o In file included from ../../src/vm.c:9: ../../inc/hf/vm.h:11:10: fatal error: 'stdatomic.h' file not found #include <stdatomic.h> ^~~~~~~~~~~~~ 1 error generated.
```
Can someone help me?
Sincerely, WANG Chenxu -- Hafnium mailing list -- hafnium@lists.trustedfirmware.org To unsubscribe send an email to hafnium-leave@lists.trustedfirmware.org
Sorry but I fix this problem. I find that I use an incorrect clang (it should be 12.0.0). After I change the clang+llvm it works.
Chenxu Wang irakatz51@gmail.com 于2023年9月11日周一 20:14写道:
Hi All, I try to build Hafnium v2.8 on Armv8-A device, but I got some compile errors. Here are my building scripts:
cd hafnium PATH=$PWD/prebuilts/linux-x64/clang/bin:$PWD/prebuilts/linux-x64/dtc:$PATH make PROJECT=reference
Here are some compile errors (The remainings are similar.)
[66/3042] CC aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o FAILED: aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o clang -MMD -MF aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -I../../test/inc -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../test/arch/dlog_test.c -o aem_v8a_fvp_clang/obj/test/arch/arch_test.elf.dlog_test.o In file included from ../../test/arch/dlog_test.c:9: ../../inc/hf/dlog.h:11:10: fatal error: 'stdarg.h' file not found #include <stdarg.h> ^~~~~~~~~~ 1 error generated. [67/3042] CC aem_v8a_fvp_clang/obj/src/vm.vm.o FAILED: aem_v8a_fvp_clang/obj/src/vm.vm.o clang -MMD -MF aem_v8a_fvp_clang/obj/src/vm.vm.o.d -DVM_TOOLCHAIN=0 -DGIC_VERSION=3 -DGICD_BASE=0x2f000000 -DGICR_BASE=0x2f100000 -DGICR_FRAMES=8 -DHEAP_PAGES=180 -DMAX_CPUS=8 -DMAX_VMS=16 -DLOG_LEVEL=LOG_LEVEL_INFO -DENABLE_ASSERTIONS=1 -DPARTITION_MAX_MEMORY_REGIONS=8 -DPARTITION_MAX_DEVICE_REGIONS=8 -DPARTITION_MAX_INTERRUPTS_PER_DEVICE=4 -DPARTITION_MAX_STREAMS_PER_DEVICE=4 -DHF_NUM_INTIDS=64 -DSECURE_WORLD=0 -DENABLE_VHE=0 -I../../inc -I../../inc/vmapi -I../../src/arch/aarch64/inc -Iaem_v8a_fvp_clang/gen/offset_size_header -ffunction-sections -fdata-sections -flto -fno-builtin -ffreestanding -fpic -mcpu=cortex-a57+nofp -mstrict-align -mgeneral-regs-only -target aarch64-none-eabi -fcolor-diagnostics -nostdinc -isystem /include -isystem hafnium/inc/system -g -Wall -O2 -Wpedantic -Werror -fstack-protector-all -std=c11 -c ../../src/vm.c -o aem_v8a_fvp_clang/obj/src/vm.vm.o In file included from ../../src/vm.c:9: ../../inc/hf/vm.h:11:10: fatal error: 'stdatomic.h' file not found #include <stdatomic.h> ^~~~~~~~~~~~~ 1 error generated.
Can someone help me?
Sincerely, WANG Chenxu
hafnium@lists.trustedfirmware.org