Skip to content

Linuxboot - Won't build on Ubuntu 20.04 #978

@Frogging101

Description

@Frogging101

I'm running Kubuntu 20.04. I cloned heads and ran make BOARD=qemu-linuxboot. linuxboot-git fails to compile edk2 because of -Werror=stringop-truncation. My build host has gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04). This is a clean build on a common system; I'm surprised it's failing so easily.

Here is build/log/linuxboot.configure.log:

echo >&2 Pre-building edk2 ; make -C /home/john/gits/heads/build/linuxboot-git BOARD=qemu edk2.force || exit 1 ; if [ qemu = qemu ]; then echo >&2 Pre-building edk2 OVMF ; ( cd /home/john/gits/heads/build/linuxboot-git/edk2/OvmfPkg ; ./build.sh -n 8 ) || exit 1 ; fi ; touch .config ; 
Pre-building edk2
make[1]: Entering directory '/home/john/gits/heads/build/linuxboot-git'
make -C edk2 build
make[2]: Entering directory '/home/john/gits/heads/build/linuxboot-git/edk2'
make -C BaseTools
make[3]: Entering directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools'
make -C Source/C
make[4]: Entering directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools/Source/C'
Attempting to detect HOST_ARCH from 'uname -m': x86_64
Detected HOST_ARCH of X64 using uname.
mkdir -p .
make -C Common
make[5]: Entering directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools/Source/C/Common'
gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -O2 EfiUtilityMsgs.c -o EfiUtilityMsgs.o
In file included from /usr/include/string.h:495,
                 from EfiUtilityMsgs.c:16:
In function ‘strncat’,
    inlined from ‘PrintMessage’ at EfiUtilityMsgs.c:484:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin___strncat_chk’ output may be truncated copying between 0 and 511 bytes from a string of length 511 [-Werror=stringop-truncation]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncat’,
    inlined from ‘PrintMessage’ at EfiUtilityMsgs.c:469:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin___strncat_chk’ output may be truncated copying between 0 and 511 bytes from a string of length 511 [-Werror=stringop-truncation]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncat’,
    inlined from ‘PrintMessage’ at EfiUtilityMsgs.c:511:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin___strncat_chk’ output may be truncated copying between 0 and 511 bytes from a string of length 511 [-Werror=stringop-truncation]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [../Makefiles/footer.makefile:27: EfiUtilityMsgs.o] Error 1
make[5]: Leaving directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools/Source/C/Common'
make[4]: *** [GNUmakefile:85: Common] Error 2
make[4]: Leaving directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools/Source/C'
make[3]: *** [GNUmakefile:25: Source/C] Error 2
make[3]: Leaving directory '/home/john/gits/heads/build/linuxboot-git/edk2/BaseTools'
make[2]: *** [Makefile:39: .configured] Error 2
make[2]: Leaving directory '/home/john/gits/heads/build/linuxboot-git/edk2'
make[1]: *** [Makefile:61: edk2.force] Error 2
make[1]: Leaving directory '/home/john/gits/heads/build/linuxboot-git'

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