From: John Marino Date: Sat, 20 Oct 2012 00:06:27 +0000 (+0200) Subject: gcc47: Add __stack_chk_fail_local hack from gcc44 X-Git-Tag: v3.4.0rc~990^2~32 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5dd34005fbf5509736906dc6aa56d3e77f6a3dcb?hp=-c gcc47: Add __stack_chk_fail_local hack from gcc44 Like gcc44 before it, gcc47 is complaining about the hidden symbol of __stack_chk_fail_local. This patch swildner added to gcc44 will fix the issue, but it is a bit of a hack. A true fix may end up touching libc, rtld, and other bits. The original code is supposd to conserve a PIC register. Note that vendor-built GCCs on FreeBSD exhibit the same behavior and as a consequence only the patched base compiler can be used to build certain ports. This hack should be fixed properly as soon as convenient. --- 5dd34005fbf5509736906dc6aa56d3e77f6a3dcb diff --git a/contrib/gcc-4.7/README.DRAGONFLY b/contrib/gcc-4.7/README.DRAGONFLY index b33ac5c92c..ab3dbb51c3 100644 --- a/contrib/gcc-4.7/README.DRAGONFLY +++ b/contrib/gcc-4.7/README.DRAGONFLY @@ -29,6 +29,7 @@ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h The following files have been patched: ============================================================== gcc/c-family/c-format.c +gcc/config/i386/i386.c gcc/gcc.c gcc/ginclude/stddef.h gcc/tree-inline.c diff --git a/contrib/gcc-4.7/gcc/config/i386/i386.c b/contrib/gcc-4.7/gcc/config/i386/i386.c index c2c6cd02c7..852a687899 100644 --- a/contrib/gcc-4.7/gcc/config/i386/i386.c +++ b/contrib/gcc-4.7/gcc/config/i386/i386.c @@ -34794,9 +34794,13 @@ ix86_mangle_type (const_tree type) static tree ATTRIBUTE_UNUSED ix86_stack_protect_fail (void) { +#if 0 /* Still broken -- affects FreeBSD too */ return TARGET_64BIT ? default_external_stack_protect_fail () : default_hidden_stack_protect_fail (); +#else + return default_external_stack_protect_fail (); +#endif } /* Select a format to encode pointers in exception handling data. CODE