[PATCH v2] configure: Avoid clobbering x18 on arm64 when building with clang

Martin Storsjö martin at martin.st
Fri Jun 23 04:38:21 CDT 2017


On Fri, 23 Jun 2017, Alexandre Julliard wrote:

> Martin Storsjö <martin at martin.st> writes:
>
>> I agree this would be an issue with clang built system libraries on
>> linux though. Is it still worthwhile to add to configure, for cases
>> where system libraries have been built with gcc? If not, I'll just
>> keep on adding it manually to my cflags when configuring, while
>> experimenting with this.
>
> I don't think it's worthwhile adding it, particularly if the compiler
> doesn't work anyway because of va_list. Hopefully you can fix both
> issues while you're at it ;-)

GCC also doesn't work due to va_list - the __builtin_ms_va_list is only 
implemented on x86_64 at the moment, not on aarch64.

Well, I'm not sure how much the x18 register issue really can be fixed - 
the AAPCS calling convention says that it's a temporary register that the 
compiler can use freely, unless the platform has reserved it (like on 
darwin, and apparently also on windows). So I don't think clang/llvm would 
be interested in a patch to disable use of this on linux in general.

Apparently André talked to GCC about the issue a few years ago: 
https://gcc.gnu.org/ml/gcc/2015-07/msg00106.html

I'm not sure if that discussion resulted in something else somewhere - if 
I'm just lucky that it has happened to work for me so far (but could break 
randomly if gcc would happen to use x18 anywhere in the called system 
libraries, and just clang seems to be using it more often so I only ran 
into it with clang?), or if something really was changed elsewhere with 
respect to this. André, can you fill us in on this matter?

In any case, thanks for the attention so far, I'll return once 
__builtin_ms_va_list is implemented in either of the compilers, and I'll 
keep using these flags locally for the time being.

// Martin


More information about the wine-devel mailing list