Skip to content

Commit

Permalink
Rename TARGET_DARWIN to TARGET_OSX (#33959)
Browse files Browse the repository at this point in the history
#33716 set TARGET_DARWIN for iOS too but most of the logic is really OSX-specific.
Unset TARGET_DARWIN for iOS and rename the rest of the occurrences to TARGET_OSX.
  • Loading branch information
akoeplinger authored Mar 24, 2020
1 parent 8a66fb7 commit 3d8073d
Show file tree
Hide file tree
Showing 31 changed files with 100 additions and 100 deletions.
18 changes: 9 additions & 9 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ endif(CLR_CMAKE_HOST_UNIX)
if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DHOST_UNIX)

if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
message("Detected OSX x86_64")
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

if(CLR_CMAKE_HOST_FREEBSD)
message("Detected FreeBSD amd64")
Expand Down Expand Up @@ -278,15 +278,15 @@ if (CLR_CMAKE_HOST_UNIX)
# using twos-complement representation (this is normally undefined according to the C++ spec).
add_compile_options(-fwrapv)

if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
# We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)
add_compile_options(-fstack-protector)
else()
check_cxx_compiler_flag(-fstack-protector-strong COMPILER_SUPPORTS_F_STACK_PROTECTOR_STRONG)
if (COMPILER_SUPPORTS_F_STACK_PROTECTOR_STRONG)
add_compile_options(-fstack-protector-strong)
endif()
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

# Suppress warnings-as-errors in release branches to reduce servicing churn
if (PRERELEASE)
Expand Down Expand Up @@ -350,20 +350,20 @@ if (CLR_CMAKE_HOST_UNIX)
add_compile_options(-fvisibility=hidden)

# Specify the minimum supported version of macOS
if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.12)
add_compile_options(${MACOS_VERSION_MIN_FLAGS})
add_link_options(${MACOS_VERSION_MIN_FLAGS})
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)
endif(CLR_CMAKE_HOST_UNIX)

if(CLR_CMAKE_TARGET_UNIX)
add_definitions(-DTARGET_UNIX)
# Contracts are disabled on UNIX.
add_definitions(-DDISABLE_CONTRACTS)
if(CLR_CMAKE_TARGET_DARWIN)
add_definitions(-DTARGET_DARWIN)
endif(CLR_CMAKE_TARGET_DARWIN)
if(CLR_CMAKE_TARGET_OSX)
add_definitions(-DTARGET_OSX)
endif(CLR_CMAKE_TARGET_OSX)
if(CLR_CMAKE_TARGET_FREEBSD)
add_definitions(-DTARGET_FREEBSD)
endif(CLR_CMAKE_TARGET_FREEBSD)
Expand Down
6 changes: 2 additions & 4 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ endif(CLR_CMAKE_HOST_OS STREQUAL Linux OR CLR_CMAKE_HOST_OS STREQUAL Android)
if(CLR_CMAKE_HOST_OS STREQUAL Darwin)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CLR_CMAKE_HOST_DARWIN 1)
set(CLR_CMAKE_HOST_OSX 1)
set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_C_COMPILER} <FLAGS> <DEFINES> <INCLUDES> -o <OBJECT> -c <SOURCE>")
endif(CLR_CMAKE_HOST_OS STREQUAL Darwin)

if(CLR_CMAKE_HOST_OS STREQUAL iOS)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_IOS 1)
set(CLR_CMAKE_HOST_DARWIN 1)
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "armv7")
Expand Down Expand Up @@ -250,13 +249,12 @@ endif(CLR_CMAKE_TARGET_OS STREQUAL Android)

if(CLR_CMAKE_TARGET_OS STREQUAL Darwin)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_DARWIN 1)
set(CLR_CMAKE_TARGET_OSX 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL Darwin)

if(CLR_CMAKE_TARGET_OS STREQUAL iOS)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_IOS 1)
set(CLR_CMAKE_TARGET_DARWIN 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL iOS)

if(CLR_CMAKE_TARGET_OS STREQUAL FreeBSD)
Expand Down
4 changes: 2 additions & 2 deletions eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(NOT WIN32)
locate_toolchain_exec(ranlib CMAKE_RANLIB)
endif()

if(NOT CLR_CMAKE_TARGET_DARWIN)
if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS)
locate_toolchain_exec(objdump CMAKE_OBJDUMP)

if(CMAKE_SYSTEM_NAME STREQUAL Android)
Expand All @@ -60,5 +60,5 @@ if(NOT WIN32)
endif()

locate_toolchain_exec(objcopy CMAKE_OBJCOPY)
endif(NOT CLR_CMAKE_TARGET_DARWIN)
endif(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS)
endif()
6 changes: 3 additions & 3 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function(strip_symbols targetName outputFilename)
if (CLR_CMAKE_HOST_UNIX)
set(strip_source_file $<TARGET_FILE:${targetName}>)

if (CLR_CMAKE_TARGET_DARWIN)
if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS)
set(strip_destination_file ${strip_source_file}.dwarf)

# Ensure that dsymutil and strip are present
Expand All @@ -276,7 +276,7 @@ function(strip_symbols targetName outputFilename)
COMMAND ${STRIP} -S ${strip_source_file}
COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
)
else (CLR_CMAKE_TARGET_DARWIN)
else (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS)
set(strip_destination_file ${strip_source_file}.dbg)

add_custom_command(
Expand All @@ -288,7 +288,7 @@ function(strip_symbols targetName outputFilename)
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
)
endif (CLR_CMAKE_TARGET_DARWIN)
endif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS)

set(${outputFilename} ${strip_destination_file} PARENT_SCOPE)
endif(CLR_CMAKE_HOST_UNIX)
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ endif (CLR_CMAKE_TARGET_ARCH_ARM64)

if (CLR_CMAKE_TARGET_UNIX)

if(CLR_CMAKE_TARGET_DARWIN)
if(CLR_CMAKE_TARGET_OSX)
add_definitions(-D_XOPEN_SOURCE)
add_definitions(-DFEATURE_DATATARGET4)
endif(CLR_CMAKE_TARGET_DARWIN)
endif(CLR_CMAKE_TARGET_OSX)

if (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
Expand Down Expand Up @@ -177,9 +177,9 @@ set(FEATURE_READYTORUN 1)

add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_REJIT>)

if (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_DARWIN)
if (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_OSX)
add_definitions(-DFEATURE_REMOTE_PROC_MEM)
endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_DARWIN)
endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_OSX)

if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DFEATURE_STUBS_AS_IL)
Expand Down Expand Up @@ -231,9 +231,9 @@ if(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
endif(CLR_CMAKE_TARGET_WIN32)

if(CLR_CMAKE_TARGET_DARWIN)
if(CLR_CMAKE_TARGET_OSX)
add_definitions(-DFEATURE_WRITEBARRIER_COPY)
endif(CLR_CMAKE_TARGET_DARWIN)
endif(CLR_CMAKE_TARGET_OSX)

if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32)
add_definitions(-DFEATURE_EH_FUNCLETS)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/debug/createdump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ include(configure.cmake)
# For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling.
if (CORECLR_SET_RPATH)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
set(CMAKE_INSTALL_RPATH "@loader_path")
else()
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)
endif (CORECLR_SET_RPATH)

remove_definitions(-DUNICODE)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/debug/daccess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ target_precompile_header(TARGET daccess HEADER stdafx.h)

add_dependencies(daccess eventing_headers)

if(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
add_definitions(-DUSE_DAC_TABLE_RVA)

add_custom_command(
Expand All @@ -63,4 +63,4 @@ if(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
)

add_dependencies(daccess dactablerva_header)
endif(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
4 changes: 2 additions & 2 deletions src/coreclr/src/dlls/dbgshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)

if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

add_library_clr(dbgshim SHARED ${DBGSHIM_SOURCES})

Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/src/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ else(CLR_CMAKE_HOST_WIN32)
# Add dependency on export file
add_custom_target(mscordaccore_exports DEPENDS ${EXPORTS_FILE})

if(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_DARWIN OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)

if(CLR_CMAKE_HOST_LINUX)

Expand Down Expand Up @@ -91,10 +91,10 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)

if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

# Create object library to enable creation of proper dependency of mscordaccore.exp on mscordac.obj and
# mscordaccore on both the mscordaccore.exp and mscordac.obj.
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/src/dlls/mscordbi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling.
if(CORECLR_SET_RPATH)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
set(CMAKE_INSTALL_RPATH "@loader_path")
else()
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)
endif(CORECLR_SET_RPATH)

