Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
ARM64 CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Nov 6, 2021
1 parent f5c793e commit ebc30ef
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 35 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ jobs:
strategy:
fail-fast: true
matrix:
arch: [ x64, x86 ]
build: [
nmake_cl_x64_release,
nmake_cl_x86_release,
nmake_cl_ARM64_release,
]

include:
- { build: nmake_cl_x64_release, arch: amd64, platform: x64, }
- { build: nmake_cl_x86_release, arch: amd64_x86, platform: x86, }
- { build: nmake_cl_ARM64_release, arch: amd64_arm64, platform: ARM64, }

env:
BUILD_TYPE: Release
Expand All @@ -34,11 +43,11 @@ jobs:
- name: Set the pack file name
shell: bash
run: |
echo "netbox_name=NetBox.${{ matrix.arch }}.${{ env.version }}.7z" >> $GITHUB_ENV
echo "netbox_pdb_name=NetBox.${{ matrix.arch }}.${{ env.version }}.pdb.7z" >> $GITHUB_ENV
echo "netbox_name=NetBox.${{ matrix.platform }}.${{ env.version }}.7z" >> $GITHUB_ENV
echo "netbox_pdb_name=NetBox.${{ matrix.platform }}.${{ env.version }}.pdb.7z" >> $GITHUB_ENV
- name: Add C++ build tools to PATH
uses: ilammy/msvc-dev-cmd@v1.9.0
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

Expand All @@ -49,7 +58,7 @@ jobs:
shell: bash
working-directory: build
run: >
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE $GITHUB_WORKSPACE/src/NetBox
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPROJECT_PLATFORM=${{ matrix.platform }} $GITHUB_WORKSPACE/src/NetBox
- name: Build
working-directory: build
Expand All @@ -59,9 +68,9 @@ jobs:
- name: pack plugin
shell: bash
run: |
cp LICENSE.txt README.md README.RU.md README.PL.md ./Far3_${{ matrix.arch }}/Plugins/NetBox/
7z a ${{ env.netbox_name }} ./Far3_${{ matrix.arch }}/Plugins/* -xr!*.pdb
7z a ${{ env.netbox_pdb_name }} ./Far3_${{ matrix.arch }}/Plugins/NetBox/NetBox.pdb
cp LICENSE.txt README.md README.RU.md README.PL.md ./Far3_${{ matrix.platform }}/Plugins/NetBox/
7z a ${{ env.netbox_name }} ./Far3_${{ matrix.platform }}/Plugins/* -xr!*.pdb
7z a ${{ env.netbox_pdb_name }} ./Far3_${{ matrix.platform }}/Plugins/NetBox/NetBox.pdb
- name: Upload result
uses: actions/upload-artifact@v2
Expand Down
2 changes: 2 additions & 0 deletions libs/atlmfc/include/atlalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,8 @@ private :
BYTE _pad[8];
#elif defined(_M_AMD64)
BYTE _pad[8];
#elif defined(_M_ARM64)
BYTE _pad[8];
#else
#error Only supported for X86, AMD64 and IA64
#endif
Expand Down
6 changes: 2 additions & 4 deletions libs/atlmfc/include/atlcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,7 @@ class CComAggregateCreator

#if defined(_M_IX86)
#define OBJECT_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:___pobjMap_" #class));
#elif defined(_M_IA64)
#define OBJECT_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:__pobjMap_" #class));
#elif defined(_M_AMD64)
#elif defined(_M_IA64) || defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
#define OBJECT_ENTRY_PRAGMA(class) __pragma(comment(linker, "/include:__pobjMap_" #class));
#else
#error Unknown Platform. define OBJECT_ENTRY_PRAGMA
Expand Down Expand Up @@ -2509,7 +2507,7 @@ class CComStdCallThunk
}
};

#elif defined ( _M_IX86 ) || defined ( _M_AMD64 )
#elif defined ( _M_IX86 ) || defined ( _M_AMD64 ) || defined( _M_ARM64 )

extern "C"
{
Expand Down
36 changes: 35 additions & 1 deletion libs/atlmfc/include/atlstdthunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,40 @@ struct _stdcallthunk
}
};
#pragma pack(pop)
#elif defined(_M_ARM64)
PVOID __stdcall __AllocStdCallThunk(VOID);
VOID __stdcall __FreeStdCallThunk(PVOID);
#pragma pack(push,4)
struct _stdcallthunk {
ULONG m_ldr_r16; // ldr x16, [pc, #24]
ULONG m_ldr_r0; // ldr x0, [pc, #12]
ULONG m_br; // br x16
ULONG m_pad;
ULONG64 m_pThis;
ULONG64 m_pFunc;
BOOL Init(DWORD_PTR proc, void* pThis) {
m_ldr_r16 = 0x580000D0;
m_ldr_r0 = 0x58000060;
m_br = 0xd61f0200;
m_pThis = (ULONG64)pThis;
m_pFunc = (ULONG64)proc;
// write block from data cache and
// flush from instruction cache
FlushInstructionCache(GetCurrentProcess(), this, sizeof(_stdcallthunk));
return TRUE;
}
void* GetCodeAddress() {
return (void *)((ULONG_PTR)this);
}
void* operator new(size_t)
{
return __AllocStdCallThunk();
}
void operator delete(void* pThunk) {
__FreeStdCallThunk(pThunk);
}
};
#pragma pack(pop)
#elif defined(_ARM_)
#pragma pack(push,4)
struct _stdcallthunk // this should come out to 16 bytes
Expand Down Expand Up @@ -228,7 +262,7 @@ struct _stdcallthunk
#pragma pack(pop)
//IA64 thunks do not currently use the atlhunk.cpp allocator.
#else
#error Only ARM, ALPHA, SH3, MIPS, IA64, AMD64 and X86 supported
#error Only ARM, ARM64, ALPHA, SH3, MIPS, IA64, AMD64 and X86 supported
#endif


Expand Down
2 changes: 1 addition & 1 deletion libs/zlib/src/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#elif defined(WIN32) || defined(_WIN32)
# define LITTLE_ENDIAN 1234
# define BIG_ENDIAN 4321
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64) || defined (_M_ARM)
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64) || defined (_M_ARM) || defined (_M_ARM64)
# define BYTE_ORDER LITTLE_ENDIAN
# else
# error Unknown endianness!
Expand Down
2 changes: 1 addition & 1 deletion libs/zlib/src/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


#if defined(_MSC_VER) && !defined(__clang__)
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64) || defined(_M_ARM64)
# include "arch/x86/ctzl.h"
# elif defined(_M_ARM)
# include "arch/arm/ctzl.h"
Expand Down
25 changes: 5 additions & 20 deletions src/NetBox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ if(NOT DEFINED FAR_VERSION OR FAR_VERSION STREQUAL "")
set(FAR_VERSION Far3)
endif()

if(NOT DEFINED PROJECT_PLATFORM OR PROJECT_PLATFORM STREQUAL "")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(x64 1)
set(PROJECT_PLATFORM "x64")
else()
set(x64 0)
set(PROJECT_PLATFORM "x86")
endif()
endif()

if(MSVC)
if(MSVC14)
Expand Down Expand Up @@ -75,13 +75,9 @@ endif()

set(NETBOX_C_FLAGS "")

if(x64)
set(NETBOX_PLATFORM_FLAGS "${NETBOX_PLATFORM_FLAGS} -DWIN64")
else()
if (MSVC_VERSION GREATER 1699)
if(PROJECT_PLATFORM STREQUAL "x86")
set(NETBOX_PLATFORM_FLAGS "${NETBOX_PLATFORM_FLAGS} /arch:IA32")
endif()
endif()

if(MSVC)
set(NETBOX_C_FLAGS "${NETBOX_C_FLAGS} /TC")
Expand Down Expand Up @@ -210,17 +206,6 @@ include_directories(

if(OPT_COMPILE_OPENSSL)

if(x64)
set(OPENSSL_COMPILE_FLAGS ${OPENSSL_COMPILE_FLAGS}
-DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WIN64
-DMK1MF_PLATFORM_VC_WIN64A
)
else()
set(OPENSSL_COMPILE_FLAGS ${OPENSSL_COMPILE_FLAGS}
-DOPENSSL_SYSNAME_WIN32
-DMK1MF_PLATFORM_VC_WIN32
)
endif()
set(OPENSSL_COMPILE_FLAGS ${OPENSSL_COMPILE_FLAGS}
-DMK1MF_BUILD -DWIN32_LEAN_AND_MEAN
-DVC_EXTRALEAN -DSECURITY_WIN32 -DOPENSSL_NO_CAPIENG -DNO_CHMOD -DOPENSSL_NO_DGRAM -DOPENSSL_NO_RIJNDAEL
Expand Down Expand Up @@ -1455,7 +1440,7 @@ add_custom_target(NETBOX_SOURCES SOURCES
)

if(MSVC)
if(NOT x64)
if(PROJECT_PLATFORM STREQUAL "x86")

find_program(MASM_EXECUTABLE ml)
# message("masm: ${MASM_EXECUTABLE}")
Expand All @@ -1477,7 +1462,7 @@ set(NETBOX_SOURCES ${NETBOX_SOURCES}
${ASM_OBJECTS}
)

endif(NOT x64)
endif()
endif(MSVC)

set(NETBOX_LIBRARIES
Expand Down

0 comments on commit ebc30ef

Please sign in to comment.