[PATCH, i386]: Define TARGET_CAN_SPLIT_STACK only when HAVE_GAS_CFI_PERSONALITY_DIRECTIVE is set

Ian Lance Taylor iant@google.com
Fri Feb 8 14:59:00 GMT 2013


On Fri, Feb 8, 2013 at 6:28 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Attached patch fixes several go testcase failures on CentOS 5.9 with
> ancient (GNU ld version 2.17.50.0.6-20.el5_8.3 20061020) binutils.
> These do not have CFI personality directive, so -fsplit-stack should
> not be used there.
>
> The compiler detects this situation through
> TARGET_SUPPORTS_SPLIT_STACK target hook, but the go driver
> nevertheless emits -fsplit-stack option, depending solely on the
> definition of TARGET_CAN_SPLIT_STACK. Forcing -fsplit-stack from the
> driver triggers the error from the above target hook.
>
> To fix this situation, attached patch declares TARGET_CAN_SPLIT_STACK
> only in case HAVE_GAS_CFI_PERSONALITY is set (please note that it
> should be *set*, not only *defined*).
>
> 2013-02-08  Uros Bizjak  <ubizjak@gmail.com>
>
>         * config/i386/gnu-user.h (TARGET_CAN_SPLIT_STACK): Define only
>         when HAVE_GAS_CFI_PERSONALITY_DIRECTIVE is set.
>         * config/i386/gnu-user64.h (TARGET_CAN_SPLIT_STACK): Ditto.
>
> Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
> {,-m32} on Fedora17 (GNU ld version 2.22.52.0.1-10.fc17 20120131) and
> CentOS 5.9 (GNU ld version 2.17.50.0.6-20.el5_8.3 20061020), where it
> fixes many go testsuite failures.
>
> Ian, although this is purely x86 patch, can you please approve it from
> go perspective (go is the only user of TARGET_CAN_SPLIT_STACK)?

This looks fine to me.

You could perhaps add a comment pointing to the corresponding test in
libgcc/config.host.

Thanks.

Ian



More information about the Gcc-patches mailing list