set(MSCORDBI_SOURCES
Expand Down Expand Up @@ -50,10 +50,10 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD)

if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES})
target_precompile_header(TARGET mscordbi HEADER stdafx.h)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ else(CLR_CMAKE_HOST_WIN32)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD)

if(CLR_CMAKE_TARGET_DARWIN)
if(CLR_CMAKE_TARGET_OSX)
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -force_load)
set(END_WHOLE_ARCHIVE )

set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_DARWIN)
endif(CLR_CMAKE_TARGET_OSX)

if(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
set(EXPORTS_LINKER_OPTION "${EXPORTS_LINKER_OPTION} -Wl,--no-warn-shared-textrel")
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/gc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ if(CLR_CMAKE_HOST_UNIX)
endif(CLR_CMAKE_HOST_UNIX)

add_definitions(-DBUILD_AS_STANDALONE)
if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
# The implementation of GCToOSInterface on MacOS makes use of non-POSIX
# pthreads APIs, which by default are not included in the pthreads header
# unless we define this macro.
add_definitions(-D_DARWIN_C_SOURCE)
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/env)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/hosts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else(CLR_CMAKE_HOST_WIN32)
add_subdirectory(unixcoreruncommon)
add_subdirectory(unixcorerun)
add_subdirectory(unixcoreconsole)
if(CLR_CMAKE_HOST_DARWIN)
if(CLR_CMAKE_HOST_OSX)
add_subdirectory(osxbundlerun)
endif(CLR_CMAKE_HOST_DARWIN)
endif(CLR_CMAKE_HOST_OSX)
endif(CLR_CMAKE_HOST_WIN32)
6 changes: 3 additions & 3 deletions src/coreclr/src/inc/crosscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define MAKE_TARGET_DLLNAME_W(name) name W(".dll")
#define MAKE_TARGET_DLLNAME_A(name) name ".dll"
#else // TARGET_WINDOWS
#ifdef TARGET_DARWIN
#ifdef TARGET_OSX
#define MAKE_TARGET_DLLNAME_W(name) W("lib") name W(".dylib")
#define MAKE_TARGET_DLLNAME_A(name) "lib" name ".dylib"
#else
Expand Down Expand Up @@ -370,9 +370,9 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {

#define T_CRITICAL_SECTION_VALIDATION_MESSAGE "T_CRITICAL_SECTION validation failed. It is not in sync with CRITICAL_SECTION"

#if defined(TARGET_DARWIN) && defined(TARGET_X86)
#if defined(TARGET_OSX) && defined(TARGET_X86)
#define DAC_CS_NATIVE_DATA_SIZE 76
#elif defined(TARGET_DARWIN) && defined(TARGET_AMD64)
#elif defined(TARGET_OSX) && defined(TARGET_AMD64)
#define DAC_CS_NATIVE_DATA_SIZE 120
#elif defined(TARGET_FREEBSD) && defined(TARGET_X86)
#define DAC_CS_NATIVE_DATA_SIZE 12
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")

set(JIT_EXPORTS_LINKER_OPTION -Wl,--version-script=${JIT_EXPORTS_FILE})
elseif(CLR_CMAKE_TARGET_DARWIN)
elseif(CLR_CMAKE_TARGET_OSX)
set(JIT_EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${JIT_EXPORTS_FILE})
endif()

Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/src/pal/inc/pal_mstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ extern "C" {
// includes are not included, so we need to define them.
#ifndef PAL_IMPLEMENTATION

// OS X already defines these types in 64 bit
#if !defined(TARGET_OSX)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef __int32 int32_t;
Expand All @@ -223,7 +221,6 @@ typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
#endif

#endif // PAL_IMPLEMENTATION

Expand Down
Loading

0 comments on commit 3d8073d

Please sign in to comment.