0007-gcc.specs-drop-Werror.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 8d5cf3347cce9d644f670ffd1d48e71d74635481 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 22 Mar 2021 07:52:34 +0100
  4. Subject: [PATCH] gcc.specs: drop -Werror
  5. Build with -Werror raises the following build failure with gcc 10:
  6. /home/buildroot/autobuild/run/instance-1/output-1/host/bin/aarch64-none-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -I/home/buildroot/autobuild/run/instance-1/output-1/build/efivar-37/src/include/ -specs=/home/buildroot/autobuild/run/instance-1/output-1/build/efivar-37/gcc.specs -L. -fPIC -Wl,-z,muldefs -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o efivar efivar.c -lefivar -ldl
  7. In file included from efivar.h:28,
  8. from efivar.c:40:
  9. In function 'text_to_guid',
  10. inlined from 'parse_name.constprop' at efivar.c:157:8:
  11. guid.h:106:2: error: 'strncpy' output may be truncated copying 8 bytes from a string of length 38 [-Werror=stringop-truncation]
  12. 106 | strncpy(eightbytes, text, 8);
  13. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. cc1: all warnings being treated as errors
  15. Fixes:
  16. - http://autobuild.buildroot.org/results/fcba72d359f4128515560e9105384cd4deff5043
  17. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  18. [Upstream status: not upstreamable as Makefiles were reworked and a new
  19. ERRORS parameter was added:
  20. https://github.com/rhboot/efivar/commit/998f617cec92d526e1fadb745673ceef63fa1483]
  21. ---
  22. gcc.specs | 2 +-
  23. 1 file changed, 1 insertion(+), 1 deletion(-)
  24. diff --git a/gcc.specs b/gcc.specs
  25. index 45d43d1..1baf11a 100644
  26. --- a/gcc.specs
  27. +++ b/gcc.specs
  28. @@ -2,7 +2,7 @@
  29. + -D_GNU_SOURCE
  30. *efivar_cpp_options:
  31. - -Werror -Wall -std=gnu11 -Wextra
  32. + -Wall -std=gnu11 -Wextra
  33. *cpp_options:
  34. + %(efivar_cpp_options)
  35. --
  36. 2.30.1