summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSinan Kaya <41809318+franksinankaya@users.noreply.github.com>2019-05-30 04:35:37 -0400
committerJan Vorlicek <janvorli@microsoft.com>2019-05-30 10:35:37 +0200
commit41832cedbb2d46362239d2b272964a39ca37cd89 (patch)
treebba988e78374456f47a8803c112d4b017980ecae
parentd4fadf03b9964ba9a1bf96f5a2136c2c8f4f38fe (diff)
downloadcoreclr-41832cedbb2d46362239d2b272964a39ca37cd89.tar.gz
coreclr-41832cedbb2d46362239d2b272964a39ca37cd89.tar.bz2
coreclr-41832cedbb2d46362239d2b272964a39ca37cd89.zip
Frkaya/gcc fix 052919 (#24845)
* fix compilation with gcc7.x In file included from src/inc/sstring.h:1029:0, from src/inc/ex.h:19, from src/inc/stgpool.h:28, from src/inc/../md/inc/metamodel.h:18, from src/inc/../md/inc/metamodelro.h:19, from src/inc/metadata.h:17, from src/inc/corpriv.h:21, from src/md/compiler/stdafx.h:20, from src/md/compiler/mdutil.cpp:12: src/inc/sstring.inl: In member function ‘const WCHAR* SString::GetUnicode() const’: src/inc/sstring.inl:650:5: error: nonnull argument ‘this’ compared to NULL [-Werror=nonnull-compare] if (this == NULL) ^~ add version check * Use the abstracted version of __nodebug__ * cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C
-rw-r--r--configurecompiler.cmake3
-rw-r--r--src/jit/CMakeLists.txt2
-rw-r--r--src/pal/inc/rt/cpp/emmintrin.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/configurecompiler.cmake b/configurecompiler.cmake
index 5b6d76732c..0ad08eb667 100644
--- a/configurecompiler.cmake
+++ b/configurecompiler.cmake
@@ -509,6 +509,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(-Wno-unused-but-set-variable)
add_compile_options(-fms-extensions)
add_compile_options(-Wno-unknown-pragmas)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
+ add_compile_options(-Wno-nonnull-compare)
+ endif()
if (COMPILER_SUPPORTS_F_ALIGNED_NEW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new")
endif()
diff --git a/src/jit/CMakeLists.txt b/src/jit/CMakeLists.txt
index c246efa2ab..5e7c9c50d2 100644
--- a/src/jit/CMakeLists.txt
+++ b/src/jit/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories("./jitstd")
include_directories("../inc")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- add_compile_options(-fpermissive)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
add_compile_options(-Wno-error)
endif()
diff --git a/src/pal/inc/rt/cpp/emmintrin.h b/src/pal/inc/rt/cpp/emmintrin.h
index 14b72bec43..cd633a336a 100644
--- a/src/pal/inc/rt/cpp/emmintrin.h
+++ b/src/pal/inc/rt/cpp/emmintrin.h
@@ -40,7 +40,7 @@ typedef char __v16qi __attribute__((__vector_size__(16)));
/* Define the default attribute for the functions in this file. */
-#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse2")))
+#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, NODEBUG_ATTRIBUTE, __target__("sse2")))
/// \brief Performs a bitwise OR of two 128-bit integer vectors.
///