Age | Commit message (Collapse) | Author | Files | Lines |
|
* Fix PIE options
We were missing passing the -pie linker option. That means that while we
were compiling our code as position independent, the executables
(not shared libraries) were not marked as position independent and
ASLR was not applied to them. They were always loaded to fixed addresses.
This change adds the missing -pie option and also replaces all the individual
settings of -fPIE / -fPIC on the targets we build by a centralized setting
of CMAKE_POSITION_INDEPENDENT_CODE variable that causes cmake to add the
appropriate compiler options everywhere.
* Fix native parts of coreclr tests build
The native parts of the tests are not built using the root CMakeLists.txt
so I am moving enabling the position independent code to configurecompiler.cmake
Change-Id: Ieafff8984ec23e5fdb00fb0c2fb017e53afbce88
|
|
* 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.
|
|
|
|
* 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
|
|
|
|
|
|
|
|
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
|
|
Currently only enabled for arm64
|
|
CoreCLR uses the CoreDisTools library for utilities like GCStress
and SuperPMI. To aid these utilities, this change adds the
CoreDisTools header to CoreCLR repository.
This cleans up duplication of type/enum definitions in CoreDisTools
and CoreCLR sources, and provides for a cleaner way to use the
interface.
The understanding here is that CoreCLR defines the required
CoreDisTools interface, and will publish the header into the
cmake-install directory.
Any repository can pick up this header and supply implementations
for the imported functions. [Currently the only implementation
is the one that uses LLVM disassembler in the LLILC tree].
Two other changes:
1) Define TypeDefs for exported function types in cordistools.h
to avoid duplicating the signature in importing code.
2) Move to the libcoredistools version 1.0.1, and use the new
interface in disassembler.cpp
|
|
Export the CorJitHost interface to the build directory, so that
alternate JITs can use it.
This change is necessary to fix LLILC build break.
|
|
Added a SOS DAC interface (ISOSDacInterface4::GetClrNotification) to get the exception
notification arguments instead of using the GetLastExceptionInformation function from the lldb
sosplugin that depends on coreclr symbols being present.
On the coreclr side, the clr notification arguments are saved in a global variable that is DAC
accessible. A critical section was added to protect this global variable while the special
exception is raised.
Setting the internal COMPlus_DebugBreakOnAssert environment variable causes 3 or 4 breaks in
the debugger with no reason. It was breaking in the function that was determining whether it
should break. I was using COMPlus_BreakOnEELoad=2 to break after coreclr was loaded and initialized
to set managed breakpoints and on a debug build it generates an assert (on release just a DebugBreak).
|
|
ICorDebugInfo is almost standalone data structure.
This puts ICorDebugInfo into a new cordebuginfo.h.
This new header file is just included in corinfo.h
This way we could share this debug data structure
with ObjectWriter/LLILC by simply including this header.
|
|
Enabling profiling on Unix/OS X
|
|
|
|
For Unix targeting CoreRT, this will provide platform specific unwind
info which is a dwarf format.
Unlike window’s UNWIND_INFO, we won’t encode the format within RyuJit
since it is not only complex/error-prone but also needs to be adjusted
depending on platforms.
Instead, CFI (call frame information) pseudo instructions are encoded,
which will be passed to CoreRT/ObjectWriter which will translate
them to directly emit CFI directives to LLVM MC stream to establish
frames and layout eh_frame section.
A jit flag is used to dynamically dispatch either Windows’s unwind
blob or this CFI instruction table. No JIT/EE interface change is needed
since the API already expects an opaque blob.
Initially when I looked at what Clang does, the prologue and the
sequence of CFI emissions are a bit different than Windows.
Since we will emit the same sequence of code with the same runtime that
we define, I assume this is unnecessary – I’ve verified the CFI sequence
here can work correctly with libunwind.
Basically we need only 3 operations – push reg is a combination of 1 and
2 below.
1. Allocation – increase stack frame. Normally subtract esp in x64.
2. Store – Copy a (callee save) register to stack (memory)
3. SaveFP – Set frame pointer register
Since Windows operation is based on the relative value (all offsets,
etc are computed from the current point), I also use the similar form of
CFI instructions.
So, mostly one window’s code corresponds to two CFIs – we might optimize
this by aggregating allocation, but I’d like to keep the current
syntax/semantic same as Windows.
This results in a very simple transformation on par with Windows.
|
|
- Move the build type check to unix only.
- Remove the global fPIC compiler option and add it as compile flags for libcorguids @ src/inc/CMakeLists.txt
- Use add_compiler_options instead of add_definitions.
|
|
The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library
independently by clients outside the CoreClr tree.
The GcInfo library uses some custom data-structures (ex: ArrayList)
and includes some utility libraries (ex: UtilCode) which pull in several other
headers with considerable unrelated content. Rather than porting all the
utility code to suite other clients, the STANDALONE_BUILD switch can be used
to include only the minimal set of headers specific to GcInfo encodings.
Clients of STANDALONE_BUILD will likely use standard library
implementations of data-structures like ArrayList, HashMap etc., in place
of the custom implementation currently used by GcInfoEncoder.
Rather than spew the GcInfoEnoder code with
#ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special
header GcInfoUtil.h in STANDALONE_BUILD mode. GcInfoUtil.h is expected to
supply the interface/implementation for the data-structures and utilities
used by GcInfoEncoder. This header should be provided by the clients doing
the standalone build in their source tree.
|
|
This change fixes the following warnings:
1) Assignment in a condition should be wrapped in ()
2) Priority of && / || should be indicated by parentheses.
3) Unknown #pragma optimize ifdefed out for non MSVC
4) Unused functions deleted or put under #ifdef
5) Extra tokens warning disabling moved to the CMakeLists.txt in the src/inc
6) Self assignment of a member or local variable
7) Assigning ~0 to a bitfield member that was just 8 bit wide
It also fixes a bug in the STRESS_LOGxx macro invocation in exceptionhandling.cpp and
stackwalk.cpp related to recent adding the DBG_ADDR macro usage. This macro expanded
a single parameter into two expressions to extract high / low 32 bits separately.
But the STRESS_LOGxx parameters are passed to the StressLog::LogMsg method as follows:
(void*)(size_t)(data1)
That means that the expanded pair x, y would be inserted as data 1 and that leads
to ignoring the x due to the comma operator.
|
|
Adds headers:
- opcode.def and openum.h to describe the MSIL opcodes.
|
|
Add new nuget package that can be developed against. Also modify the cmake lists of a few directories to add in missing PDBs.
|
|
This avoids a variable expansion and avoids the chances of a typo being
introduced in variable names.
|
|
It avoids extra separation on semicolons if there are any and skips a
variable expansion.
|
|
Arguments to else() are always confusing and endfunction only needs to
match the first argument.
|
|
[tfs-changeset: 1407945]
|