This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google/gcc-4_7] Fix regression - SUBTARGET_EXTRA_SPECS overridden by LINUX_GRTE_EXTRA_SPECS
- From: Han Shen(ææ) <shenhan at google dot com>
- To: Jing Yu <jingyu at google dot com>, gcc-patches at gcc dot gnu dot org
- Cc: Diego Novillo <dnovillo at google dot com>, Rong Xu <xur at google dot com>, Guozhi Wei <carrot at google dot com>, Ahmad Sharif <asharif at google dot com>
- Date: Wed, 15 Aug 2012 15:11:13 -0700
- Subject: Re: [google/gcc-4_7] Fix regression - SUBTARGET_EXTRA_SPECS overridden by LINUX_GRTE_EXTRA_SPECS
- References: <CACkGtrj21FfQJYNnW9jskJu0Uiy6w1EZyhgdxgp1gyeQi36ZEw@mail.gmail.com>
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