Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross OS DAC regression #31901

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/coreclr/src/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CLR_DAC_SOURCES

add_definitions(-DFX_VER_INTERNALNAME_STR=mscordaccore.dll)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
list(APPEND CLR_DAC_SOURCES
Native.rc
)
Expand All @@ -24,7 +24,7 @@ if(CLR_CMAKE_TARGET_WIN32)
# No library groups for Win32
set(START_LIBRARY_GROUP)
set(END_LIBRARY_GROUP)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordac_unixexports.src)
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordac.exports)

Expand Down Expand Up @@ -71,7 +71,7 @@ else(CLR_CMAKE_TARGET_WIN32)
# Add lib redefines file to DAC
list(APPEND CLR_DAC_SOURCES libredefines.S)
endif(CLR_CMAKE_HOST_LINUX)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
# This option is necessary to ensure that the overloaded delete operator defined inside
Expand Down Expand Up @@ -136,6 +136,12 @@ set(COREDAC_LIBRARIES
)

if(CLR_CMAKE_TARGET_WIN32)
list(APPEND COREDAC_LIBRARIES
mdwinmd_dac
)
endif(CLR_CMAKE_TARGET_WIN32)

if(CLR_CMAKE_HOST_WIN32)
# mscordac.def should be generated before mscordaccore.dll is built
add_dependencies(mscordaccore mscordaccore_def)

Expand All @@ -160,7 +166,6 @@ if(CLR_CMAKE_TARGET_WIN32)
set(COREDAC_LIBRARIES
hoyosjs marked this conversation as resolved.
Show resolved Hide resolved
${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp # export file
${COREDAC_LIBRARIES}
mdwinmd_dac
kernel32.lib
advapi32.lib
ole32.lib
Expand All @@ -170,23 +175,23 @@ if(CLR_CMAKE_TARGET_WIN32)
${STATIC_MT_CRT_LIB}
${STATIC_MT_VCRT_LIB}
)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
list(APPEND COREDAC_LIBRARIES
mscorrc_debug
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
coreclrpal
palrt
${END_WHOLE_ARCHIVE}
)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES})

# add the install targets
install_clr(TARGETS mscordaccore)
install_clr(TARGETS mscordaccore DESTINATION sharedFramework SKIP_STRIP)

if(CLR_CMAKE_TARGET_WIN32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we gonna produce long name cross-OS dac too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find/notice that code....
There is probably a whole round of things to do for CI, official builds, testing. So far I have been focusing on making it compile.

Copy link
Contributor Author

@sdmaclea sdmaclea Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the code. There is longer path name that is built. It ends in a Linux.<Target_Arch>.<BuildType> directory with a typical windows dac name.

if(CLR_CMAKE_HOST_WIN32)
set(LONG_NAME_HOST_ARCH ${CLR_CMAKE_HOST_ARCH})
set(LONG_NAME_TARGET_ARCH ${CLR_CMAKE_TARGET_ARCH})
if (LONG_NAME_HOST_ARCH STREQUAL x64)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/dlls/mscorrc/full/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.debug.dll)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)

add_library_clr(mscorrc.debug SHARED
../include.rc
Expand All @@ -16,5 +16,5 @@ else()
${TARGET_CPP_FILE}
)

endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)

6 changes: 3 additions & 3 deletions src/coreclr/src/hosts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include_directories(inc)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(corerun)
add_subdirectory(coreconsole)
add_subdirectory(coreshim)
else(CLR_CMAKE_TARGET_WIN32)
else(CLR_CMAKE_HOST_WIN32)
add_subdirectory(unixcoreruncommon)
add_subdirectory(unixcorerun)
add_subdirectory(unixcoreconsole)
if(CLR_CMAKE_HOST_DARWIN)
add_subdirectory(osxbundlerun)
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_HOST_WIN32)
4 changes: 2 additions & 2 deletions src/coreclr/src/vm/eventing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(EVENT_MANIFEST ${VM_DIR}/ClrEtwAll.man)
set(EVENT_EXCLUSIONS ${VM_DIR}/ClrEtwAllMeta.lst)

if (CLR_CMAKE_TARGET_WIN32)
if (CLR_CMAKE_HOST_WIN32)
set(NONEXTERN_ARG "--nonextern")
set(NOXPLATHEADER_ARG "--noxplatheader")
else()
Expand Down Expand Up @@ -35,6 +35,6 @@ add_dependencies(eventing_headers eventprovider)

add_subdirectory(eventpipe)

if(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(EtwProvider)
endif()