• Show log

    Commit

  • Hash : c06468fa
    Author : Martin Storsjö
    Date : 2020-04-26T04:58:33

    Fix building for aarch64 windows with mingw toolchains (#555)
    
    * aarch64: Check _WIN32 instead of _M_ARM64 for detecting windows
    
    This fixes building for aarch64 with mingw toolchains. _M_ARM64 is
    predefined by MSVC, while mingw compilers predefine __aarch64__.
    
    In aarch64 specific code, change checks for _M_ARM64 into checks for
    _WIN32.
    
    In arch independent code, check for
    (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32)
    instead of just _M_ARM64.
    
    In src/closures.c, coalesce checks like
    defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64)
    into plain defined(_WIN32). Technically, this enables code for
    ARM32 windows where it wasn't, but as far as I can see it, those
    codepaths should be fine for that architecture variant as well.
    
    * aarch64: Only use armasm source when building with MSVC
    
    When building for windows/arm64 with clang, the normal gas style .S
    source works fine. sysv.S and win64_armasm.S seem to be functionally
    equivalent, with only differences being due to assembler syntax.