[ipxe-devel] Building bin-arm64-efi/snp.efi is broken
Heinrich Schuchardt
xypron.glpk at gmx.de
Sun Aug 26 10:39:07 UTC 2018
On 08/26/2018 11:33 AM, Heinrich Schuchardt wrote:
> On 08/04/2018 02:57 PM, Heinrich Schuchardt wrote:
>> The following patch breaks building for arm64 with GCC 8.1.0 (as
>> supplied by package gcc-aarch64-linux-gnu in Debian Buster):
>>
>> commit 1a7746603bca1022b63c406c9459525312a2b2b6
>> Author: Michael Brown <mcb30 at ipxe.org>
>> Date: Fri Jul 28 13:50:35 2017 +0100
>>
>> [build] Fix use of inline assembly on GCC 4.8 ARM64 builds
>>
>>
>> In file included from core/blocktrans.c:34:
>> core/blocktrans.c: In function ‘blktrans_xferbuf_realloc’:
>> include/errno.h:261:2: error: invalid 'asm': invalid address mode
>> __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/blocktrans.c:57:11: note: in expansion of macro ‘ENOTSUP’
>> return -ENOTSUP;
>> ^~~~~~~
>> include/errno.h:261:2: error: invalid 'asm': invalid address mode
>> __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
>> ^~~~~~~
>> include/errno.h:589:17: note: in expansion of macro ‘__einfo_erro
>>
>> Please, correct the coding.
>>
>> Best regards
>>
>> Heinrich Schuchardt
>>
>
> Hello Michael,
>
> it is the following lines that are causing the problem:
>
> +++ b/src/include/errno.h
> @@ -261,11 +262,11 @@ static inline void eplatform_discard ( int dummy
> __unused, ... ) {}
> __asm__ ( ".section \".einfo\", \"\", " PROGBITS_OPS "\n\t" \
> ".align 8\n\t" \
> "\n1:\n\t" \
> ".long ( 4f - 1b )\n\t" \
> ==> ".long %a0\n\t" \
> ".long ( 2f - 1b )\n\t" \
> ".long ( 3f - 1b )\n\t" \
> ==> ".long %a1\n\t" \
> "\n2:\t.asciz \"" __einfo_desc ( einfo ) "\"\n\t" \
> "\n3:\t.asciz \"" __FILE__ "\"\n\t" \
> ".align 8\n\t" \
>
> Please, replace them with valid gcc 8 assembler code.
>
> Best regards
>
> Heinrich Schuchardt
>
>
The prefix "a" in ".long %a0" is only defined for the x86 architecture
and not for arm64. See
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86Operandmodifiers
You introduced it in
Commit 1a7746603bca ("Fix use of inline assembly on GCC 4.8 ARM64 builds")
Does any architecture need the prefix for a current GCC?
GCC 4.8 has not seen any update since 2014. So why should we care about it?
Best regards
Heinrich Schuchardt
More information about the ipxe-devel
mailing list