mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 20:18:22 +00:00
[CRT]
- Add __C_specific_handler stub - Add aliases for C++ code on amd64 builds - Fix fmod symbol - Merge .CRT section into .data on amd64 - remove an old hack svn path=/trunk/; revision=53342
This commit is contained in:
parent
a69bcd8bff
commit
7f5e1ecb95
8 changed files with 89 additions and 35 deletions
|
@ -377,6 +377,7 @@ if(ARCH MATCHES i386)
|
||||||
elseif(ARCH MATCHES amd64)
|
elseif(ARCH MATCHES amd64)
|
||||||
list(APPEND CRT_SOURCE
|
list(APPEND CRT_SOURCE
|
||||||
except/amd64/seh.s
|
except/amd64/seh.s
|
||||||
|
except/amd64/ehandler.c
|
||||||
float/amd64/clearfp.S
|
float/amd64/clearfp.S
|
||||||
float/i386/cntrlfp.c
|
float/i386/cntrlfp.c
|
||||||
float/amd64/fpreset.S
|
float/amd64/fpreset.S
|
||||||
|
@ -401,6 +402,10 @@ elseif(ARCH MATCHES amd64)
|
||||||
math/amd64/sqrtf.S
|
math/amd64/sqrtf.S
|
||||||
math/amd64/tan.S
|
math/amd64/tan.S
|
||||||
setjmp/amd64/setjmp.s)
|
setjmp/amd64/setjmp.s)
|
||||||
|
if(MSVC)
|
||||||
|
list(APPEND CRT_SOURCE
|
||||||
|
except/amd64/cpp.s)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ARCH MATCHES i386)
|
if(NOT ARCH MATCHES i386)
|
||||||
|
|
|
@ -98,6 +98,7 @@
|
||||||
<directory name="amd64">
|
<directory name="amd64">
|
||||||
<file>seh.s</file>
|
<file>seh.s</file>
|
||||||
<file>chkstk_asm.s</file>
|
<file>chkstk_asm.s</file>
|
||||||
|
<file>ehandler.c</file>
|
||||||
</directory>
|
</directory>
|
||||||
</if>
|
</if>
|
||||||
<file>xcptfil.c</file>
|
<file>xcptfil.c</file>
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
<file>sinh.c</file>
|
<file>sinh.c</file>
|
||||||
<file>tanh.c</file>
|
<file>tanh.c</file>
|
||||||
<file>powl.c</file>
|
<file>powl.c</file>
|
||||||
|
|
||||||
<directory name="ieee754">
|
<directory name="ieee754">
|
||||||
<file>j0_y0.c</file>
|
<file>j0_y0.c</file>
|
||||||
<file>j1_y1.c</file>
|
<file>j1_y1.c</file>
|
||||||
|
|
53
reactos/lib/sdk/crt/except/amd64/cpp.s
Normal file
53
reactos/lib/sdk/crt/except/amd64/cpp.s
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
|
||||||
|
|
||||||
|
#include <asm.inc>
|
||||||
|
|
||||||
|
.code64
|
||||||
|
.align 4
|
||||||
|
|
||||||
|
MACRO(START_VTABLE, shortname, cxxname)
|
||||||
|
EXTERN shortname&_rtti:PROC
|
||||||
|
EXTERN MSVCRT_&shortname&_vector_dtor:PROC
|
||||||
|
.double shortname&_rtti
|
||||||
|
PUBLIC MSVCRT_&shortname&_vtable
|
||||||
|
MSVCRT_&shortname&_vtable:
|
||||||
|
PUBLIC &cxxname
|
||||||
|
&cxxname:
|
||||||
|
.double MSVCRT_&shortname&_vector_dtor
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
MACRO(DEFINE_EXCEPTION_VTABLE, shortname, cxxname)
|
||||||
|
START_VTABLE shortname, cxxname
|
||||||
|
EXTERN MSVCRT_what_exception:PROC
|
||||||
|
.double MSVCRT_what_exception
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
START_VTABLE type_info, __dummyname_type_info
|
||||||
|
DEFINE_EXCEPTION_VTABLE exception, ??_7exception@@6B@
|
||||||
|
DEFINE_EXCEPTION_VTABLE bad_typeid, ??_7bad_typeid@@6B@
|
||||||
|
DEFINE_EXCEPTION_VTABLE bad_cast, ??_7bad_cast@@6B@
|
||||||
|
DEFINE_EXCEPTION_VTABLE __non_rtti_object, ??_7__non_rtti_object@@6B@
|
||||||
|
|
||||||
|
|
||||||
|
MACRO(DEFINE_ALIAS, alias, orig)
|
||||||
|
EXTERN &orig:ABS
|
||||||
|
ALIAS <&alias> = <&orig>
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
DEFINE_ALIAS ??3@YAXPAX@Z, MSVCRT_operator_delete
|
||||||
|
DEFINE_ALIAS ??_U@YAPAXI@Z, MSVCRT_operator_new
|
||||||
|
DEFINE_ALIAS ??_V@YAXPAX@Z, MSVCRT_operator_delete
|
||||||
|
DEFINE_ALIAS ??2@YAPAXI@Z, MSVCRT_operator_new
|
||||||
|
DEFINE_ALIAS ?_query_new_handler@@YAP6AHI@ZXZ, MSVCRT__query_new_handler
|
||||||
|
DEFINE_ALIAS ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z, MSVCRT__set_new_handler
|
||||||
|
DEFINE_ALIAS ?set_new_handler@@YAP6AXXZP6AXXZ@Z, MSVCRT_set_new_handler
|
||||||
|
DEFINE_ALIAS ?_query_new_mode@@YAHXZ, MSVCRT__query_new_mode
|
||||||
|
DEFINE_ALIAS ?_set_new_mode@@YAHH@Z, MSVCRT__set_new_mode
|
||||||
|
DEFINE_ALIAS ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z, MSVCRT__set_se_translator
|
||||||
|
DEFINE_ALIAS ?set_terminate@@YAP6AXXZP6AXXZ@Z, MSVCRT_set_terminate
|
||||||
|
DEFINE_ALIAS ?set_unexpected@@YAP6AXXZP6AXXZ@Z, MSVCRT_set_unexpected
|
||||||
|
DEFINE_ALIAS ?terminate@@YAXXZ, MSVCRT_terminate
|
||||||
|
DEFINE_ALIAS ?unexpected@@YAXXZ, MSVCRT_unexpected
|
||||||
|
|
||||||
|
END
|
||||||
|
|
17
reactos/lib/sdk/crt/except/amd64/ehandler.c
Normal file
17
reactos/lib/sdk/crt/except/amd64/ehandler.c
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
#include <precomp.h>
|
||||||
|
|
||||||
|
|
||||||
|
_CRTIMP
|
||||||
|
EXCEPTION_DISPOSITION
|
||||||
|
__cdecl
|
||||||
|
__C_specific_handler(
|
||||||
|
struct _EXCEPTION_RECORD *_ExceptionRecord,
|
||||||
|
void *_EstablisherFrame,
|
||||||
|
struct _CONTEXT *_ContextRecord,
|
||||||
|
struct _DISPATCHER_CONTEXT *_DispatcherContext)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
/* CODE **********************************************************************/
|
/* CODE **********************************************************************/
|
||||||
.code64
|
.code64
|
||||||
|
|
||||||
PUBLIC _fmod
|
PUBLIC fmod
|
||||||
_fmod:
|
fmod:
|
||||||
UNIMPLEMENTED fmod
|
UNIMPLEMENTED fmod
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,12 @@
|
||||||
#include <sect_attribs.h>
|
#include <sect_attribs.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#ifdef _M_AMD64
|
||||||
|
#pragma comment(linker, "/merge:.CRT=.data")
|
||||||
|
#else
|
||||||
#pragma comment(linker, "/merge:.CRT=.rdata")
|
#pragma comment(linker, "/merge:.CRT=.rdata")
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (__cdecl *_PVFV)(void);
|
typedef void (__cdecl *_PVFV)(void);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@
|
||||||
|
|
||||||
int _fltused;
|
int _fltused;
|
||||||
|
|
||||||
|
int __mingw_init_ehandler (void)
|
||||||
|
{
|
||||||
|
/* Nothing to do */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
__do_global_dtors (void)
|
__do_global_dtors (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,35 +10,3 @@
|
||||||
otherwise
|
otherwise
|
||||||
we do tls cleanup in runtime and _CRT_MT has value 2. */
|
we do tls cleanup in runtime and _CRT_MT has value 2. */
|
||||||
int _CRT_MT = 2;
|
int _CRT_MT = 2;
|
||||||
|
|
||||||
// HACK around broken imports from libmingwex, until RosBE64 is updated
|
|
||||||
#ifdef _M_AMD64
|
|
||||||
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int __mingwthr_key_dtor (DWORD key, void (*dtor)(void *));
|
|
||||||
int __mingwthr_remove_key_dtor (DWORD key);
|
|
||||||
|
|
||||||
extern int ___w64_mingwthr_remove_key_dtor (DWORD key);
|
|
||||||
extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
|
|
||||||
|
|
||||||
int
|
|
||||||
__mingwthr_remove_key_dtor (DWORD key)
|
|
||||||
{
|
|
||||||
return ___w64_mingwthr_remove_key_dtor (key);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
__mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
|
|
||||||
{
|
|
||||||
if (dtor)
|
|
||||||
return ___w64_mingwthr_add_key_dtor (key, dtor);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue