Add SafeStack support to rustc
Adds support for LLVM [SafeStack] which provides backward edge control flow protection by separating the stack into two parts: data which is only accessed in provable safe ways is allocated on the normal stack (the "safe stack") and all other data is placed in a separate allocation (the "unsafe stack"). SafeStack support is enabled by passing `-Zsanitizer=safestack`. [SafeStack]: https://clang.llvm.org/docs/SafeStack.html
This commit is contained in:
parent
d22314e0f5
commit
019d75b44e
14 changed files with 71 additions and 10 deletions
|
@ -96,6 +96,7 @@ enum LLVMRustAttribute {
|
|||
AllocatedPointer = 38,
|
||||
AllocAlign = 39,
|
||||
#endif
|
||||
SanitizeSafeStack = 40,
|
||||
};
|
||||
|
||||
typedef struct OpaqueRustString *RustStringRef;
|
||||
|
|
|
@ -234,6 +234,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
|||
case AllocAlign:
|
||||
return Attribute::AllocAlign;
|
||||
#endif
|
||||
case SanitizeSafeStack:
|
||||
return Attribute::SafeStack;
|
||||
}
|
||||
report_fatal_error("bad AttributeKind");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue