This repository was archived by the owner on Dec 20, 2019. It is now read-only.
File tree 18 files changed +59
-3
lines changed
18 files changed +59
-3
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ set(x86_ARCH_SOURCES
240
240
powixf2.c
241
241
)
242
242
243
- if (NOT MSVC )
243
+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
244
244
set (x86_64_SOURCES
245
245
${GENERIC_TF_SOURCES}
246
246
x86_64/floatdidf.c
@@ -286,7 +286,7 @@ if (NOT MSVC)
286
286
i386/chkstk2.S
287
287
)
288
288
endif ()
289
- else () # MSVC
289
+ else () # MSVC assembler
290
290
# Use C versions of functions when building on MSVC
291
291
# MSVC's assembler takes Intel syntax, not AT&T syntax.
292
292
# Also use only MSVC compilable builtin implementations.
@@ -298,12 +298,17 @@ else () # MSVC
298
298
)
299
299
set (x86_64h_SOURCES ${x86_64_SOURCES} )
300
300
set (i386_SOURCES ${GENERIC_SOURCES} )
301
- endif () # if (NOT MSVC)
301
+ endif ()
302
302
303
303
set (x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES} )
304
304
set (x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES} )
305
305
set (i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES} )
306
306
set (i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES} )
307
+ if (MSVC )
308
+ set_source_files_properties (
309
+ ${x86_64h_SOURCES} ${x86_64_SOURCES} ${i386_SOURCES} ${i686_SOURCES}
310
+ PROPERTIES COMPILE_FLAGS "/GS- /Zl" )
311
+ endif ()
307
312
308
313
set (arm_SOURCES
309
314
arm/bswapdi2.S
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 __floatundidf(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
// 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
// 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