Hi, the google/gcc-main fails to linking anything (on x86-generic chromeos).
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 This fix was submitted to google/gcc-4_7 and had gone thorough tests for past weeks. Tested by crosstool-validate.py --crosstool_ver=v16 --gcc_dir=`pwd` --testers=crosstool Jing, could you take a look at this? -- Han Shen 2012-09-13 Han Shen <shen...@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 diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h index 98d0a25..ba120b8 100644 --- a/gcc/config/i386/gnu-user.h +++ b/gcc/config/i386/gnu-user.h @@ -92,10 +92,12 @@ 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} \ diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index ade524c..61d5c68 100644 --- 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