Menu

Can't build with gnu-efi 3.0.14

knuxify
2021-08-21
2021-09-27
  • knuxify

    knuxify - 2021-08-21

    On gnu-efi 3.0.14, the build fails with the following:

    refind-code > make gnuefi
    make MAKEWITH=GNUEFI -C libeg
    make[1]: Entering directory '/home/knuxify/refind-code/libeg'
    make[1]: Nothing to be done for 'all'.
    make[1]: Leaving directory '/home/knuxify/refind-code/libeg'
    make MAKEWITH=GNUEFI -C mok
    make[1]: Entering directory '/home/knuxify/refind-code/mok'
    make[1]: Nothing to be done for 'all'.
    make[1]: Leaving directory '/home/knuxify/refind-code/mok'
    make MAKEWITH=GNUEFI -C EfiLib
    make[1]: Entering directory '/home/knuxify/refind-code/EfiLib'
    /usr/bin/gcc -Os -fno-strict-aliasing -fno-tree-loop-distribute-patterns -fno-stack-protector -fshort-wchar -Wall -DEFIX64 -DEFI_FUNCTION_WRAPPER -m64 -mno-red-zone  -fpic -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -I../include -I../refind -I../libeg -I../mok -I. -I./../include \
          -D__MAKEWITH_GNUEFI -c gnuefi-helper.c -o gnuefi-helper.o
    In file included from gnuefi-helper.c:19:
    DevicePathUtilities.h:229:3: error: conflicting types for 'EFI_DEVICE_PATH_UTILITIES_PROTOCOL'
      229 | } EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/efi/efi.h:61,
                     from gnuefi-helper.h:24,
                     from gnuefi-helper.c:18:
    /usr/include/efi/efidevp.h:648:3: note: previous declaration of 'EFI_DEVICE_PATH_UTILITIES_PROTOCOL' was here
      648 | } EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    make[1]: *** [../Make.common:164: gnuefi-helper.o] Error 1
    make[1]: Leaving directory '/home/knuxify/refind-code/EfiLib'
    make: *** [Makefile:86: gnuefi] Error 2
    

    Seems like gnu-efi implemented EFI_DEVICE_PATH_UTILITIES_PROTOCOL and a handful of other related declarations (see commit ce0bd62f5c420f0457c58c120497dc16d2e606dd and 69df7422b1b49b8ed994cb56af6ab4fc4c9b552c), which conflict with the definitions in the gnu-efi helper files in refind.

     

    Last edit: knuxify 2021-08-21
  • drcarlos

    drcarlos - 2021-09-27

    I managed to fix the error by commenting out the structure in refind (not sure if this would affect the output though), however it raised an error later on:

    /usr/bin/ld: /usr/lib/libefi.a(data.o):(.data+0x450): multiple definition of `gEfiDevicePathUtilitiesProtocolGuid'; ./../EfiLib//libEfiLib.a(gnuefi-helper.o):(.data+0x10): first defined here
    

    This also seems to be related to the gnu-efi update.

     
    • knuxify

      knuxify - 2021-09-27

      There's a working patch in Alpine that allows building with gnu-efi 3.0.14: https://git.alpinelinux.org/aports/tree/testing/refind/gnu-efi-3014.patch

      (Still, it's not an easily upstreamable one, as it just drops the relevant structs entirely, which would break compatibility with older versions.)

       

      Last edit: knuxify 2021-09-27
      • drcarlos

        drcarlos - 2021-09-27

        Okay, thanks.
        I removed these lines from the rEFInd code and it compiled.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.