[google/gcc-4_7] Fix regression - SUBTARGET_EXTRA_SPECS overridden by LINUX_GRTE_EXTRA_SPECS

Han Shen(沈涵) shenhan@google.com
Wed Aug 15 22:11:00 GMT 2012


Hi Jing, ping?

On Mon, Aug 13, 2012 at 10:58 AM, Han Shen(沈涵) <shenhan@google.com> wrote:
> Hi, the google/gcc-4_7 fails to linking anything (on x86-generic), by
> looking into specs file, it seems that 'link_emulation' section is
> missing in specs.
>
> The problem is in config/i386/linux.h, SUBTARGET_EXTRA_SPECS (which is
> not empty for chrome x86-generic) is overridden by
> "LINUX_GRTE_EXTRA_SPECS".
>
> My fix is to prepend LINUX_GRTE_EXTRA_SPECS to SUBTARGET_EXTRA_SPECS in linux.h
>
> Jing, could you take a look at this?
>
> --
> Han Shen
>
> 2012-08-13 Han Shen  <shenhan@google.com>
>     * gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Compute
>     new value of LINUX_GRTE_EXTRA_SPECS by pre-pending LINUX_GRTE_EXTRA_SPECS
>     to its origin value.
>     * gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS_STR): Add
>     new MACRO to hold value of SUBTARET_EXTRA_SPECS so that
>     SUBTARET_EXTRA_SPECS could be replaced later in gnu-user.h
>
> --- a/gcc/config/i386/gnu-user.h
> +++ b/gcc/config/i386/gnu-user.h
> @@ -92,11 +92,14 @@ along with GCC; see the file COPYING3.  If not see
>  #define ASM_SPEC \
>    "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
>
> -#undef  SUBTARGET_EXTRA_SPECS
> -#define SUBTARGET_EXTRA_SPECS \
> +#undef  SUBTARGET_EXTRA_SPECS_STR
> +#define SUBTARGET_EXTRA_SPECS_STR \
>    { "link_emulation", GNU_USER_LINK_EMULATION },\
>    { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
>
> +#undef  SUBTARGET_EXTRA_SPECS
> +#define SUBTARGET_EXTRA_SPECS SUBTARGET_EXTRA_SPECS_STR
> +
>  #undef LINK_SPEC
>  #define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
>    %{!shared: \
> --- a/gcc/config/i386/linux.h
> +++ b/gcc/config/i386/linux.h
> @@ -32,5 +32,11 @@ along with GCC; see the file COPYING3.  If not see
>  #endif
>
>  #undef  SUBTARGET_EXTRA_SPECS
> +#ifndef SUBTARGET_EXTRA_SPECS_STR
>  #define SUBTARGET_EXTRA_SPECS \
>    LINUX_GRTE_EXTRA_SPECS
> +#else
> +#define SUBTARGET_EXTRA_SPECS \
> +  LINUX_GRTE_EXTRA_SPECS \
> +  SUBTARGET_EXTRA_SPECS_STR
> +#endif



-- 
Han Shen |  Software Engineer |  shenhan@google.com |  +1-650-440-3330



More information about the Gcc-patches mailing list