Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2015104175
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박우진
2020-10-12 20:48:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
44e640711937981d2906fce94be87d229707594b
44e64071
1 parent
f0b8043f
clang: add ARM CMSIS Macros and arm-none-eabi sanitizer
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
llvm-project/clang/lib/Basic/Targets/ARM.cpp
llvm-project/clang/lib/Driver/ToolChain.cpp
llvm-project/clang/lib/Basic/Targets/ARM.cpp
View file @
44e6407
...
...
@@ -619,7 +619,15 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts,
(
getTriple
().
getEnvironment
()
==
llvm
::
Triple
::
EABI
||
getTriple
().
getEnvironment
()
==
llvm
::
Triple
::
EABIHF
))
Builder
.
defineMacro
(
"__ELF__"
);
// pretend like we are ARM's Compiler which is based on LLVM
// this enable CMSIS to build without miodifications
Builder
.
defineMacro
(
"__ARMCC_VERSION"
,
"6010050"
);
// Define annoation macros
Builder
.
defineMacro
(
"__EDIVERT_ELEVATE"
,
"__asm volatile(
\"
push {r0}
\\
n
\\
t
\"
\"
mrs r0, apsr
\\
n
\\
t
\"
\"
push {r0}
\\
n
\\
t
\"
\"
mrs r0, control
\\
n
\\
t
\"
\"
tst r0, 1
\\
n
\\
t
\"
\"
it ne
\\
n
\\
t
\"
\"
svcne 254
\\
n
\\
t
\"
\"
pop {r0}
\\
n
\\
t
\"
\"
msr apsr, r0
\\
n
\\
t
\"
\"
pop {r0}
\\
n
\\
t
\"
:::
\"
r0
\"
,
\"
r1
\"
,
\"
r2
\"
,
\"
r3
\"
,
\"
r4
\"
,
\"
r5
\"
,
\"
r6
\"
,
\"
r7
\"
,
\"
r8
\"
,
\"
r9
\"
,
\"
r10
\"
,
\"
r11
\"
,
\"
r12
\"
,
\"
r13
\"
,
\"
r14
\"
,
\"
lr
\"
,
\"
memory
\"
);"
);
Builder
.
defineMacro
(
"__EDIVERT_DROP"
,
"__asm volatile(
\"
push{r0}
\\
n
\\
t
\"
\"
mrs r0, control
\\
n
\\
t
\"
\"
orr r0, 1
\\
n
\\
t
\"
\"
msr control, r0
\\
n
\\
t
\"
\"
pop {r0}
\\
n
\\
t
\"
:::
\"
r0
\"
,
\"
r1
\"
,
\"
r2
\"
,
\"
r3
\"
,
\"
r4
\"
,
\"
r5
\"
,
\"
r6
\"
,
\"
r7
\"
,
\"
r8
\"
,
\"
r9
\"
,
\"
r10
\"
,
\"
r11
\"
,
\"
r12
\"
,
\"
r13
\"
,
\"
r14
\"
,
\"
lr
\"
,
\"
memory
\"
);"
);
// Target properties.
Builder
.
defineMacro
(
"__REGISTER_PREFIX__"
,
""
);
...
...
llvm-project/clang/lib/Driver/ToolChain.cpp
View file @
44e6407
...
...
@@ -1032,6 +1032,16 @@ SanitizerMask ToolChain::getSupportedSanitizers() const {
getTriple
().
isAArch64
())
Res
|=
SanitizerKind
::
CFIICall
;
switch
(
getTriple
().
getArch
())
{
case
llvm
:
:
Triple
::
arm
:
case
llvm
:
:
Triple
::
thumb
:
if
(
getTriple
().
getOS
()
==
llvm
::
Triple
::
UnknownOS
&&
getTriple
().
getEnvironment
()
==
llvm
::
Triple
::
EABI
)
{
Res
|=
SanitizerKind
::
SafeStack
;
}
default
:
;
}
if
(
getTriple
().
getArch
()
==
llvm
::
Triple
::
x86_64
||
getTriple
().
isAArch64
()
||
getTriple
().
isRISCV
())
Res
|=
SanitizerKind
::
ShadowCallStack
;
...
...
Please
register
or
login
to post a comment