Skip to content

qemu-linuxboot: x86_64-linux-musl-gcc cannot find Linux headers when building #939

@synackd

Description

@synackd

When attempting to build the qemu-linuxboot target on an Ubuntu 18.04 docker container, the following error occurs:

$ make BOARD=qemu-linuxboot
[...]
FV Space Information
SECFV [10%Full] 212992 total, 21616 used, 191376 free
FVMAIN_COMPACT [4%Full] 7634944 total, 354192 used, 7280752 free
DXEFV [10%Full] 10485760 total, 1069000 used, 9416760 free
PEIFV [20%Full] 917504 total, 185768 used, 731736 free

- Done -
Build end time: 23:50:12, Dec.23 2020
Build total time: 00:00:19

cp edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd boards/qemu/qemu.rom
( \
cd build/qemu ; \
/home/docker/workspace/heads/build/linuxboot-git/bin/extract-firmware \
        -o rom \
) < boards/qemu/qemu.rom \
> build/qemu/qemu.txt.tmp
mv build/qemu/qemu.txt.tmp build/qemu/qemu.txt
./bin/create-fv \
        -v \
        -o build/qemu/user.vol \
        --size 0x048000 \
        --compress 0 \
        FORCE
Can't open FORCE: No such file or directory at ./bin/create-fv line 64.
build/qemu/user.vol: 0x00000000 out of 00048000 bytes in FV
./bin/create-ffs -o build/qemu/DxeCore.ffs --name DxeCore --version 1.0 --type DXE_CORE --depex "" --guid "D6A2CB7F-6A18-4E2F-B43B-9920A733700A" edk2/Build/MdeModule/DEBUG_GCC5/X64/DxeCore.efi
/home/docker/workspace/heads/build/make-4.2.1/make -C dxe linuxboot.ffs
make[3]: Entering directory '/home/docker/workspace/heads/build/linuxboot-git/dxe'
/home/docker/workspace/heads/crossgcc/bin/x86_64-linux-musl-gcc -std=c99 -D__efi__ -DGNU_EFI_USE_MS_ABI -fshort-wchar -mno-red-zone -fno-stack-protector -m64 -fpic -O3 -W -Wall -I . -I efi/x86_64 -MMD -MF .linuxboot.o.d    -c -o linuxboot.o linuxboot.c
In file included from linuxboot.c:23:
/home/docker/workspace/heads/crossgcc/x86_64-linux-musl/include/asm/bootparam.h:35:10: fatal error: linux/types.h: No such file or directory
 #include <linux/types.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [<builtin>: linuxboot.o] Error 1
make[3]: Leaving directory '/home/docker/workspace/heads/build/linuxboot-git/dxe'
make[2]: *** [Makefile:144: dxe/linuxboot.ffs] Error 2
make[2]: Leaving directory '/home/docker/workspace/heads/build/linuxboot-git'

I assume that it is supposed to use the headers included with the downloaded/built kernel and not the ones on the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions