Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Compile with gcc 4.8 #27625

Merged
merged 5 commits into from
Nov 2, 2019
Merged
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
8 changes: 5 additions & 3 deletions configurecompiler.cmake
Original file line number Diff line number Diff line change
@@ -19,8 +19,6 @@ if(NOT MSVC AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)

#----------------------------------------
# Detect and set platform variable names
# - for non-windows build platform & architecture is detected using inbuilt CMAKE variables and cross target component configure
@@ -466,7 +464,10 @@ if (CLR_CMAKE_PLATFORM_UNIX)
# 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()
add_compile_options(-fstack-protector-strong)
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_PLATFORM_DARWIN)

# Contracts are disabled on UNIX.
@@ -513,6 +514,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
else()
add_compile_options(-Wno-unused-but-set-variable)
add_compile_options(-Wno-unknown-pragmas)
check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW)
if (COMPILER_SUPPORTS_F_ALIGNED_NEW)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-faligned-new>)
endif()
83 changes: 33 additions & 50 deletions src/pal/inc/pal.h
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ typedef char * va_list;
PALIMPORT
BOOL
PALAPI
PAL_IsDebuggerPresent(VOID);
PAL_IsDebuggerPresent();

/* minimum signed 64 bit value */
#define _I64_MIN (I64(-9223372036854775807) - 1)
@@ -370,8 +370,7 @@ PAL_InitializeWithFlags(
PALIMPORT
int
PALAPI
PAL_InitializeDLL(
VOID);
PAL_InitializeDLL();

PALIMPORT
void
@@ -453,7 +452,7 @@ PAL_UnregisterForRuntimeStartup(
PALIMPORT
BOOL
PALAPI
PAL_NotifyRuntimeStarted(VOID);
PAL_NotifyRuntimeStarted();

#ifdef __APPLE__
PALIMPORT
@@ -1067,8 +1066,7 @@ FlushFileBuffers(
PALIMPORT
UINT
PALAPI
GetConsoleOutputCP(
VOID);
GetConsoleOutputCP();

PALIMPORT
DWORD
@@ -1318,40 +1316,34 @@ ReleaseMutex(
PALIMPORT
DWORD
PALAPI
GetCurrentProcessId(
VOID);
GetCurrentProcessId();

PALIMPORT
DWORD
PALAPI
GetCurrentSessionId(
VOID);
GetCurrentSessionId();

PALIMPORT
HANDLE
PALAPI
GetCurrentProcess(
VOID);
GetCurrentProcess();

PALIMPORT
DWORD
PALAPI
GetCurrentThreadId(
VOID);
GetCurrentThreadId();

PALIMPORT
size_t
PALAPI
PAL_GetCurrentOSThreadId(
VOID);
PAL_GetCurrentOSThreadId();

// To work around multiply-defined symbols in the Carbon framework.
#define GetCurrentThread PAL_GetCurrentThread
PALIMPORT
HANDLE
PALAPI
GetCurrentThread(
VOID);
GetCurrentThread();


#define STARTF_USESTDHANDLES 0x00000100
@@ -1559,8 +1551,7 @@ SleepEx(
PALIMPORT
BOOL
PALAPI
SwitchToThread(
VOID);
SwitchToThread();

#define DEBUG_PROCESS 0x00000001
#define DEBUG_ONLY_THIS_PROCESS 0x00000002
@@ -2414,27 +2405,27 @@ GetThreadTimes(
PALIMPORT
PVOID
PALAPI
PAL_GetStackBase(VOID);
PAL_GetStackBase();

PALIMPORT
PVOID
PALAPI
PAL_GetStackLimit(VOID);
PAL_GetStackLimit();

PALIMPORT
DWORD
PALAPI
PAL_GetLogicalCpuCountFromOS(VOID);
PAL_GetLogicalCpuCountFromOS();

PALIMPORT
DWORD
PALAPI
PAL_GetTotalCpuCount(VOID);
PAL_GetTotalCpuCount();

PALIMPORT
size_t
PALAPI
PAL_GetRestrictedPhysicalMemoryLimit(VOID);
PAL_GetRestrictedPhysicalMemoryLimit();

PALIMPORT
BOOL
@@ -2449,7 +2440,7 @@ PAL_GetCpuLimit(UINT* val);
PALIMPORT
size_t
PALAPI
PAL_GetLogicalProcessorCacheSizeFromOS(VOID);
PAL_GetLogicalProcessorCacheSizeFromOS();

typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size);

@@ -2852,8 +2843,7 @@ VirtualQuery(
PALIMPORT
HANDLE
PALAPI
GetProcessHeap(
VOID);
GetProcessHeap();

#define HEAP_ZERO_MEMORY 0x00000008

@@ -3145,8 +3135,7 @@ OutputDebugStringW(
PALIMPORT
VOID
PALAPI
DebugBreak(
VOID);
DebugBreak();

PALIMPORT
DWORD
@@ -3178,8 +3167,7 @@ SetEnvironmentVariableW(
PALIMPORT
LPWSTR
PALAPI
GetEnvironmentStringsW(
VOID);
GetEnvironmentStringsW();

#ifdef UNICODE
#define GetEnvironmentStrings GetEnvironmentStringsW
@@ -3225,13 +3213,12 @@ RaiseFailFastException(
PALIMPORT
DWORD
PALAPI
GetTickCount(
VOID);
GetTickCount();

PALIMPORT
ULONGLONG
PALAPI
GetTickCount64(VOID);
GetTickCount64();

PALIMPORT
BOOL
@@ -3703,8 +3690,7 @@ PALIMPORT
inline
VOID
PALAPI
MemoryBarrier(
VOID)
MemoryBarrier()
{
__sync_synchronize();
}
@@ -3714,8 +3700,7 @@ PALIMPORT
inline
VOID
PALAPI
YieldProcessor(
VOID)
YieldProcessor()
{
#if defined(_X86_) || defined(_AMD64_)
__asm__ __volatile__(
@@ -3731,7 +3716,7 @@ YieldProcessor(
PALIMPORT
DWORD
PALAPI
GetCurrentProcessorNumber(VOID);
GetCurrentProcessorNumber();

/*++
Function:
@@ -3743,7 +3728,7 @@ Checks if GetCurrentProcessorNumber is available in the current environment
PALIMPORT
BOOL
PALAPI
PAL_HasGetCurrentProcessorNumber(VOID);
PAL_HasGetCurrentProcessorNumber();

#define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
#define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
@@ -3772,8 +3757,7 @@ FormatMessageW(
PALIMPORT
DWORD
PALAPI
GetLastError(
VOID);
GetLastError();

PALIMPORT
VOID
@@ -3784,8 +3768,7 @@ SetLastError(
PALIMPORT
LPWSTR
PALAPI
GetCommandLineW(
VOID);
GetCommandLineW();

#ifdef UNICODE
#define GetCommandLine GetCommandLineW
@@ -3829,7 +3812,7 @@ ResetWriteWatch(
PALIMPORT
VOID
PALAPI
FlushProcessWriteBuffers(VOID);
FlushProcessWriteBuffers();

typedef void (*PAL_ActivationFunction)(CONTEXT *context);
typedef BOOL (*PAL_SafeActivationCheckFunction)(SIZE_T ip, BOOL checkingCurrentThread);
@@ -4553,22 +4536,22 @@ PAL_GetCPUBusyTime(
PALIMPORT
VOID
PALAPI
PAL_EnableProcessProfile(VOID);
PAL_EnableProcessProfile();

PALIMPORT
VOID
PALAPI
PAL_DisableProcessProfile(VOID);
PAL_DisableProcessProfile();

PALIMPORT
BOOL
PALAPI
PAL_IsProcessProfileEnabled(VOID);
PAL_IsProcessProfileEnabled();

PALIMPORT
INT64
PALAPI
PAL_GetCpuTickCount(VOID);
PAL_GetCpuTickCount();
#endif // PAL_PERF

/******************* PAL functions for SIMD extensions *****************/
3 changes: 1 addition & 2 deletions src/pal/inc/palprivate.h
Original file line number Diff line number Diff line change
@@ -243,8 +243,7 @@ GetModuleFileNameA(
PALIMPORT
LPSTR
PALAPI
GetEnvironmentStringsA(
VOID);
GetEnvironmentStringsA();

PALIMPORT
BOOL
17 changes: 0 additions & 17 deletions src/vm/diagnosticsprotocol.h
Original file line number Diff line number Diff line change
@@ -208,23 +208,6 @@ namespace DiagnosticsIpc
return FlattenImpl<T>(payload);
};

// Initialize an outgoing IpcMessage with a header and payload
template <typename T>
bool Initialize(IpcHeader header, T&& payload)
{
CONTRACTL
{
NOTHROW;
GC_TRIGGERS;
MODE_PREEMPTIVE;
}
CONTRACTL_END;

m_Header = header;

return FlattenImpl<T>(payload);
};

// Initialize an outgoing IpcMessage for an error
bool Initialize(HRESULT error)
{
3 changes: 2 additions & 1 deletion src/vm/dumpdiagnosticprotocolhelper.cpp
Original file line number Diff line number Diff line change
@@ -109,7 +109,8 @@ void DumpDiagnosticProtocolHelper::GenerateCoreDump(DiagnosticsIpc::IpcMessage&
}

DiagnosticsIpc::IpcMessage successResponse;
if (successResponse.Initialize(DiagnosticsIpc::GenericSuccessHeader, S_OK))
HRESULT success = S_OK;
if (successResponse.Initialize(DiagnosticsIpc::GenericSuccessHeader, success))
successResponse.Send(pStream);
delete pStream;
}