[Bug 238654] sysutils/shim: Unbreak build with GCC 9

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jun 17 11:19:21 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238654

            Bug ID: 238654
           Summary: sysutils/shim: Unbreak build with GCC 9
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
               URL: https://github.com/rhboot/shim/issues/161
                OS: Any
            Status: New
          Keywords: needs-qa, patch
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: egypcio at FreeBSD.org
          Reporter: tobik at freebsd.org
                CC: egypcio at FreeBSD.org
            Blocks: 238330
             Flags: maintainer-feedback?(egypcio at FreeBSD.org)
          Assignee: egypcio at FreeBSD.org
 Attachment #205172 maintainer-approval?(egypcio at FreeBSD.org)
             Flags:
                CC: egypcio at FreeBSD.org

Created attachment 205172
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=205172&action=edit
shim.diff

shim fails to build with GCC 9:

gcc9 -std=gnu99 -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic
-fshort-wchar -Wall -Wsign-compare -Werror -fno-builtin -Werror=sign-compare
-ffreestanding
-I/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd12.0/9.1.0/include
"-DDEFAULT_LOADER=L\"\\\\grub.efi\"" "-DDEFAULT_LOADER_CHAR=\"\\\\grub.efi\""
-nostdinc -ICryptlib -ICryptlib/Include -I/usr/local/include/efi
-I/usr/local/include/efi/x86_64 -I/usr/local/include/efi/protocol
-I/wrkdirs/usr/ports/sysutils/shim/work/shim-0.9/include -I/usr/include
-mno-mmx -mno-sse -mno-red-zone -nostdinc -maccumulate-outgoing-args
-DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI "-DEFI_ARCH=L\"x64\""
"-DDEBUGDIR=L\"/usr/lib/debug/usr/share/shim/x64-0.9""/\""   -c -o MokManager.o
MokManager.c
MokManager.c: In function 'write_back_mok_list':
MokManager.c:1040:19: error: taking address of packed member of 'struct
<anonymous>' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
 1040 |   if (CompareGuid(&(list[i].Type), &CertType) == 0)
      |                   ^~~~~~~~~~~~~~~
MokManager.c:1062:19: error: taking address of packed member of 'struct
<anonymous>' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
 1062 |   if (CompareGuid(&(list[i].Type), &CertType) == 0) {
      |                   ^~~~~~~~~~~~~~~
MokManager.c: In function 'delete_cert':
MokManager.c:1103:19: error: taking address of packed member of 'struct
<anonymous>' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
 1103 |   if (CompareGuid(&(mok[i].Type), &CertType) != 0)
      |                   ^~~~~~~~~~~~~~
MokManager.c: In function 'delete_hash_in_list':
MokManager.c:1154:20: error: taking address of packed member of 'struct
<anonymous>' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
 1154 |   if ((CompareGuid(&(mok[i].Type), &Type) != 0) ||
      |                    ^~~~~~~~~~~~~~
MokManager.c: In function 'delete_keys':
MokManager.c:1325:19: error: taking address of packed member of 'struct
<anonymous>' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
 1325 |   if (CompareGuid(&(del_key[i].Type), &CertType) == 0) {
      |                   ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

http://package18.nyi.freebsd.org/data/120amd64-default-PR238330/2019-06-09_20h26m27s/logs/errors/shim-0.9_2.log

This has been reported at [1], which leads to a patch [2].  I have
adapted it to the version in port which fixes the build but if
runtime is fine too I do not know.  Can you take a look?

[1] https://github.com/rhboot/shim/issues/161
[2] https://github.com/rhboot/shim/pull/170


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238330
[Bug 238330] [exp-run] Update GCC_DEFAULT from 8 to 9
-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list