[ipxe-devel] ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8.5
Allen, Benjamin S.
bsallen at alcf.anl.gov
Fri Jul 28 14:13:02 UTC 2017
Hi Michael,
Very cool, thanks for fixing this. It now builds for me. I'll test booting a node via the produced binary later today.
It looks like ARM32 has a separate issue with 4.8.5. I don't actually have a use case for iPXE on ARM32, but wanted to see if it compiled.
$ make CROSS_COMPILE=arm-linux-gnu- ARCH=arm32 bin-arm32-efi/snp.efi
[BUILD] bin-arm32-efi/acpi_settings.o
In file included from include/ipxe/efi/Uefi/UefiBaseType.h:22:0,
from include/ipxe/efi/efi.h:53,
from include/ipxe/errno/efi.h:26,
from include/errno.h:109,
from core/acpi_settings.c:34:
include/ipxe/efi/Base.h:50:94: error: division by zero [-Werror=div-by-zero]
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:87:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:49: error: variably modified ‘_VerifySizeof__VERIFY_UINT8_ENUM_SIZE’ at file scope
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:87:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:94: error: division by zero [-Werror=div-by-zero]
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:88:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT16_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:49: error: variably modified ‘_VerifySizeof__VERIFY_UINT16_ENUM_SIZE’ at file scope
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:88:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT16_ENUM_SIZE, 4);
^
cc1: all warnings being treated as errors
make: *** [bin-arm32-efi/acpi_settings.o] Error 1
A similar issue is seen compiling natively, albeit with GCC 4.8.2 on a armv7l machine running Ubuntu 14.04.02.
[BUILD] bin-arm32-efi/acpi.o
In file included from include/ipxe/efi/Uefi/UefiBaseType.h:22:0,
from include/ipxe/efi/efi.h:53,
from include/ipxe/errno/efi.h:26,
from include/errno.h:109,
from core/acpi.c:26:
include/ipxe/efi/Base.h:50:94: error: division by zero [-Werror=div-by-zero]
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:87:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:49: error: variably modified ‘_VerifySizeof__VERIFY_UINT8_ENUM_SIZE’ at file scope
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:87:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:94: error: division by zero [-Werror=div-by-zero]
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:88:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT16_ENUM_SIZE, 4);
^
include/ipxe/efi/Base.h:50:49: error: variably modified ‘_VerifySizeof__VERIFY_UINT16_ENUM_SIZE’ at file scope
#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
^
include/ipxe/efi/Base.h:88:1: note: in expansion of macro ‘VERIFY_SIZE_OF’
VERIFY_SIZE_OF (__VERIFY_UINT16_ENUM_SIZE, 4);
^
cc1: all warnings being treated as errors
make: *** [bin-arm32-efi/acpi.o] Error 1
Thanks again,
Ben
> On Jul 28, 2017, at 8:18 AM, Michael Brown <mcb30 at ipxe.org> wrote:
>
> On 26/07/17 16:42, Allen, Benjamin S. wrote:
>> The arm64 makefile sets the -mabi=lp64 CFLAG. It appears this ABI argument was added to GCC in 4.9 for AArch64. CentOS 7 / RHEL7 ship with GCC 4.8.5, and don't have a reasonable packaged way to use a later GCC.
>
> I happen to have a CentOS 7 box next to me. This should now be fixed:
>
> http://git.ipxe.org/ipxe.git/commitdiff/b6fc8be
>
> http://git.ipxe.org/ipxe.git/commitdiff/1a77466
>
> Thanks,
>
> Michael
More information about the ipxe-devel
mailing list