From 0d245e1f23449426503d0856bf259fa3841dae43 Mon Sep 17 00:00:00 2001 From: "John L. Jolly" Date: Fri, 12 Oct 2018 16:42:56 +0000 Subject: [PATCH] [build] Fix asm argument modifiers for aarch64 build When building bin-arm64-efi/snp.efi using the gcc8 compiler, the following error occurs: In file included from core/xferbuf.c:28: core/xferbuf.c: In function 'xferbuf_malloc_realloc': include/errno.h:261:2: error: invalid 'asm': invalid address mode __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \ ^~~~~~~ include/errno.h:549:16: note: in expansion of macro '__einfo_error' #define ENOSPC __einfo_error ( EINFO_ENOSPC ) ^~~~~~~~~~~~~ core/xferbuf.c:192:11: note: in expansion of macro 'ENOSPC' return -ENOSPC; ^~~~~~ The 'a' address mode is invalid for aarch64. Simply changing this to the constant operand type 'c' seems to resolve the issue on aarch64 and does not appear to affect x86_64 or i586. Signed-off-by: John L. Jolly --- include/errno.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/errno.h b/include/errno.h index e80bf9ca5..342384fa4 100644 --- a/include/errno.h +++ b/include/errno.h @@ -262,10 +262,10 @@ static inline void eplatform_discard ( int dummy __unused, ... ) {} ".align 8\n\t" \ "\n1:\n\t" \ ".long ( 4f - 1b )\n\t" \ - ".long %a0\n\t" \ + ".long %c0\n\t" \ ".long ( 2f - 1b )\n\t" \ ".long ( 3f - 1b )\n\t" \ - ".long %a1\n\t" \ + ".long %c1\n\t" \ "\n2:\t.asciz \"" __einfo_desc ( einfo ) "\"\n\t" \ "\n3:\t.asciz \"" __FILE__ "\"\n\t" \ ".align 8\n\t" \