https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643
--- Comment #12 from Khem Raj <raj.khem at gmail dot com> --- I would like to reopen this bug. As there is more information to explain this issue. This issue will happen if you first build cross binutils and add the installation path to PATH variable and then configure gcc to cross build for mips. All you need is cross assembler available in PATH when configuring gcc. If gcc configure script does not find assembler then many probes fail and it gets configured differently. I could see that when cross assembler is not in path then the resulting gcc is able to compile the sample program however when assembler is in PATH then the issue starts to show up. I am not sure how Andrew built his toolchain but it seems he is not adding binutils to the path before configuring cross gcc. Steps. configure and install cross binutils ( especially assembler ) Add the install path to PATH variable configure and compile cross gcc Try out the example ( it will cause the ICE as explained) btw it happens with gcc 4.8 as well as 4.9 in same fashion and I have verified that OE patches don't make any difference here. I could see it happen on latest FSF 4.9 branch see below is the diff between gcc/config.log between two cases explained above -gcc_cv_as='' +gcc_cv_as='/home/ubuntu/work/dizzy/build-pacexi3v2/tmp/sysroots/x86_64-linux/usr/bin/mipsel-rdk-linux/mipsel-rdk-linux-as' gcc_cv_ld='' gcc_cv_nm='' gcc_cv_objdump='' @@ -6067,7 +6205,7 @@ target='mipsel-rdk-linux-gnu' target_alias='mipsel-rdk-linux' target_cpu='mipsel' -target_cpu_default='MASK_SPLIT_ADDRESSES' +target_cpu_default='(MASK_SPLIT_ADDRESSES)|MASK_EXPLICIT_RELOCS' target_noncanonical='mipsel-rdk-linux' target_os='linux-gnu' target_subdir='mipsel-rdk-linux' @@ -6278,13 +6416,31 @@ #define HAVE_DLFCN_H 1 #define LT_OBJDIR ".libs/" #define PLUGIN_LD_SUFFIX "" +#define HAVE_GAS_BALIGN_AND_P2ALIGN 1 +#define HAVE_GAS_MAX_SKIP_P2ALIGN 1 +#define HAVE_GAS_WEAK 1 +#define HAVE_GAS_WEAKREF 1 #define HAVE_GNU_INDIRECT_FUNCTION 0 +#define HAVE_AS_LEB128 1 #define HAVE_GAS_CFI_DIRECTIVE 0 -#define HAVE_GAS_CFI_PERSONALITY_DIRECTIVE 0 -#define HAVE_GAS_CFI_SECTIONS_DIRECTIVE 0 -#define HAVE_GAS_SHF_MERGE 0 +#define HAVE_GAS_CFI_PERSONALITY_DIRECTIVE 1 +#define HAVE_GAS_CFI_SECTIONS_DIRECTIVE 1 +#define USE_AS_TRADITIONAL_FORMAT 1 +#define HAVE_GAS_SHF_MERGE 1 #define HAVE_COMDAT_GROUP 0 +#define HAVE_GAS_DISCRIMINATOR 1 +#define HAVE_AS_TLS 1 #define HAVE_LTO_PLUGIN 0 +#define HAVE_AS_NO_SHARED 1 +#define HAVE_AS_GNU_ATTRIBUTE 1 +#define HAVE_GAS_MICROMIPS 1 +#define HAVE_AS_DTPRELWORD 1 +#define HAVE_AS_DSPR1_MULT 1 +#define HAVE_AS_NAN 1 +#define HAVE_AS_GDWARF2_DEBUG_FLAG 1 +#define HAVE_AS_GSTABS_DEBUG_FLAG 1 +#define HAVE_AS_DEBUG_PREFIX_MAP 1 +#define HAVE_AS_LINE_ZERO 1 #define HAVE_LD_EH_FRAME_CIEV3 0 #define ENABLE_LTO 1