mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-24 13:37:00 -05:00
Add support for CLANGARM64 target (#3916)
**This requires an ARM64-machine with Windows 11 installed (which supports x64 emulation for MSYS2)** ### The main idea - Use the main MSYS2/git-sdk-64 setup, which works on Windows 11 on ARM thanks to x64-emulation - Configure the official `clangarm64` MSYS2 repo - Install `mingw-w64-clang-aarch64-toolchain` which contains the ARM64-native Clang compiler
This commit is contained in:
25
.github/workflows/clangarm64-build.yml
vendored
Normal file
25
.github/workflows/clangarm64-build.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: CLANG build ARM64
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
clang-build:
|
||||
runs-on: [Windows, ARM64]
|
||||
env:
|
||||
NO_PERL: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: git-for-windows/setup-git-for-windows-sdk@v1
|
||||
with:
|
||||
flavor: makepkg-git
|
||||
architecture: aarch64
|
||||
# This assumes that the job is running on a self-hosted runner,
|
||||
# in which case we need to cleanup SDK files.
|
||||
cleanup: true
|
||||
- name: Build Git CLANGARM64
|
||||
run: make -j`nproc`
|
||||
@@ -35,7 +35,19 @@ static inline uint64_t default_bswap64(uint64_t val)
|
||||
#undef bswap32
|
||||
#undef bswap64
|
||||
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
/**
|
||||
* __has_builtin is available since Clang 10 and GCC 10.
|
||||
* Below is a fallback for older compilers.
|
||||
*/
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_builtin(__builtin_bswap32) && __has_builtin(__builtin_bswap64)
|
||||
#define bswap32(x) __builtin_bswap32((x))
|
||||
#define bswap64(x) __builtin_bswap64((x))
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
|
||||
#define bswap32 git_bswap32
|
||||
static inline uint32_t git_bswap32(uint32_t x)
|
||||
|
||||
@@ -711,6 +711,10 @@ else
|
||||
prefix = /mingw64
|
||||
HOST_CPU = x86_64
|
||||
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
|
||||
else ifeq (CLANGARM64,$(MSYSTEM))
|
||||
prefix = /clangarm64
|
||||
HOST_CPU = aarch64
|
||||
BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
|
||||
else
|
||||
COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
|
||||
BASIC_LDFLAGS += -Wl,--large-address-aware
|
||||
|
||||
Reference in New Issue
Block a user