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

Compile error in edk2 #5

Open
gclawes opened this issue Aug 20, 2024 · 0 comments
Open

Compile error in edk2 #5

gclawes opened this issue Aug 20, 2024 · 0 comments

Comments

@gclawes
Copy link

gclawes commented Aug 20, 2024

I'm getting this compile error:

make[2]: Entering directory '/home/gclawes/repos/github.com/ipxe/shimdemo/edk2/BaseTools/Source/C/GenFfs'
cc -Wno-stringop-truncation -Wno-stringop-overflow  -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 GenFfs.c -o GenFfs.o
GenFfs.c: In function ‘GetAlignmentFromFile’:
GenFfs.c:545:5: error: pointer ‘InFileHandle’ used after ‘fclose’ [-Werror=use-after-free]
  545 |     Error(NULL, 0, 4001, "Resource", "memory cannot be allocated  of %s", InFileHandle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GenFfs.c:544:5: note: call to ‘fclose’ here
  544 |     fclose (InFileHandle);
      |     ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [../Makefiles/footer.makefile:27: GenFfs.o] Error 1
make[2]: Leaving directory '/home/gclawes/repos/github.com/ipxe/shimdemo/edk2/BaseTools/Source/C/GenFfs'
make[1]: *** [GNUmakefile:85: GenFfs] Error 2
make[1]: Leaving directory '/home/gclawes/repos/github.com/ipxe/shimdemo/edk2/BaseTools/Source/C'
make: *** [Makefile:40: edk2/BaseTools/Source/C/bin/GenFw] Error 2
rm secboot.siglist secboot.der

I'm on Ubuntu 24.04, the only modification I have made to the repo is this (to fix an issue with /bin/sh):

$ git diff
diff --git a/Makefile b/Makefile
index 9b6fe99..25769f7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+SHELL := /bin/bash
 cn_secboot     = Secure Boot CA
 cn_vendor      = Vendor CA
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

1 participant