Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

target-efi: Error when compiling on Debian 9.9 #4

Open
alexandru-elisei opened this issue Oct 30, 2020 · 4 comments
Open

target-efi: Error when compiling on Debian 9.9 #4

alexandru-elisei opened this issue Oct 30, 2020 · 4 comments

Comments

@alexandru-elisei
Copy link

When I try to compile kvm-unit-tests configure with --target-efi I get the following error:

gcc -mstrict-align -std=gnu99 -ffreestanding -O2 -I /home/alex/kvm-unit-tests/lib -I /home/alex/kvm-unit-tests/lib/libfdt -I lib -g -MMD -MF lib/.efi.d -fno-strict-aliasing -fno-common -Wall -Wwrite-strings -Wempty-body -Wuninitialized -Wignored-qualifiers -Werror -fomit-frame-pointer -fno-stack-protector -Wno-frame-address -Wclobbered -Wunused-but-set-parameter -DTARGET_EFI -DEFI_DEBUG -I /usr/include/efi -I /usr/include/efi/aarch64 -fpic -fshort-wchar -fno-stack-check -fno-merge-all-constants -Wno-error=missing-prototypes -Wno-error=strict-prototypes -Wno-error=pragmas -Wmissing-parameter-type -Wold-style-declaration -Woverride-init -Wmissing-prototypes -Wstrict-prototypes -c -o lib/efi.o lib/efi.c
In file included from /usr/include/efi/efi.h:52:0,
from lib/efi.c:14:
/usr/include/efi/efiapi.h:734:5: warning: function declaration isn't a prototype [-Wstrict-prototypes]
);
^
lib/efi.c: In function 'efi_char16_to_char':
lib/efi.c:44:25: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT((CHAR16)t == *w);
^
In file included from /usr/include/efi/efilib.h:22:0,
from lib/efi.c:15:
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:44:25: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT((CHAR16)t == *w);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:44:3: note: in expansion of macro 'ASSERT'
ASSERT((CHAR16)t == *w);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c: In function 'efi_generate_path':
lib/efi.c:116:18: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(*PathName);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:116:18: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(*PathName);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:116:2: note: in expansion of macro 'ASSERT'
ASSERT(*PathName);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c: In function 'efi_load_image':
lib/efi.c:140:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:140:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:140:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:143:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:143:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:143:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:150:31: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:150:31: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:150:3: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:155:17: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(FileInfo);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:155:17: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(FileInfo);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:155:2: note: in expansion of macro 'ASSERT'
ASSERT(FileInfo);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:163:18: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(FileInfo);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:163:18: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(FileInfo);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:163:3: note: in expansion of macro 'ASSERT'
ASSERT(FileInfo);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:169:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:169:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:169:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:176:14: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(*data);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:176:14: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(*data);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:176:2: note: in expansion of macro 'ASSERT'
ASSERT(*data);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:187:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:187:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:187:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c: In function 'efi_get_fdt':
lib/efi.c:215:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:215:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:215:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c: In function 'efi_set_mem_regions':
lib/efi.c:258:31: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(DescriptorVersion == 1);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:258:31: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(DescriptorVersion == 1);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:258:2: note: in expansion of macro 'ASSERT'
ASSERT(DescriptorVersion == 1);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:304:22: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(freemem_start);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:304:22: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(freemem_start);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:304:2: note: in expansion of macro 'ASSERT'
ASSERT(freemem_start);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c: In function 'efi_main':
lib/efi.c:328:30: error: pointer targets in passing argument 1 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
lib/efi.c:328:30: error: pointer targets in passing argument 3 of 'DbgAssert' differ in signedness [-Werror=pointer-sign]
ASSERT(Status == EFI_SUCCESS);
^
/usr/include/efi/efidebug.h:26:64: note: in definition of macro 'DBGASSERT'
#define DBGASSERT(a) DbgAssert(FILE, LINE, #a)
^
lib/efi.c:328:2: note: in expansion of macro 'ASSERT'
ASSERT(Status == EFI_SUCCESS);
^~~~~~
/usr/include/efi/efidebug.h:96:1: note: expected 'const CHAR8 * {aka const unsigned char *}' but argument is of type 'const char *'
DbgAssert (
^~~~~~~~~
cc1: all warnings being treated as errors
: recipe for target 'lib/efi.o' failed
make: *** [lib/efi.o] Error 1

Same configuration as in Issue #3; the change EFI_ARCH=aarch64 applied to /Makefile.

@rhdrjones
Copy link
Owner

Hi Alex,

Thanks for trying this out and sorry it's not compiling in your environment. I've so far only built in a Fedora 32 cross-compile environment (a.k.a my laptop). I'll take a closer look at this soon and I hope we can get you running.

drew

@alexandru-elisei
Copy link
Author

Hi Drew,

Thanks, I'm really curious to play with kvm-unit-tests on baremetal. It's going to be great to be able to validate that KVM emulation matches the hardware. Or just be able to test some behavior which would otherwise be very hard to trigger with Linux.

@rhdrjones
Copy link
Owner

This probably won't help, since it's still Fedora vs. Debian, but to rule out my own notebook being magical, I freshly provisioned an x86 machine with a minimal install of Fedora 33 and then additionally installed the following four packages:

git
make
gcc-aarch64-linux-gnu
gnu-efi-devel

With that, I was able to clone and build --efi-target

To run the EFI tests under AAVMF, I additionally installed

qemu-system-aarch64
edk2-aarch64

Then executed the following command to prepare the DTB

qemu-system-aarch64 -nodefaults -display none -serial stdio -machine virt,accel=tcg -cpu max -machine dumpdtb=arm/dtb

And finally executed the following command to boot AAVMF in order to run the tests

qemu-system-aarch64 -nodefaults -display none -serial stdio -machine virt,accel=tcg -cpu max -bios /usr/share/AAVMF/AAVMF_CODE.fd -drive format=raw,file=fat:rw:arm

(Notice how the arm directory of kvm-unit-tests is getting passed through to AAVMF as a fatfs)

Note:
The Fedora AAVMF is super verbose. The CentOS edk2-aarch64 package[*] offers a silent version (/usr/share/edk2/aarch64/QEMU_EFI.silent.fd) which makes it much easier to see the test output.

[*] http://mirror.centos.org/centos/8-stream/AppStream/aarch64/os/Packages/edk2-aarch64-20200602gitca407c7246bf-3.el8.noarch.rpm

@alexandru-elisei
Copy link
Author

Hi Drew,

Got it to work in a VM, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants