Build wine with gcc-4.3 and ssp

Marcus Meissner marcus at jet.franken.de
Fri Jan 2 16:29:00 CST 2009


On Fri, Jan 02, 2009 at 11:14:52PM +0100, Stefan Reimer wrote:
> 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 */

Hmm,

why does this work for me on openSUSE then?

The line:
gcc -c -I. -I. -I../include -I../include    -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -W
type-limits -Wpointer-arith  -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funw
ind-tables -fasynchronous-unwind-tables -g  -o preloader.o preloader.c

works fine here. Are you passing in -fPIC?

Ciao, marcus



More information about the wine-devel mailing list