Build wine with gcc-4.3 and ssp

Stefan Reimer lists at startux.de
Fri Jan 2 16:14:52 CST 2009


Hi,
to build wine using gcc 4.3 with enabled ssp (stack-smashing-protector)
the following patch must be applied to loader/preloader.c

see gcc source ./gcc/config/i386/i386.c around line 24391

/* For 32-bit code we can save PIC register setup by using
   __stack_chk_fail_local hidden function instead of calling
   __stack_chk_fail directly.  64-bit code doesn't need to setup any PIC
register, so it is better to call __stack_chk_fail directly.  */

Patch:

diff --git a/loader/preloader.c b/loader/preloader.c
index 5fcb974..1143972 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -163,6 +163,7 @@ void __bb_init_func(void) { return; }

 /* similar to the above but for -fstack-protector */
 void *__stack_chk_guard = 0;
+void __stack_chk_fail_local(void) { return; }
 void __stack_chk_fail(void) { return; }

 /* data for setting up the glibc-style thread-local storage in %gs */








More information about the wine-patches mailing list