diff options
author | Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> | 2019-02-01 10:27:39 -0500 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2019-02-01 16:27:39 +0100 |
commit | fc7a8fbbc1754c8dd49f66f9b59c1ff12a5f842e (patch) | |
tree | aebcfe9a9ea0f9381cf1c6ff184f3b96c852a65b /src/pal/src/exception/seh-unwind.cpp | |
parent | a8a05e8c595ae0b9e12333134f38e19acf981be4 (diff) | |
download | coreclr-fc7a8fbbc1754c8dd49f66f9b59c1ff12a5f842e.tar.gz coreclr-fc7a8fbbc1754c8dd49f66f9b59c1ff12a5f842e.tar.bz2 coreclr-fc7a8fbbc1754c8dd49f66f9b59c1ff12a5f842e.zip |
Coreclr gnuport (#22129)
* Abstract away NOINLINE statement
MSVC and GNU compilers use different attributes for noinline.
Abstract away compiler differences.
* Replace __sync_swap with __atomic_exchange_n
__sync_swap doesn't exist on GNU. Replacing with __atomic_exchange_n
which is universally available.
* Define CDECL for GNUC
__cdecl is not defined by default on GNU compilers.
* Define gcc version of __declspec(thread)
* Correct pointer casting
A pointer value is usually unsigned long on most platforms.
Casting it to integer causes signedness issues. Use size_t
to be efficient on all 32 and 64 bit architectures.
* Put quotes around the error string
Correct error statement. GNU G++ is picky about the string
following the error statement with ' character in it. It needs
to be enclosed with double quotes.
* Fix casting problem
Seeing these warnings with GNU G++ compiler
src/pal/src/sync/cs.cpp: In function ‘void CorUnix::InternalInitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION, DWORD, bool)’:
src/pal/src/sync/cs.cpp:630:48: warning: converting to non-pointer type ‘SIZE_T {aka long unsigned int}’ from NULL [-Wconversion-null]
pPalCriticalSection->OwningThread = NULL;
^
src/pal/src/sync/cs.cpp: In function ‘void CorUnix::InternalLeaveCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*)’:
src/pal/src/sync/cs.cpp:880:43: warning: converting to non-pointer type ‘SIZE_T {aka long unsigned int}’ from NULL [-Wconversion-null]
pPalCriticalSection->OwningThread = NULL;
^
* Abstract optnone compiler attribute
GNU compiler doesn't support optnone attribute.
pal/src/exception/seh-unwind.cpp:449:77: warning: ‘optnone’ attribute directive ignored [-Wattributes]
* Set the aligned attribute for GNU compiler
* Make __rotl and __rotr functions portable
GNU compiler doesn't have an intrinsic for these. Open code them
using the provided implementation.
* Define deprecated attribute for gcc
* Add throw specifier for GCC
/usr/include/string.h:43:28: error: declaration of ‘void* memcpy(void*, const void*, size_t) throw ()’ has a different exception specifier
size_t __n) __THROW __nonnull ((1, 2));
Diffstat (limited to 'src/pal/src/exception/seh-unwind.cpp')
-rw-r--r-- | src/pal/src/exception/seh-unwind.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp index c62f975d4e..094036189c 100644 --- a/src/pal/src/exception/seh-unwind.cpp +++ b/src/pal/src/exception/seh-unwind.cpp @@ -444,7 +444,7 @@ Note: --*/ PAL_NORETURN __attribute__((noinline)) -__attribute__((optnone)) +__attribute__((NOOPT_ATTRIBUTE)) static void RtlpRaiseException(EXCEPTION_RECORD *ExceptionRecord, CONTEXT *ContextRecord) { |