diff options
author | kchoi <code.kchoi@gmail.com> | 2016-09-07 14:12:22 -0700 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-09-07 23:12:22 +0200 |
commit | 4149bd2070e0a8beec6dedb238e6fd832a39611b (patch) | |
tree | 7aa9401597ad87d4d1d902643439af1614458b99 /src/ilasm | |
parent | 09133905fce3b541702044b6d2bbe942a6b40155 (diff) | |
download | coreclr-4149bd2070e0a8beec6dedb238e6fd832a39611b.tar.gz coreclr-4149bd2070e0a8beec6dedb238e6fd832a39611b.tar.bz2 coreclr-4149bd2070e0a8beec6dedb238e6fd832a39611b.zip |
Fix strict aliasing violation from conditional typedef of wchar_t by building entire project as C++ for Unix (#6801)
Enable building CoreCLR as C++ project on Unix
This series of patches fixes the strict aliasing violation from
the conditional typedef of wchar_t in src/pal/inc/pal_char16.h:40
* rename c files to cpp
* modify all cmake files to change .c files to .cpp
* apply c++ linkage to templates
Diffstat (limited to 'src/ilasm')
-rw-r--r-- | src/ilasm/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/ilasm/prebuilt/asmparse.cpp (renamed from src/ilasm/prebuilt/asmparse.c) | 0 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ilasm/CMakeLists.txt b/src/ilasm/CMakeLists.txt index 34ec7997c4..9e99d02bb2 100644 --- a/src/ilasm/CMakeLists.txt +++ b/src/ilasm/CMakeLists.txt @@ -22,25 +22,23 @@ set(ILASM_SOURCES asmman.cpp main.cpp assembler.cpp - prebuilt/asmparse.c + prebuilt/asmparse.cpp ) if(WIN32) set(ILASM_RESOURCES Native.rc) add_definitions(-DFX_VER_INTERNALNAME_STR=ilasm.exe) endif(WIN32) -set_source_files_properties( prebuilt/asmparse.c PROPERTIES LANGUAGE CXX ) if(CLR_CMAKE_PLATFORM_UNIX) - add_compile_options(-x c++) - # Need generate a right form of asmparse.c to avoid the following options. + # Need generate a right form of asmparse.cpp to avoid the following options. # Clang also produces a bad-codegen on this prebuilt file with optimization. # https://github.com/dotnet/coreclr/issues/2305 add_compile_options(-Wno-delete-non-virtual-dtor) add_compile_options(-Wno-deprecated-register) add_compile_options(-Wno-array-bounds) add_compile_options(-Wno-unused-label) - set_source_files_properties( prebuilt/asmparse.c PROPERTIES COMPILE_FLAGS -O0 ) + set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" ) endif(CLR_CMAKE_PLATFORM_UNIX) _add_executable(ilasm @@ -82,4 +80,5 @@ else() ) endif(CLR_CMAKE_PLATFORM_UNIX) -install_clr(ilasm)
\ No newline at end of file +install_clr(ilasm) + diff --git a/src/ilasm/prebuilt/asmparse.c b/src/ilasm/prebuilt/asmparse.cpp index 71b31a5ed6..71b31a5ed6 100644 --- a/src/ilasm/prebuilt/asmparse.c +++ b/src/ilasm/prebuilt/asmparse.cpp |