From b88107fa1d7eca0004f0cdeb149f2cb15b711f13 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Tue, 21 Apr 2020 06:06:31 +0000 Subject: [PATCH] * due to an apparent bug in the clang assembler for COFF when assembling ADRP instructions we can't use symbols that are offset into their section git-svn-id: trunk@44948 - --- compiler/aasmcnst.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/aasmcnst.pas b/compiler/aasmcnst.pas index fb78cfc67b..ac9d24be5f 100644 --- a/compiler/aasmcnst.pas +++ b/compiler/aasmcnst.pas @@ -1148,7 +1148,9 @@ implementation class function ttai_typedconstbuilder.get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint; begin { darwin's linker does not support negative offsets } - if not(target_info.system in systems_darwin) then + if not(target_info.system in systems_darwin) and + { it seems that clang's assembler has a bug with the ADRP instruction... } + (target_info.system<>system_aarch64_win64) then result:=0 else result:=get_string_header_size(typ,winlikewidestring); @@ -1158,7 +1160,9 @@ implementation class function ttai_typedconstbuilder.get_dynarray_symofs:pint; begin { darwin's linker does not support negative offsets } - if not (target_info.system in systems_darwin) then + if not (target_info.system in systems_darwin) and + { it seems that clang's assembler has a bug with the ADRP instruction... } + (target_info.system<>system_aarch64_win64) then result:=0 else result:=get_dynarray_header_size;