Skip to content

Commit

Permalink
Add support for CLANGARM64 target
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Ameling <[email protected]>
  • Loading branch information
dennisameling committed Sep 17, 2022
1 parent 6b74337 commit 9eae59e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/clang-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CLANG build

on:
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
clang-build:
runs-on: [Windows, ARM64]
env:
NO_PERL: 1
steps:
- uses: actions/checkout@v3
- uses: dennisameling/setup-git-for-windows-sdk@01872063f7b133eae0732176f08e309a69c22b4d
with:
flavor: full
architecture: aarch64
- name: Add clangarm64 server
run: |
cat <<EOF >> /etc/pacman.conf
[clangarm64]
Server = https://mirror.msys2.org/mingw/clangarm64/
EOF
pacman -Sy
- name: Install packages
# The clangarm64 folder is missing in the Git for Windows SDK, so let's create it
run: |
mkdir -p /clangarm64
pacman -S --noconfirm base-devel mingw-w64-clang-aarch64-openssl mingw-w64-clang-aarch64-zlib \
mingw-w64-clang-aarch64-curl mingw-w64-clang-aarch64-expat \
mingw-w64-clang-aarch64-libiconv mingw-w64-clang-aarch64-toolchain \
mingw-w64-clang-aarch64-pcre2 mingw-w64-clang-aarch64-libssp
- name: Build Git CLANGARM64
run: make -j`nproc`
6 changes: 6 additions & 0 deletions compat/bswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ static inline uint64_t git_bswap64(uint64_t x)
}
#endif

/* available since Clang 12 and GCC 10, i.a. needed for ARM64/aarch64 on Windows */
#elif defined(__has_builtin) && __has_builtin(__builtin_bswap64)

#define bswap32(x) __builtin_bswap32((x))
#define bswap64(x) __builtin_bswap64((x))

#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64))

#include <stdlib.h>
Expand Down
4 changes: 4 additions & 0 deletions config.mak.uname
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9eae59e

Please sign in to comment.