Skip to content

Commit ef8c465

Browse files
RahulHereRahulHere
authored andcommitted
Resolve Windows ARM64 build by adding missing socket libraries
Add ws2_32, crypt32, and iphlpapi link libraries to the ARM64 toolchain file, matching the x64 configuration. Also improve build logging for easier debugging. Changes: - Add Windows socket libraries to linker flags - Add libevent include directory - Save cmake and make logs for debugging - Copy logs to output directory
1 parent 21a8def commit ef8c465

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docker-mcp/Dockerfile.windows-arm64-llvm

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ RUN echo 'set(CMAKE_SYSTEM_NAME Windows)' > /build/toolchain-win-arm64.cmake &&
104104
echo '# libevent paths' >> /build/toolchain-win-arm64.cmake && \
105105
echo 'set(LIBEVENT_INCLUDE_DIRS /deps/libevent/include)' >> /build/toolchain-win-arm64.cmake && \
106106
echo 'set(LIBEVENT_LIBRARIES /deps/libevent/lib/libevent_core.a /deps/libevent/lib/libevent_extra.a)' >> /build/toolchain-win-arm64.cmake && \
107-
echo 'set(LIBEVENT_FOUND TRUE)' >> /build/toolchain-win-arm64.cmake
107+
echo 'set(LIBEVENT_FOUND TRUE)' >> /build/toolchain-win-arm64.cmake && \
108+
echo 'include_directories(/deps/libevent/include)' >> /build/toolchain-win-arm64.cmake && \
109+
echo '' >> /build/toolchain-win-arm64.cmake && \
110+
echo '# Windows-specific linking - add socket libraries' >> /build/toolchain-win-arm64.cmake && \
111+
echo 'link_libraries(ws2_32 crypt32 iphlpapi)' >> /build/toolchain-win-arm64.cmake && \
112+
echo 'set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lws2_32 -lcrypt32 -liphlpapi")' >> /build/toolchain-win-arm64.cmake && \
113+
echo 'set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lws2_32 -lcrypt32 -liphlpapi")' >> /build/toolchain-win-arm64.cmake
108114

109115
# Build the library for Windows ARM64
110116
RUN mkdir -p cmake-build && cd cmake-build && \
@@ -122,8 +128,9 @@ RUN mkdir -p cmake-build && cd cmake-build && \
122128
-DMCP_USE_NGHTTP2=OFF \
123129
-DCMAKE_INSTALL_PREFIX=/install \
124130
-DCMAKE_SYSTEM_NAME=Windows \
125-
/build && \
126-
make -j$(nproc) VERBOSE=1 || make -j1 VERBOSE=1 && \
131+
/build 2>&1 | tee /tmp/cmake_output.log && \
132+
make -j$(nproc) VERBOSE=1 2>&1 | tee /tmp/make_output.log || \
133+
(echo "=== Build failed, showing logs ===" && cat /tmp/cmake_output.log && cat /tmp/make_output.log && make -j1 VERBOSE=1) && \
127134
make install || true
128135

129136
# Create output directory
@@ -153,4 +160,7 @@ RUN aarch64-w64-mingw32-strip --strip-unneeded *.dll 2>/dev/null || true && \
153160
# List final output
154161
RUN echo "=== Output files ===" && ls -la /output/
155162

163+
# Keep logs for debugging
164+
RUN cp /tmp/*.log /output/ 2>/dev/null || true
165+
156166
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)