Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linuxboot - Won't build on Ubuntu 20.04 #978

Open
Frogging101 opened this issue Feb 25, 2021 · 1 comment
Open

Linuxboot - Won't build on Ubuntu 20.04 #978

Frogging101 opened this issue Feb 25, 2021 · 1 comment

Comments

@Frogging101
Copy link

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'
@tlaurion
Copy link
Collaborator

tlaurion commented Feb 25, 2021

@Frogging101 linuxboot builds are not receiving a lot a of love, mostly because all other currently maintained boards are coreboot based.

Last pertinent comment on that matter happened here: #971 (comment)
Which means, basically, that the linuxboot module git reference would need to fix the commit ID to that linked commit: linuxboot/linuxboot@f0ea0af and have some success/fail report in that opened issue. You can see other modules fixating git commit ID in other modules like this one.

Otherwise, this PR attempted to fix the build issues: #845, where I have reviewed and suggested changes that were not applied.

Best would be to propose changes that works. :) PRs always welcome.
If you come across linuxboot users in your journey, please make them comment into https://github.com/osresearch/heads/blame/31f021e5f7fc2d13c05c23c1d17a1e9b036bebf8/.circleci/config.yml#L18-L21 since @osresearch is currently the only one tagged for Leopard OCP node, Winterfell OCP node, Intel S2600wf and r630. I am not really connected with the linuxboot community.

I haven't tested any of them. And CI is not building for linuxboot since January 2020

Please report back in either on the linked PR or referred issue. I do not think its Ubuntu based error, but linked to upstream changes in the linuxboot project, which Heads is just using.

@tlaurion tlaurion changed the title Won't build on Ubuntu 20.04 Linuxboot - Won't build on Ubuntu 20.04 Mar 3, 2021
synackd added a commit to synackd/heads that referenced this issue Oct 26, 2021
Addresses build errors in Ubuntu 20.04 (linuxboot#978)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants