Skip to content

Commit b588d34

Browse files
committed
win32: use jwasm as masm-compatible assembler on MinGW
1 parent 06bd407 commit b588d34

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

CMakeLists.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.28)
22

33
project(native_client C CXX ASM)
44

5-
if (WIN32 AND NOT MINGW)
5+
if (WIN32)
6+
if (NOT MSVC AND NOT CMAKE_ASM_MASM_COMPILER)
7+
set(CMAKE_ASM_MASM_COMPILER "jwasm")
8+
endif()
9+
610
enable_language(ASM_MASM)
711
endif()
812

@@ -11,6 +15,14 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1115
include(DaemonPlatform/Platform)
1216
include(NaClFlags)
1317

18+
if (WIN32 AND NOT MSVC)
19+
if (ARCH STREQUAL "i686")
20+
list(APPEND CMAKE_ASM_MASM_FLAGS "-coff")
21+
elseif(ARCH STREQUAL "amd64")
22+
list(APPEND CMAKE_ASM_MASM_FLAGS "-win64")
23+
endif()
24+
endif()
25+
1426
if (NOT PYTHON)
1527
set(PYTHON "python3")
1628
endif()

src/trusted/service_runtime/CMakeLists.txt

+2-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,8 @@ elseif (ARCH STREQUAL "amd64")
103103
# This use of win64_asm_env causes an invocation of MSVC, even if sel_ldr
104104
# would not otherwise be actually built. So don't include it if we aren't
105105
# actually building sel_ldr
106-
if (MSVC)
107-
add_library(nacl_switch_unwind_win OBJECT "arch/x86_64/nacl_switch_unwind_win.asm")
108-
list(APPEND LDR_LIBS nacl_switch_unwind_win)
109-
else()
110-
message(WARNING "Cannot build nacl_switch_unwind_win without MSVC ml")
111-
endif()
106+
add_library(nacl_switch_unwind_win OBJECT "arch/x86_64/nacl_switch_unwind_win.asm")
107+
list(APPEND LDR_LIBS nacl_switch_unwind_win)
112108
endif()
113109
else()
114110
list(APPEND LDR_INPUTS "arch/x86_64/sel_addrspace_posix_x86_64.c")

0 commit comments

Comments
 (0)