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 @@ -300,7 +300,7 @@ set(x86_80_BIT_SOURCES
300300 trunctfxf2.c
301301)
302302
303- if (NOT MSVC )
303+ if (NOT CMAKE_ASM_COMPILER_ID MATCHES " MSVC" )
304304 set (x86_64_SOURCES
305305 ${GENERIC_SOURCES}
306306 ${GENERIC_TF_SOURCES}
@@ -316,7 +316,7 @@ if (NOT MSVC)
316316 )
317317 endif ()
318318
319- if (NOT ANDROID)
319+ if (NOT ANDROID AND NOT MSVC )
320320 set (x86_64_SOURCES
321321 ${x86_64_SOURCES}
322322 ${x86_80_BIT_SOURCES}
@@ -357,7 +357,7 @@ if (NOT MSVC)
357357 i386/umoddi3.S
358358 )
359359
360- if (NOT ANDROID)
360+ if (NOT ANDROID AND NOT MSVC )
361361 set (i386_SOURCES
362362 ${i386_SOURCES}
363363 ${x86_80_BIT_SOURCES}
@@ -372,7 +372,7 @@ if (NOT MSVC)
372372 i386/chkstk.S
373373 )
374374 endif ()
375- else () # MSVC
375+ else () # MSVC assembler
376376 # Use C versions of functions when building on MSVC
377377 # MSVC's assembler takes Intel syntax, not AT&T syntax.
378378 # Also use only MSVC compilable builtin implementations.
@@ -383,7 +383,13 @@ else () # MSVC
383383 x86_64/floatdisf.c
384384 )
385385 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 ()
387393
388394
389395# builtin support for Targets that have Arm state or have Thumb2
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// di_int __ashldi3(di_int input, int count);
89
1718#ifdef __SSE2__
1819
1920.text
21+ WIN32_SAFE_SEH_HEADER
2022.balign 4
2123DEFINE_COMPILERRT_FUNCTION(__ashldi3)
2224 movd 12 (%esp ), %xmm2 // Load count
@@ -37,6 +39,7 @@ END_COMPILERRT_FUNCTION(__ashldi3)
3739#else // Use GPRs instead of SSE2 instructions, if they aren't available.
3840
3941.text
42+ WIN32_SAFE_SEH_HEADER
4043.balign 4
4144DEFINE_COMPILERRT_FUNCTION(__ashldi3)
4245 movl 12 (%esp ), %ecx // Load count
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// di_int __ashrdi3(di_int input, int count);
89
910#ifdef __i386__
1011#ifdef __SSE2__
1112
1213.text
14+ WIN32_SAFE_SEH_HEADER
1315.balign 4
1416DEFINE_COMPILERRT_FUNCTION(__ashrdi3)
1517 movd 12 (%esp ), %xmm2 // Load count
@@ -47,6 +49,7 @@ END_COMPILERRT_FUNCTION(__ashrdi3)
4749#else // Use GPRs instead of SSE2 instructions, if they aren't available.
4850
4951.text
52+ WIN32_SAFE_SEH_HEADER
5053.balign 4
5154DEFINE_COMPILERRT_FUNCTION(__ashrdi3)
5255 movl 12 (%esp ), %ecx // Load count
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78#ifdef __i386__
89
1213// http://msdn.microsoft.com/en-us/library/ms648426.aspx
1314
1415.text
16+ WIN32_SAFE_SEH_HEADER
1517.balign 4
1618DEFINE_COMPILERRT_FUNCTION(_alloca) // _chkstk and _alloca are the same function
1719 push %ecx
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// di_int __divdi3(di_int a, di_int b);
89
2021#ifdef __i386__
2122
2223.text
24+ WIN32_SAFE_SEH_HEADER
2325.balign 4
2426DEFINE_COMPILERRT_FUNCTION(__divdi3)
2527
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// double __floatdidf(du_int a);
89
@@ -21,6 +22,7 @@ twop32:
2122#define REL_ADDR(_a) (_a)-0b(%eax )
2223
2324.text
25+ WIN32_SAFE_SEH_HEADER
2426.balign 4
2527DEFINE_COMPILERRT_FUNCTION(__floatdidf)
2628 cvtsi2sd 8 (%esp ), %xmm1
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// float __floatdisf(di_int a);
89
1617#ifdef __i386__
1718
1819.text
20+ WIN32_SAFE_SEH_HEADER
1921.balign 4
2022DEFINE_COMPILERRT_FUNCTION(__floatdisf)
2123#ifndef TRUST_CALLERS_USE_64_BIT_STORES
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// xf_float __floatdixf(di_int a);
89
1617// It can be turned off by defining the TRUST_CALLERS_USE_64_BIT_STORES macro.
1718
1819.text
20+ WIN32_SAFE_SEH_HEADER
1921.balign 4
2022DEFINE_COMPILERRT_FUNCTION(__floatdixf)
2123#ifndef TRUST_CALLERS_USE_64_BIT_STORES
Original file line number Diff line number Diff line change 1111//===----------------------------------------------------------------------===//
1212
1313#include "../assembly.h"
14+ #include "safeseh.h"
1415
1516// double __floatundidf(du_int a);
1617
@@ -33,6 +34,7 @@ twop84:
3334#define REL_ADDR(_a) (_a)-0b(%eax )
3435
3536.text
37+ WIN32_SAFE_SEH_HEADER
3638.balign 4
3739DEFINE_COMPILERRT_FUNCTION(__floatundidf)
3840 movss 8 (%esp ), %xmm1 // high 32 bits of a
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
55#include "../assembly.h"
6+ #include "safeseh.h"
67
78// float __floatundisf(du_int a);
89
@@ -28,6 +29,7 @@ twop64: .quad 0x0000000000000000
2829#define TWOp64 twop64-0b(%ecx,%eax,8)
2930
3031.text
32+ WIN32_SAFE_SEH_HEADER
3133.balign 4
3234DEFINE_COMPILERRT_FUNCTION(__floatundisf)
3335 movl 8(%esp), %eax
@@ -73,6 +75,7 @@ twelve:
7375#define STICKY sticky-0b(%ecx ,%eax ,8 )
7476
7577.text
78+ WIN32_SAFE_SEH_HEADER
7679.balign 4
7780DEFINE_COMPILERRT_FUNCTION(__floatundisf)
7881 movl 8 (%esp ), %eax
You can’t perform that action at this time.
0 commit comments