[ipxe-devel] ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8.5

Allen, Benjamin S. bsallen at alcf.anl.gov
Wed Jul 26 15:42:35 UTC 2017


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.

Compiling via "make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/snp.efi" without -mabi=lp64 in 4.8.5 results in the error:

...
 [BUILD] bin-arm64-efi/acpi_settings.o
In file included from core/acpi_settings.c:34:0:
core/acpi_settings.c: In function ‘acpi_settings_fetch’:
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:514:16: note: in expansion of macro ‘__einfo_error’
#define ENOENT __einfo_error ( EINFO_ENOENT )
               ^
core/acpi_settings.c:93:11: note: in expansion of macro ‘ENOENT’
  return -ENOENT;
          ^
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:514:16: note: in expansion of macro ‘__einfo_error’
#define ENOENT __einfo_error ( EINFO_ENOENT )
               ^
core/acpi_settings.c:93:11: note: in expansion of macro ‘ENOENT’
  return -ENOENT;
          ^
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:514:16: note: in expansion of macro ‘__einfo_error’
#define ENOENT __einfo_error ( EINFO_ENOENT )
               ^
core/acpi_settings.c:101:11: note: in expansion of macro ‘ENOENT’
  return -ENOENT;
          ^
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:514:16: note: in expansion of macro ‘__einfo_error’
#define ENOENT __einfo_error ( EINFO_ENOENT )
               ^
core/acpi_settings.c:101:11: note: in expansion of macro ‘ENOENT’
  return -ENOENT;
          ^
make: *** [bin-arm64-efi/acpi_settings.o] Error 1

Compiling natively "make ARCH=arm64 bin-arm64-efi/snp.efi -j 8" on a aarch64 machine results in a similar error with the flag removed:

...
 [BUILD] bin-arm64-efi/pc_kbd.o
In file included from core/edd.c:26:0:
core/edd.c: In function ‘edd_describe’:
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:589:17: note: in expansion of macro ‘__einfo_error’
#define ENOTSUP __einfo_error ( EINFO_ENOTSUP )
                ^
core/edd.c:56:9: note: in expansion of macro ‘ENOTSUP’
  rc = -ENOTSUP;
        ^
include/errno.h:261:2: error: invalid 'asm': invalid operand prefix '%c'
 __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
 ^
include/errno.h:589:17: note: in expansion of macro ‘__einfo_error’
#define ENOTSUP __einfo_error ( EINFO_ENOTSUP )
                ^
core/edd.c:56:9: note: in expansion of macro ‘ENOTSUP’
  rc = -ENOTSUP;
        ^
make: *** [bin-arm64-efi/edd.o] Error 1

Any ideas on how to compile the arm64 snp.efi target with GCC 4.8.5?

Thanks,

Ben


More information about the ipxe-devel mailing list