ARM-software / bsa-acs

Arm SystemReady : BSA Architecture Compliance Suite
Apache License 2.0
17 stars 42 forks source link

Unable to build functional bare metal libraries #191

Closed robbiek-xsl closed 10 months ago

robbiek-xsl commented 1 year ago

Attempting to follow the instructions to build the bare metal libraries here:

bsa-acs/platform/pal_baremetal/README.md

While the build seems to complete, the .o files associated with following secondary make files are invalid:

Build steps:

$ rm -rf build/
$ pwd
/projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs
$ export GCC49_AARCH64_PREFIX=aarch64-linux-gnu-
$ export BSA_PATH=`pwd`
$ make
/projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/baremetal_app//BsaAcsMain.c
rm -rf /projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/build/obj
rm -rf /projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/build/lib
...

Some (but not all) generated .o files are invalid:

$ aarch64-linux-gnu-objdump -a build/obj/acs_dma.o 

build/obj/acs_dma.o:     file format elf64-littleaarch64
build/obj/acs_dma.o

$ aarch64-linux-gnu-objdump -a build/obj/pal_dma.o 
aarch64-linux-gnu-objdump: build/obj/pal_dma.o: file format not recognized
$ aarch64-linux-gnu-objdump -a build/obj/test_os_p061.o 
aarch64-linux-gnu-objdump: build/obj/test_os_p061.o: file format not recognized
$ 

Looking at the build log for the invalid .o files, the command line used to compile them looks very wrong:

aarch64-linux-gnu-gcc -march=armv8.2-a -DTARGET_EMULATION  -c -o /projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/build/obj/pal_dma.o /projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/platform/pal_baremetal/FVP/RDN2/include/platform_override_fvp.h >> /projects/auto-vp/rk-u3/uefi/edk2/ShellPkg/Application/bsa-acs/build//compile.log 2>&1

The source files for the invalid .o files appears to be a "platform_override_fvp.h". I see this compile command for many files, they all do not specify a correct source file.

Build log is attached. build_log.txt

The issue seems to be caused by the following rule, which I've been unable to figure out the purpose of the compile command associated with the rule:

$(OBJ_DIR)/%.o: $(DEPS)
    $(CC)  -c -o $@ $< >> $(OUT_DIR)/compile.log 2>&1

Thanks, Robbie

gowthamsiddarthd commented 1 year ago

Hi @robbiek-xsl,

Thank you for bringing this matter to our attention. Our ACS team is actively addressing the issue and is committed to providing timely updates on the progress. Your patience is greatly appreciated.

Regards, The ACS team

gowthamsiddarthd commented 10 months ago

Hi @robbiek-xsl,

The issue is now resolved and changes are part of the PR: https://github.com/ARM-software/bsa-acs/pull/227 For more information on the build steps, please refer: https://github.com/ARM-software/bsa-acs/blob/main/platform/pal_baremetal/README.md

Regards, The ACS Team