summaryrefslogtreecommitdiff
path: root/src/ilasm/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2019-06-07Do not delete polymorphic objects without a virtual destructor (#23705)Omair Majid1-1/+1
SEI CERT C++ Coding Standard says: > Do not delete an object of derived class type through a pointer to its > base class type that has a non-virtual destructor. Instead, the base > class should be defined with a virtual destructor. Deleting an object > through a pointer to a type without a virtual destructor results in > undefined behavior. See https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor Clang generally warns about this, but we disabled the warning via -Wno-delete-non-virtual-dtor. This commit re-enables the warning and fixes up all the code that hits the warning.
2019-06-05Use Modern CMake features instead of CMAKE_CXX_FLAGS (#24861)Jeremy Koritzinsky1-1/+1
* Convert C++ standard settings and warning options from CMAKE_<LANG>_FLAGS to Modern CMake isms. * More $<COMPILE_LANGUAGE> generator expressions instead of CMAKE_CXX_FLAGS. * Use $<COMPILE_LANGUAGE:CXX> for all -fpermissive usage * Fix generator expression that generates multiple flags * Fix invalid use of CMAKE_CXX_FLAGS instead of CMAKE_C_FLAGS. * Treat AppleClang as though it is Clang (match pre-3.0 behavior). * Update our build system to understand that AppleClang is distinct from Clang and remove CMP0025 policy setting. * PR Feedback.
2019-05-04Minor tweaks for gcc (#24391)Adeel Mujahid1-2/+1
* Fix a consistency check condition Following error is reported by gcc 8 with debug configuration: > error: enum constant in boolean context [-Werror=int-in-bool-context] * Apply -Wno-register only to CXX flags gcc 8 errors out like this: ``` [ 96%] Building C object src/ilasm/CMakeFiles/ilasm.dir/__/__/version.c.o cc1: error: command line option -Wno-register is valid for C++/ObjC++ but not for C [-Werror] cc1: all warnings being treated as errors src/ilasm/CMakeFiles/ilasm.dir/build.make:254: recipe for target 'src/ilasm/CMakeFiles/ilasm.dir/__/__/version.c.o' failed make[2]: *** [src/ilasm/CMakeFiles/ilasm.dir/__/__/version.c.o] Error 1 CMakeFiles/Makefile2:5710: recipe for target 'src/ilasm/CMakeFiles/ilasm.dir/all' failed make[1]: *** [src/ilasm/CMakeFiles/ilasm.dir/all] Error 2 ``` * Remove extra parantheses from variable declaration gcc 8 reports: > error: unnecessary parentheses in declaration of m_HashedModules [-Werror=parentheses] * Use macro instead of const in C gcc throws: > error: variably modified collatorsPerOption at file scope UCollator* collatorsPerOption[CompareOptionsMask + 1]; * Cast to uintptr_t before (32-bit) DWORD gcc error was: > error: cast from LPCWSTR {aka const char16_t*} to DWORD {aka unsigned int} loses precision [-fpermissive]
2019-02-26GCC compatibility fixes #7 (#22810)Sinan Kaya1-1/+1
* Use thread_local for thread local storage on non MSVC targets * Use local copy of visitor rather than function parameter * Remove extra class qualifier * Replace hex number representation in ASM files * Reorder STDAPI and DLLEXPORT * Suppress conversion Suppress warning during hash add casting * Remove anonymous struct src/vm/codeversion.h:112:16: warning: ‘struct NativeCodeVersion::<anonymous union>::SyntheticStorage’ invalid; an anonymous union can only have non-static data members [-fpermissive] struct SyntheticStorage * Remove class declaration Remove extra class declaration * Remove extern C * Add implicit paranthesis src/vm/amd64/virtualcallstubcpu.hpp:735:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses] resolveInit.toMiss1 = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss1)+1) & 0xFF; ^ src/vm/amd64/virtualcallstubcpu.hpp:741:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses] resolveInit.toMiss2 = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss2)+1) & 0xFF; Add parenthesis src/vm/dataimage.cpp:631:55: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] previousRvaInfo->rva == rvaInfo->rva && previousRvaInfo->size >= rvaInfo->size Add parenthesis src/debug/daccess/daccess.cpp:6871:29: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] _ASSERTE(peFile == NULL && reflectionModule != NULL || peFile != NULL && reflectionModule == NULL); Add parenthesis src/vm/dataimage.cpp:631:57: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] (previousRvaInfo->rva == rvaInfo->rva) && (previousRvaInfo->size >= rvaInfo->size) * Initialize member 1 src/ilasm/method.cpp:35:36: warning: operation on ‘((Method*)this)->Method::m_ulColumns[0]’ may be undefined [-Wsequence-point] m_ulColumns[0]=m_ulColumns[0]=0; * Remove unknown compiler option * Abstract DLLEXPORT
2019-02-22More GNUC Fixes (#22687)Sinan Kaya1-1/+1
* Replace __sync_swap with __atomic_exchange_n __sync_swap() is a clang specific function. * Remove multiline comment * Add paranthesis around sum src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses] UINT32 aligned = *totalBytes + 3 & ~3; * Define __int64 * Define windows types for tests * Remove undefined has_builtin defines and define alloca and inline for GNUC * Remove __clang__ where possible * Add implicit casting to help compiler find WCHAR* variant src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’ return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName()); ^ In file included from src/inc/sstring.h:1082: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/binder/../vm/util.hpp:19, from src/binder/../vm/common.h:110, from src/binder/assembly.cpp:14: src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T) inline SString::SString(void *buffer, COUNT_T size) ^ src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T) inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count) ^ src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*) inline SString::SString(tagLiteral dummytag, const WCHAR *literal) ^ src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*) inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal) ^ src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*) inline SString::SString(tagLiteral dummytag, const ASCII *literal) * Reorder DLLEXPORT and STDAPI GNUC wants extern "C" <attribute> format. * Abstract __FUNCSIG__ * Abstract __debugbreak() * Move common compiler options out of clang and add Wno-unused-value * Add paranthesis around || and && src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] (!chosen_power2) && (i < free_space_count)); * Set Wno-delete-non-virtual-dtor for CXX files only * Don't warn on unterminated endif labels * Suppress unused functions * Use 0x syntax rather than h syntax on GNU asm files * Correct constructor call directly src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly this->basic_string::basic_string(_Ptr, c_len(_Ptr)); * Suppress NULL used in arithmetic warnings
2018-09-25Add header files to ildasm, ilasm vcxproj (#20052)Jacek Blaszczynski1-1/+17
2016-09-07Fix strict aliasing violation from conditional typedef of wchar_t by ↵kchoi1-6/+5
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
2016-06-02Fix Details for ILAsm/ILDasm/ClrJit BinariesKyungwoo Lee1-0/+6
Fixes https://github.com/dotnet/coreclr/issues/5408
2016-04-18enable build of cross target components.Rahul Kumar1-1/+1
Currently only enabled for arm64
2016-04-16Cleanup VCRuntime140.dll dependency from native componentsGaurav Khanna1-1/+0
2016-03-22Strip symbols on release builds into separate binariesMike McLaughlin1-4/+1
Issue #3669 Created a common cmake strip_symbols function that all the modules and programs use to strip the symbols out of the main into a separate .dbg (Linux) or .dSYM (OSX) file. Added an install_clr cmake function to encapsulate the install logic. Changed all the library module cmake install lines from a TARGETS to a FILES one. The TARGETS based install directives caused cmake to relink the binary and copy the unstripped version to the install path. Left the all programs like corerun or ildasm as TARGETS installs because on OSX FILES type installs don't get marked as executable. Need to use "get_property(strip_source_file TARGET ${targetName} PROPERTY LOCATION)" for the older versions of cmake and "set(strip_source_file $<TARGET_FILE:${targetName}>)" on newer versions (v3 or greater).
2016-01-22NetBSD: Don't link with -ldl for dlopen(3) on NetBSDKamil Rytarowski1-3/+3
NAME dlopen, dlclose, dlsym, dlvsym, dladdr, dlctl, dlerror - dynamic link interface LIBRARY (These functions are not in a library. They are included in every dynamically linked program automatically.) SYNOPSIS #include <dlfcn.h> void * dlopen(const char *path, int mode);
2016-01-14Enable the fPIE compiler option for executables in the coreclr repo on Unix ↵Sergiy Kuryata1-0/+4
platforms
2016-01-01Enable ilasm round trip test for xPlatformsKyungwoo Lee1-0/+2
1. Enable CLRTest.Execute.Bash.targets similar to CLRTest.Execute.Batch.targets. 2. _IlasmSwitches uses '-' instead of '/' 3. Disable optimization on the prebuilt asmparse.c due to https://github.com/dotnet/coreclr/issues/2305
2015-12-11Enable ILASM for *nixKyungwoo Lee1-11/+36
This enables ILASM for x-platforms. 1. Added a bunch of warning disable options mostly due to this prebuilt asmparse.cpp 2. Create a separte entry point "main" to pass WCHAR arguments. 3. PDB (CorSymWriter) part is disabled. 4. Converting/embedding resource file to binary is disabled. 5. jkotas kindly provided a code for IsTextUnicode which is unavailable on CoreCLR.
2015-12-09Enable ILASM for WindowsKyungwoo Lee1-0/+52
This enables ILASM/mscorpe on CoreCLR for Windows. 1. Fusion/StrongName(Full Sign) dependencies are removed since these are not CoreCLR features. 2. mscorpe is statically built/linked to ilasm. 3. asmparse.c is auto-generated by an internal version of yacc so I added it under prebuilt directory for now. Will create an issue so that we can build it using a standard tool like bison.