https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82037
--- Comment #7 from Dennis Clarke <dclarke at blastwave dot org> --- At this point I don't see what the real issue is here on powerpc64. The configuration stage runs fine but everything fails in stage1 because the wrong ELF class is being used. Really the entire compiler should be a 64-bit tool but have the ability to compile code with the option -m32 also. This is a Debian 8.8 system and I see no reason why this should fail over and over. deb8_ppc64$ date Tue Oct 3 23:28:41 GMT 2017 deb8_ppc64$ CC='gcc -m64' CXX='g++ -m64' \ > LD_RUN_PATH='/usr/local/lib:/usr/local/gcc7/lib' \ > ../gcc-7.2.0/configure --build=powerpc64-unknown-linux-gnu \ > --target=powerpc64-unknown-linux-gnu --host=powerpc64-unknown-linux-gnu \ > --enable-targets=powerpc-linux,powerpc64-linux --prefix=/usr/local/gcc7 \ > --disable-nls --enable-threads=posix --enable-shared \ > --with-cpu=default64 --enable-bootstrap \ > --enable-libstdcxx-debug --enable-libstdcxx-time=yes \ > --enable-__cxa_atexit --with-system-zlib --enable-objc-gc \ > --enable-multiarch --with-long-double-128 --enable-multilib \ > --enable-stage1-languages=c,c++ --enable-stage1-checking=misc \ > --enable-languages=ada,c,c++,fortran,go,lto,objc,obj-c++ \ > --with-pkgversion='genunix Tue Oct 3 23:28:41 GMT 2017' This config looks fine and fails in stage1 : . . . /usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/./gcc/xgcc -B/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/./gcc/ -B/usr/local/gcc7/powerpc64-unknown-linux-gnu/bin/ -B/usr/local/gcc7/powerpc64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc7/powerpc64-unknown-linux-gnu/include -isystem /usr/local/gcc7/powerpc64-unknown-linux-gnu/sys-include -O2 -g -O2 -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -mlong-double-128 -mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o 32/libgcc_s.so.1.tmp -g -O2 -m32 -B./ addsf3_s.o subsf3_s.o negsf2_s.o mulsf3_s.o divsf3_s.o eqsf2_s.o nesf2_s.o gesf2_s.o gtsf2_s.o lesf2_s.o ltsf2_s.o unordsf2_s.o fixsfsi_s.o floatsisf_s.o floatunsisf_s.o adddf3_s.o subdf3_s.o negdf2_s.o muldf3_s.o divdf3_s.o eqdf2_s.o nedf2_s.o gedf2_s.o gtdf2_s.o ledf2_s.o ltdf2_s.o unorddf2_s.o fixdfsi_s.o floatsidf_s.o floatunsidf_s.o extendsfdf2_s.o truncdfsf2_s.o _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulhc3_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divhc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _floatunditf_s.o _divdi3_s.o _moddi3_s.o _divmoddi4_s.o _udivdi3_s.o _umoddi3_s.o _udivmoddi4_s.o _udiv_w_sdiv_s.o ibm-ldouble_s.o tramp_s.o ppc64-fp_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f 32/libgcc_s.so && if [ -f 32/libgcc_s.so.1 ]; then mv -f 32/libgcc_s.so.1 32/libgcc_s.so.1.backup; else true; fi && mv 32/libgcc_s.so.1.tmp 32/libgcc_s.so.1 && (echo "/* GNU ld script"; echo " Use the shared library, but some functions are only in"; echo " the static library. */"; echo "GROUP ( libgcc_s.so.1 -lgcc )" ) > 32/libgcc_s.so /usr/bin/ld: /usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/./gcc/liblto_plugin.so: error loading plugin: /usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/./gcc/liblto_plugin.so: wrong ELF class: ELFCLASS64 collect2: error: ld returned 1 exit status gmake[5]: *** [Makefile:982: libgcc_s.so] Error 1 gmake[5]: Leaving directory '/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/powerpc64-unknown-linux-gnu/32/libgcc' gmake[4]: *** [Makefile:1198: multi-do] Error 1 gmake[4]: Leaving directory '/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/powerpc64-unknown-linux-gnu/libgcc' gmake[3]: *** [Makefile:125: all-multi] Error 2 gmake[3]: *** Waiting for unfinished jobs.... gmake[3]: Leaving directory '/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004/powerpc64-unknown-linux-gnu/libgcc' gmake[2]: *** [Makefile:20768: all-stage1-target-libgcc] Error 2 gmake[2]: Leaving directory '/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004' gmake[1]: *** [Makefile:26925: stage1-bubble] Error 2 gmake[1]: Leaving directory '/usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004' gmake: *** [Makefile:939: all] Error 2 deb8_ppc64$ pwd /usr/local/build/gcc-7.2.0_linux_3.16.0-4-powerpc64.004 deb8_ppc64$ cat stage_current stage1