Re: [Mingw-w64-public] [PATCH] crt: Build the SEH inline assembly with clang 7
在 2018/8/15 3:43, Martin Storsjö 写道: > Clang got support for the .rva assembler directive soon before > the clang 7.0 release branch was made. > > This breaks use of mingw-w64 with older SVN snapshot versions of > clang 7, if building with SEH enabled. However, most such users > probably build with DWARF exception handling instead of SEH, since > clang-bootstrapped environments have been missing other bits for > SEH until recently. > > Signed-off-by: Martin Storsjö > --- > Deduplicated the ifdef. > --- > mingw-w64-crt/crt/crtexe.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > Looks good to me. -- Best regards, LH_Mouse -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] crt: Build the SEH inline assembly with clang 7
Clang got support for the .rva assembler directive soon before the clang 7.0 release branch was made. This breaks use of mingw-w64 with older SVN snapshot versions of clang 7, if building with SEH enabled. However, most such users probably build with DWARF exception handling instead of SEH, since clang-bootstrapped environments have been missing other bits for SEH until recently. Signed-off-by: Martin Storsjö --- Deduplicated the ifdef. --- mingw-w64-crt/crt/crtexe.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index 91f3b5a..5f72f16 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/crtexe.c @@ -21,6 +21,10 @@ #include #include +#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7) +#define SEH_INLINE_ASM +#endif + #ifndef __winitenv extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv); #define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv)) @@ -171,7 +175,7 @@ int WinMainCRTStartup (void); int WinMainCRTStartup (void) { int ret = 255; -#if defined(__SEH__) && !defined(__clang__) +#ifdef SEH_INLINE_ASM asm ("\t.l_startw:\n" "\t.seh_handler __C_specific_handler, @except\n" "\t.seh_handlerdata\n" @@ -183,7 +187,7 @@ int WinMainCRTStartup (void) mingw_app_type = 1; __security_init_cookie (); ret = __tmainCRTStartup (); -#if defined(__SEH__) && !defined(__clang__) +#ifdef SEH_INLINE_ASM asm ("\tnop\n" "\t.l_endw: nop\n"); #endif @@ -199,7 +203,7 @@ int __mingw_init_ehandler (void); int mainCRTStartup (void) { int ret = 255; -#if defined(__SEH__) && !defined(__clang__) +#ifdef SEH_INLINE_ASM asm ("\t.l_start:\n" "\t.seh_handler __C_specific_handler, @except\n" "\t.seh_handlerdata\n" @@ -211,7 +215,7 @@ int mainCRTStartup (void) mingw_app_type = 0; __security_init_cookie (); ret = __tmainCRTStartup (); -#if defined(__SEH__) && !defined(__clang__) +#ifdef SEH_INLINE_ASM asm ("\tnop\n" "\t.l_end: nop\n"); #endif -- 2.7.4 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] crt: Build the SEH inline assembly with clang 7
Patch is ok. Thanks, Kai We might could introduce a helper macro in _mingw_mac.h for it? 2018-08-14 13:55 GMT+02:00 Liu Hao : > 在 2018-08-14 19:21, Martin Storsjö 写道: >> Clang got support for the .rva assembler directive soon before >> the clang 7.0 release branch was made. >> >> This breaks use of mingw-w64 with older SVN snapshot versions of >> clang 7, if building with SEH enabled. However, most such users >> probably build with DWARF exception handling instead of SEH, since >> clang-bootstrapped environments have been missing other bits for >> SEH until recently. >> >> Signed-off-by: Martin Storsjö >> --- >> mingw-w64-crt/crt/crtexe.c | 8 >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> > > This patch looks good to me. > > > > -- > Best regards, > LH_Mouse > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] crt: Build the SEH inline assembly with clang 7
Clang got support for the .rva assembler directive soon before the clang 7.0 release branch was made. This breaks use of mingw-w64 with older SVN snapshot versions of clang 7, if building with SEH enabled. However, most such users probably build with DWARF exception handling instead of SEH, since clang-bootstrapped environments have been missing other bits for SEH until recently. Signed-off-by: Martin Storsjö --- mingw-w64-crt/crt/crtexe.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index 91f3b5a..ab20509 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/crtexe.c @@ -171,7 +171,7 @@ int WinMainCRTStartup (void); int WinMainCRTStartup (void) { int ret = 255; -#if defined(__SEH__) && !defined(__clang__) +#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7) asm ("\t.l_startw:\n" "\t.seh_handler __C_specific_handler, @except\n" "\t.seh_handlerdata\n" @@ -183,7 +183,7 @@ int WinMainCRTStartup (void) mingw_app_type = 1; __security_init_cookie (); ret = __tmainCRTStartup (); -#if defined(__SEH__) && !defined(__clang__) +#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7) asm ("\tnop\n" "\t.l_endw: nop\n"); #endif @@ -199,7 +199,7 @@ int __mingw_init_ehandler (void); int mainCRTStartup (void) { int ret = 255; -#if defined(__SEH__) && !defined(__clang__) +#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7) asm ("\t.l_start:\n" "\t.seh_handler __C_specific_handler, @except\n" "\t.seh_handlerdata\n" @@ -211,7 +211,7 @@ int mainCRTStartup (void) mingw_app_type = 0; __security_init_cookie (); ret = __tmainCRTStartup (); -#if defined(__SEH__) && !defined(__clang__) +#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7) asm ("\tnop\n" "\t.l_end: nop\n"); #endif -- 2.7.4 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public