[PATCH 1/3] include: Emit assembly function size when compiling without MinGW.

Rémi Bernon rbernon at codeweavers.com
Mon Nov 30 03:30:19 CST 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

This series restores Valgrind support in Wine, including stacktraces
support in all modules, be PE or ELF.

It requires however some Valgrind patches that I submitted upstream, as
linked in PATCH 3.

 include/wine/asm.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/wine/asm.h b/include/wine/asm.h
index b4b6fb50eb8..7975e377341 100644
--- a/include/wine/asm.h
+++ b/include/wine/asm.h
@@ -65,6 +65,14 @@
 # define __ASM_FUNC_TYPE(name) ".type " name ", at function"
 #endif
 
+#ifdef _WIN32
+# define __ASM_FUNC_SIZE(name) ""
+#elif defined(__APPLE__)
+# define __ASM_FUNC_SIZE(name) ""
+#else
+# define __ASM_FUNC_SIZE(name) ".size " name ", . - " name
+#endif
+
 #if !defined(__GNUC__) && !defined(__clang__)
 # define __ASM_BLOCK_BEGIN(name) void __asm_dummy_##name(void) {
 # define __ASM_BLOCK_END         }
@@ -76,7 +84,7 @@
 #define __ASM_DEFINE_FUNC(name,code)  \
     __ASM_BLOCK_BEGIN(__LINE__) \
     asm(".text\n\t.align 4\n\t.globl " name "\n\t" __ASM_FUNC_TYPE(name) __ASM_SEH("\n\t.seh_proc " name) "\n" name ":\n\t" \
-        __ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") ); \
+        __ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") "\n\t" __ASM_FUNC_SIZE(name) "\n" ); \
     __ASM_BLOCK_END
 
 #define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code)
-- 
2.29.2




More information about the wine-devel mailing list