iPXE discussion forum
ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8 - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8 (/showthread.php?tid=10167)



ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8 - bensallen - 2017-07-25 23:48

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.

Compiling via
Code:
make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/snp.efi
without this flag in 4.8.5 results in the error:

Code:
...
  [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
Code:
make ARCH=arm64 bin-arm-efi/snp.efi -j 8
on a aarch64 machine results in a similar error with the flag removed:

Code:
[BUILD] bin-arm-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-arm-efi/edd.o] Error 1



RE: ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8 - NiKiZe - 2017-07-26 09:59

You might get more feedback on the ipxe-devel mailing list which has a more technical audience then here.


RE: ARM64 compilation on CentOS 7 / RHEL7 with GCC 4.8 - bensallen - 2017-07-26 16:43

Thanks I'll post this on ipxe-devel as well.