Skip to content

Commit e99557b

Browse files
authored
Fix zlib-ng build with cmake 3.31.0 (#110359)
* Fix zlib-ng build with cmake 3.31.0 * Dummy change in JIT * Use POST_BUILD in add_custom_command * Normalize paths before install * Revert dummy change; CI is green * Update functions.cmake * Update functions.cmake * Update src/native/external/zlib-ng/CMakeLists.txt
1 parent df1eaf9 commit e99557b

File tree

5 files changed

+10
-19
lines changed

5 files changed

+10
-19
lines changed

.github/workflows/jit-format.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,10 @@ jobs:
2828
container: ${{ matrix.os.container }}
2929
name: Format jit codebase ${{ matrix.os.name }}
3030
steps:
31-
- name: Checkout jitutils
32-
uses: actions/checkout@v4
33-
with:
34-
path: jitutils
35-
repository: dotnet/jitutils
36-
ref: main
37-
token: ${{ secrets.GITHUB_TOKEN }}
3831
- name: Install .NET
3932
uses: actions/setup-dotnet@v4
4033
with:
4134
dotnet-version: '8.0.x'
42-
- name: Build jitutils
43-
run: |
44-
./bootstrap${{ matrix.os.extension }}
45-
working-directory: jitutils
4635
- name: Checkout runtime
4736
uses: actions/checkout@v4
4837
with:
@@ -52,7 +41,7 @@ jobs:
5241

5342
- name: Run jitformat.py
5443
run: |
55-
python3 runtime/src/coreclr/scripts/jitformat.py --jitutils jitutils -r runtime -o ${{ matrix.os.name }} -a x64 ${{ matrix.os.cross }}
44+
python3 runtime/src/coreclr/scripts/jitformat.py -r runtime -o ${{ matrix.os.name }} -a x64 ${{ matrix.os.cross }}
5645
env:
5746
ROOTFS_DIR: ${{ matrix.os.rootfs }}
5847

@@ -61,4 +50,4 @@ jobs:
6150
with:
6251
path: runtime/format.patch
6352
name: format.${{matrix.os.name}}.patch
64-
if: failure()
53+
if: failure()

eng/native/functions.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ endfunction()
489489

490490
function(install_symbol_file symbol_file destination_path)
491491
if(CLR_CMAKE_TARGET_WIN32)
492-
install(FILES ${symbol_file} DESTINATION ${destination_path}/PDB ${ARGN})
492+
cmake_path(SET DEST NORMALIZE "${destination_path}/PDB")
493+
install(FILES ${symbol_file} DESTINATION ${DEST} ${ARGN})
493494
else()
494495
install(FILES ${symbol_file} DESTINATION ${destination_path} ${ARGN})
495496
endif()

src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ endif()
9292
add_custom_command(
9393
# The AsmOffsets.cs is consumed later by the managed build
9494
TARGET Runtime.WorkstationGC
95-
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS} -I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
96-
DEPENDS "${RUNTIME_DIR}/AsmOffsets.cpp" "${RUNTIME_DIR}/AsmOffsets.h"
95+
POST_BUILD
96+
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS}
97+
-I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
9798
)
9899

99100
add_custom_command(

src/native/external/zlib-ng-version.txt

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ We have removed the following folders from our local copy as these files are not
1010
- zlib-ng/arch/s390/self-hosted-builder/
1111

1212
Also, if the next version does not yet contain the fixes included in 12bc7edc73308f017ec40c6b2db694a6e3490ac2, cherry-pick it as a patch.
13+
14+
Apply https://github.com/zlib-ng/zlib-ng/pull/1812

src/native/external/zlib-ng/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
cmake_minimum_required(VERSION 3.5.1)
1+
cmake_minimum_required(VERSION 3.5.1...3.29.0)
22
if(CMAKE_VERSION VERSION_LESS 3.12)
33
cmake_policy(VERSION ${CMAKE_VERSION})
4-
else()
5-
cmake_policy(VERSION 3.5.1...3.29.0)
64
endif()
75
message(STATUS "Using CMake version ${CMAKE_VERSION}")
86

0 commit comments

Comments
 (0)