File tree Expand file tree Collapse file tree 17 files changed +60
-5
lines changed Expand file tree Collapse file tree 17 files changed +60
-5
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ set(x86_80_BIT_SOURCES
313
313
truncxfhf2.c
314
314
)
315
315
316
- if (NOT MSVC )
316
+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
317
317
set (x86_64_SOURCES
318
318
${GENERIC_SOURCES}
319
319
${GENERIC_TF_SOURCES}
@@ -329,7 +329,7 @@ if (NOT MSVC)
329
329
)
330
330
endif ()
331
331
332
- if (NOT ANDROID )
332
+ if (NOT ANDROID AND NOT MSVC )
333
333
set (x86_64_SOURCES
334
334
${x86_64_SOURCES}
335
335
${x86_80_BIT_SOURCES}
@@ -370,7 +370,7 @@ if (NOT MSVC)
370
370
i386/umoddi3.S
371
371
)
372
372
373
- if (NOT ANDROID )
373
+ if (NOT ANDROID AND NOT MSVC )
374
374
set (i386_SOURCES
375
375
${i386_SOURCES}
376
376
${x86_80_BIT_SOURCES}
@@ -385,7 +385,7 @@ if (NOT MSVC)
385
385
i386/chkstk.S
386
386
)
387
387
endif ()
388
- else () # MSVC
388
+ else () # MSVC assembler
389
389
# Use C versions of functions when building on MSVC
390
390
# MSVC's assembler takes Intel syntax, not AT&T syntax.
391
391
# Also use only MSVC compilable builtin implementations.
@@ -396,7 +396,13 @@ else () # MSVC
396
396
x86_64/floatdisf.c
397
397
)
398
398
set (i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES} )
399
- endif () # if (NOT MSVC)
399
+ endif ()
400
+
401
+ if (MSVC )
402
+ set_source_files_properties (
403
+ ${x86_64_SOURCES} ${i386_SOURCES}
404
+ PROPERTIES COMPILE_FLAGS "/GS- /Zl" )
405
+ endif ()
400
406
401
407
402
408
# 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
#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
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
// 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
// xf_float __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
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 __floatundisf(du_int a);
8
9
@@ -28,6 +29,7 @@ twop64: .quad 0x0000000000000000
28
29
#define TWOp64 twop64-0b(%ecx,%eax,8)
29
30
30
31
.text
32
+ WIN32_SAFE_SEH_HEADER
31
33
.balign 4
32
34
DEFINE_COMPILERRT_FUNCTION(__floatundisf)
33
35
movl 8(%esp), %eax
@@ -73,6 +75,7 @@ twelve:
73
75
#define STICKY sticky-0b(%ecx ,%eax ,8 )
74
76
75
77
.text
78
+ WIN32_SAFE_SEH_HEADER
76
79
.balign 4
77
80
DEFINE_COMPILERRT_FUNCTION(__floatundisf)
78
81
movl 8 (%esp ), %eax
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
// xf_float __floatundixf(du_int a);16
8
9
@@ -25,6 +26,7 @@ twop84:
25
26
#define REL_ADDR(_a) (_a)-0b(%eax )
26
27
27
28
.text
29
+ WIN32_SAFE_SEH_HEADER
28
30
.balign 4
29
31
DEFINE_COMPILERRT_FUNCTION(__floatundixf)
30
32
calll 0f
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 __lshrdi3(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(__lshrdi3)
22
24
movd 12 (%esp ), %xmm2 // Load count
@@ -37,6 +39,7 @@ END_COMPILERRT_FUNCTION(__lshrdi3)
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(__lshrdi3)
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 __moddi3(di_int a, di_int b);
8
9
21
22
#ifdef __i386__
22
23
23
24
.text
25
+ WIN32_SAFE_SEH_HEADER
24
26
.balign 4
25
27
DEFINE_COMPILERRT_FUNCTION(__moddi3)
26
28
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 __muldi3(di_int a, di_int b);
8
9
9
10
#ifdef __i386__
10
11
11
12
.text
13
+ WIN32_SAFE_SEH_HEADER
12
14
.balign 4
13
15
DEFINE_COMPILERRT_FUNCTION(__muldi3)
14
16
pushl %ebx
Original file line number Diff line number Diff line change
1
+ #ifdef _MSC_VER
2
+
3
+ #define WIN32_SAFE_SEH_HEADER \
4
+ .def @feat.00; \
5
+ .scl 3; \
6
+ .type 0; \
7
+ .endef; \
8
+ .globl @feat.00; \
9
+ .set @feat.00, 1;
10
+
11
+ #else
12
+
13
+ #define WIN32_SAFE_SEH_HEADER
14
+
15
+ #endif
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
// du_int __udivdi3(du_int a, du_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(__udivdi3)
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
// du_int __umoddi3(du_int a, du_int b);
8
9
21
22
#ifdef __i386__
22
23
23
24
.text
25
+ WIN32_SAFE_SEH_HEADER
24
26
.balign 4
25
27
DEFINE_COMPILERRT_FUNCTION(__umoddi3)
26
28
You can’t perform that action at this time.
0 commit comments