File tree Expand file tree Collapse file tree 18 files changed +62
-5
lines changed Expand file tree Collapse file tree 18 files changed +62
-5
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ set(x86_80_BIT_SOURCES
303
303
powixf2.c
304
304
)
305
305
306
- if (NOT MSVC )
306
+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
307
307
set (x86_64_SOURCES
308
308
${GENERIC_SOURCES}
309
309
${GENERIC_TF_SOURCES}
@@ -314,7 +314,7 @@ if (NOT MSVC)
314
314
x86_64/floatundisf.S
315
315
)
316
316
317
- if (NOT ANDROID )
317
+ if (NOT ANDROID AND NOT MSVC )
318
318
set (x86_64_SOURCES
319
319
${x86_64_SOURCES}
320
320
${x86_80_BIT_SOURCES}
@@ -351,7 +351,7 @@ if (NOT MSVC)
351
351
i386/umoddi3.S
352
352
)
353
353
354
- if (NOT ANDROID )
354
+ if (NOT ANDROID AND NOT MSVC )
355
355
set (i386_SOURCES
356
356
${i386_SOURCES}
357
357
${x86_80_BIT_SOURCES}
@@ -367,7 +367,7 @@ if (NOT MSVC)
367
367
i386/chkstk2.S
368
368
)
369
369
endif ()
370
- else () # MSVC
370
+ else () # MSVC assembler
371
371
# Use C versions of functions when building on MSVC
372
372
# MSVC's assembler takes Intel syntax, not AT&T syntax.
373
373
# Also use only MSVC compilable builtin implementations.
@@ -378,7 +378,13 @@ else () # MSVC
378
378
x86_64/floatdisf.c
379
379
)
380
380
set (i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES} )
381
- endif () # if (NOT MSVC)
381
+ endif ()
382
+
383
+ if (MSVC )
384
+ set_source_files_properties (
385
+ ${x86_64_SOURCES} ${i386_SOURCES}
386
+ PROPERTIES COMPILE_FLAGS "/GS- /Zl" )
387
+ endif ()
382
388
383
389
384
390
# builtin support for Targets that have Arm state or have Thumb2
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// di_int __ashldi3(di_int input, int count);
8
9
17
18
#ifdef __SSE2__
18
19
19
20
.text
21
+ WIN32_SAFE_SEH_HEADER
20
22
.balign 4
21
23
DEFINE_COMPILERRT_FUNCTION(__ashldi3)
22
24
movd 12 (%esp ), %xmm2 // Load count
@@ -37,6 +39,7 @@ END_COMPILERRT_FUNCTION(__ashldi3)
37
39
#else // Use GPRs instead of SSE2 instructions, if they aren't available.
38
40
39
41
.text
42
+ WIN32_SAFE_SEH_HEADER
40
43
.balign 4
41
44
DEFINE_COMPILERRT_FUNCTION(__ashldi3)
42
45
movl 12 (%esp ), %ecx // Load count
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// di_int __ashrdi3(di_int input, int count);
8
9
9
10
#ifdef __i386__
10
11
#ifdef __SSE2__
11
12
12
13
.text
14
+ WIN32_SAFE_SEH_HEADER
13
15
.balign 4
14
16
DEFINE_COMPILERRT_FUNCTION(__ashrdi3)
15
17
movd 12 (%esp ), %xmm2 // Load count
@@ -47,6 +49,7 @@ END_COMPILERRT_FUNCTION(__ashrdi3)
47
49
#else // Use GPRs instead of SSE2 instructions, if they aren't available.
48
50
49
51
.text
52
+ WIN32_SAFE_SEH_HEADER
50
53
.balign 4
51
54
DEFINE_COMPILERRT_FUNCTION(__ashrdi3)
52
55
movl 12 (%esp ), %ecx // Load count
Original file line number Diff line number Diff line change 3
3
// SPDX - License - Identifier: Apache - 2 . 0 WITH LLVM - exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// _chkstk routine
8
9
// This routine is windows specific
11
12
#ifdef __i386__
12
13
13
14
.text
15
+ WIN32_SAFE_SEH_HEADER
14
16
.balign 4
15
17
DEFINE_COMPILERRT_FUNCTION(__chkstk_ms)
16
18
push % ecx
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
#ifdef __i386__
8
9
12
13
// http://msdn.microsoft.com/en-us/library/ms648426.aspx
13
14
14
15
.text
16
+ WIN32_SAFE_SEH_HEADER
15
17
.balign 4
16
18
DEFINE_COMPILERRT_FUNCTION(_alloca) // _chkstk and _alloca are the same function
17
19
DEFINE_COMPILERRT_FUNCTION(__chkstk)
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// di_int __divdi3(di_int a, di_int b);
8
9
20
21
#ifdef __i386__
21
22
22
23
.text
24
+ WIN32_SAFE_SEH_HEADER
23
25
.balign 4
24
26
DEFINE_COMPILERRT_FUNCTION(__divdi3)
25
27
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// double __floatdidf(du_int a);
8
9
@@ -21,6 +22,7 @@ twop32:
21
22
#define REL_ADDR(_a) (_a)-0b(%eax )
22
23
23
24
.text
25
+ WIN32_SAFE_SEH_HEADER
24
26
.balign 4
25
27
DEFINE_COMPILERRT_FUNCTION(__floatdidf)
26
28
cvtsi2sd 8 (%esp ), %xmm1
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// float __floatdisf(di_int a);
8
9
16
17
#ifdef __i386__
17
18
18
19
.text
20
+ WIN32_SAFE_SEH_HEADER
19
21
.balign 4
20
22
DEFINE_COMPILERRT_FUNCTION(__floatdisf)
21
23
#ifndef TRUST_CALLERS_USE_64_BIT_STORES
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
5
#include "../assembly.h"
6
+ #include "safeseh.h"
6
7
7
8
// long double __floatdixf(di_int a);
8
9
16
17
// It can be turned off by defining the TRUST_CALLERS_USE_64_BIT_STORES macro.
17
18
18
19
.text
20
+ WIN32_SAFE_SEH_HEADER
19
21
.balign 4
20
22
DEFINE_COMPILERRT_FUNCTION(__floatdixf)
21
23
#ifndef TRUST_CALLERS_USE_64_BIT_STORES
Original file line number Diff line number Diff line change 11
11
//===----------------------------------------------------------------------===//
12
12
13
13
#include "../assembly.h"
14
+ #include "safeseh.h"
14
15
15
16
// double __floatundidf(du_int a);
16
17
@@ -33,6 +34,7 @@ twop84:
33
34
#define REL_ADDR(_a) (_a)-0b(%eax )
34
35
35
36
.text
37
+ WIN32_SAFE_SEH_HEADER
36
38
.balign 4
37
39
DEFINE_COMPILERRT_FUNCTION(__floatundidf)
38
40
movss 8 (%esp ), %xmm1 // high 32 bits of a
You can’t perform that action at this time.
0 commit comments