File tree 17 files changed +60
-5
lines changed
17 files changed +60
-5
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ set(x86_80_BIT_SOURCES
300
300
trunctfxf2.c
301
301
)
302
302
303
- if (NOT MSVC )
303
+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
304
304
set (x86_64_SOURCES
305
305
${GENERIC_SOURCES}
306
306
${GENERIC_TF_SOURCES}
@@ -316,7 +316,7 @@ if (NOT MSVC)
316
316
)
317
317
endif ()
318
318
319
- if (NOT ANDROID)
319
+ if (NOT ANDROID AND NOT MSVC )
320
320
set (x86_64_SOURCES
321
321
${x86_64_SOURCES}
322
322
${x86_80_BIT_SOURCES}
@@ -357,7 +357,7 @@ if (NOT MSVC)
357
357
i386/umoddi3.S
358
358
)
359
359
360
- if (NOT ANDROID)
360
+ if (NOT ANDROID AND NOT MSVC )
361
361
set (i386_SOURCES
362
362
${i386_SOURCES}
363
363
${x86_80_BIT_SOURCES}
@@ -372,7 +372,7 @@ if (NOT MSVC)
372
372
i386/chkstk.S
373
373
)
374
374
endif ()
375
- else () # MSVC
375
+ else () # MSVC assembler
376
376
# Use C versions of functions when building on MSVC
377
377
# MSVC's assembler takes Intel syntax, not AT&T syntax.
378
378
# Also use only MSVC compilable builtin implementations.
@@ -383,7 +383,13 @@ else () # MSVC
383
383
x86_64/floatdisf.c
384
384
)
385
385
set (i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES} )
386
- endif () # if (NOT MSVC)
386
+ endif ()
387
+
388
+ if (MSVC )
389
+ set_source_files_properties (
390
+ ${x86_64_SOURCES} ${i386_SOURCES}
391
+ PROPERTIES COMPILE_FLAGS "/GS- /Zl" )
392
+ endif ()
387
393
388
394
389
395
# 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