File tree 18 files changed +62
-5
lines changed
18 files changed +62
-5
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ set(x86_80_BIT_SOURCES
293
293
powixf2.c
294
294
)
295
295
296
- if (NOT MSVC )
296
+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
297
297
set (x86_64_SOURCES
298
298
${GENERIC_SOURCES}
299
299
${GENERIC_TF_SOURCES}
@@ -309,7 +309,7 @@ if (NOT MSVC)
309
309
)
310
310
endif ()
311
311
312
- if (NOT ANDROID)
312
+ if (NOT ANDROID AND NOT MSVC )
313
313
set (x86_64_SOURCES
314
314
${x86_64_SOURCES}
315
315
${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
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
// long double __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