diff --git a/src/coreclr/clrdatadescriptors.cmake b/src/coreclr/clrdatadescriptors.cmake index 4cc6692d861da5..86b1b7defbebcb 100644 --- a/src/coreclr/clrdatadescriptors.cmake +++ b/src/coreclr/clrdatadescriptors.cmake @@ -88,4 +88,16 @@ function(generate_data_descriptors) # Set include directories for the data descriptor targets, now that they are created. target_include_directories(${LIBRARY} PUBLIC ${DATA_DESCRIPTOR_SHARED_INCLUDE_DIR}) target_include_directories(${LIBRARY} PRIVATE ${GENERATED_CDAC_DESCRIPTOR_DIR}) + + if(MSVC) + # Give this OBJECT library a deterministic, per-target compile PDB. Without this, + # MSVC writes debug info to the default `vc140.pdb`, which does not travel with + # the .obj files when they are archived into a static library (e.g. + # Runtime.ServerGC.lib). Downstream linkers - notably the NativeAOT publish + # of ILCompiler/crossgen2/ilasm - then emit LNK4099 ("PDB 'vc140.pdb' was not + # found"), which is fatal under /WX. + set_target_properties(${LIBRARY} PROPERTIES + COMPILE_PDB_NAME "${LIBRARY}" + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$") + endif() endfunction(generate_data_descriptors) diff --git a/src/coreclr/jit/emitwasm.cpp b/src/coreclr/jit/emitwasm.cpp index 148a7e01f85e5b..4eaaf589cc9b20 100644 --- a/src/coreclr/jit/emitwasm.cpp +++ b/src/coreclr/jit/emitwasm.cpp @@ -599,7 +599,7 @@ size_t emitter::emitOutputULEB128(uint8_t* destination, uint64_t value) size_t emitter::emitOutputULEB128Padded(uint8_t* destination, uint64_t value) { uint8_t* buffer = destination + writeableOffset; - int i = 0; + unsigned i = 0; for (; i < PADDED_RELOC_SIZE - 1; i++) {