問題如下:
/bin/sh ../../../gcc-4.8.2/libgcc/../mkinstalldirs ../.././gcc; /usr/bin/install -c -m 644 ./libgcc_s.so.1 ../.././gcc/libgcc_s.so.1; rm -f ../.././gcc/libgcc_s.so; /usr/bin/install -c -m 644 ./libgcc_s.so ../.././gcc/libgcc_s.so /bin/sh: line 1: 22364 Segmentation fault /usr/bin/install -c -m 644 ./libgcc_s.so.1 ../.././gcc/libgcc_s.so.1 make[4]: *** [Makefile:1059: install-shared] Segmentation fault make[4]: Leaving directory '/run/media/nemo/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libgcc' make[3]: *** [Makefile:108: all] Segmentation fault make[3]: Leaving directory '/run/media/nemo/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libgcc' /bin/sh: line 15: 22290 Segmentation fault make "DESTDIR=" "RPATH_ENVVAR=LD_LIBRARY_PATH" "TARGET_SUBDIR=armv7l-unknown-linux-gnueabihf" "bindir=/opt/gcc-4.8.2/bin" "datadir=/opt/gcc-4.8.2/share" "exec_prefix=/opt/gcc-4.8.2" "includedir=/opt/gcc-4.8.2/include" "datarootdir=/opt/gcc-4.8.2/share" "docdir=/opt/gcc-4.8.2/share/doc/" "infodir=/opt/gcc-4.8.2/share/info" "pdfdir=/opt/gcc-4.8.2/share/doc/" "htmldir=/opt/gcc-4.8.2/share/doc/" "libdir=/opt/gcc-4.8.2/lib" "libexecdir=/opt/gcc-4.8.2/libexec" "lispdir=" "localstatedir=/opt/gcc-4.8.2/var" "mandir=/opt/gcc-4.8.2/share/man" "oldincludedir=/usr/include" "prefix=/opt/gcc-4.8.2" "sbindir=/opt/gcc-4.8.2/sbin" "sharedstatedir=/opt/gcc-4.8.2/com" "sysconfdir=/opt/gcc-4.8.2/etc" "tooldir=/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf" "build_tooldir=/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf" "target_alias=armv7l-unknown-linux-gnueabihf" "AWK=gawk" "BISON=bison" "CC_FOR_BUILD=gcc" "CFLAGS_FOR_BUILD=-g -O2" "CXX_FOR_BUILD=g++" "EXPECT=expect" "FLEX=flex" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS_FOR_BUILD=" "LEX=flex" "M4=m4" "MAKE=make" "RUNTEST=runtest" "RUNTESTFLAGS=" "SED=/bin/sed" "SHELL=/bin/sh" "YACC=bison -y" "`echo 'ADAFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "ADA_CFLAGS=" "AR_FLAGS=rc" "`echo 'BOOT_ADAFLAGS=-gnatpg' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "BOOT_CFLAGS=-g -O2" "BOOT_LDFLAGS=" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCXXFLAGS=-g -O2 -fno-implicit-templates" "STAGE1_CHECKING=--enable-checking=yes,types" "STAGE1_LANGUAGES=c,c++,lto" "GNATBIND=no" "GNATMAKE=no" "AR_FOR_TARGET=ar" "AS_FOR_TARGET=as" "CC_FOR_TARGET=/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/./gcc/xgcc -B/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/./gcc/" "CFLAGS_FOR_TARGET=-g -O2" "CPPFLAGS_FOR_TARGET=" "CXXFLAGS_FOR_TARGET=-g -O2 -D_GNU_SOURCE" "DLLTOOL_FOR_TARGET=dlltool" "FLAGS_FOR_TARGET=-B/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/bin/ -B/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/lib/ -isystem /opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/include -isystem /opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/sys-include" "GCJ_FOR_TARGET=" "GFORTRAN_FOR_TARGET=" "GOC_FOR_TARGET=" "GOCFLAGS_FOR_TARGET=-O2 -g" "LD_FOR_TARGET=ld" "LIPO_FOR_TARGET=lipo" "LDFLAGS_FOR_TARGET=" "LIBCFLAGS_FOR_TARGET=-g -O2" "LIBCXXFLAGS_FOR_TARGET=-g -O2 -D_GNU_SOURCE -fno-implicit-templates" "NM_FOR_TARGET=nm" "OBJDUMP_FOR_TARGET=objdump" "RANLIB_FOR_TARGET=ranlib" "READELF_FOR_TARGET=readelf" "STRIP_FOR_TARGET=strip" "WINDRES_FOR_TARGET=windres" "WINDMC_FOR_TARGET=windmc" "BUILD_CONFIG=bootstrap-debug" "`echo 'LANGUAGES=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "LEAN=false" "STAGE1_CFLAGS=-g" "STAGE1_CXXFLAGS=-g" "STAGE1_TFLAGS=" "STAGE2_CFLAGS=-g -O2 -gtoggle" "STAGE2_CXXFLAGS=-g -O2 -gtoggle" "STAGE2_TFLAGS=" "STAGE3_CFLAGS=-g -O2" "STAGE3_CXXFLAGS=-g -O2" "STAGE3_TFLAGS=" "STAGE4_CFLAGS=-g -O2" "STAGE4_CXXFLAGS=-g -O2" "STAGE4_TFLAGS=" "STAGEprofile_CFLAGS=-g -O2 -gtoggle -fprofile-generate" "STAGEprofile_CXXFLAGS=-g -O2 -gtoggle -fprofile-generate" "STAGEprofile_TFLAGS=" "STAGEfeedback_CFLAGS=-g -O2 -fprofile-use" "STAGEfeedback_CXXFLAGS=-g -O2 -fprofile-use" "STAGEfeedback_TFLAGS=" "CXX_FOR_TARGET=/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/./gcc/xg++ -B/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/./gcc/ -nostdinc++ -nostdinc++ -I/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libstdc++-v3/include/armv7l-unknown-linux-gnueabihf -I/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libstdc++-v3/include -I/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-4.8.2/libstdc++-v3/libsupc++ -I/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-4.8.2/libstdc++-v3/include/backward -I/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-4.8.2/libstdc++-v3/testsuite/util -L/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libstdc++-v3/src -L/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-build/armv7l-unknown-linux-gnueabihf/libstdc++-v3/src/.libs" "TFLAGS=" "CONFIG_SHELL=/bin/sh" "MAKEINFO=/media/sdcard/maemo/Downloads/gcc-4.8.2/gcc-4.8.2/missing makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000" CFLAGS="-g -O2" CXXFLAGS="-g -O2 -D_GNU_SOURCE" LIBCFLAGS="-g -O2" CFLAGS_FOR_TARGET="-g -O2" CXXFLAGS_FOR_TARGET="-g -O2 -D_GNU_SOURCE" LIBCFLAGS_FOR_TARGET="-g -O2" 'AR=$(AR_FOR_TARGET)' 'AS=$r/./gcc/as' 'CC=$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $(TFLAGS)' 'CFLAGS=$(CFLAGS_FOR_TARGET)' 'CXX=$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $(TFLAGS)' 'CXXFLAGS=$(CXXFLAGS_FOR_TARGET)' 'DLLTOOL=$(DLLTOOL_FOR_TARGET)' 'GCJ=$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $(TFLAGS)' 'GFORTRAN=$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $(TFLAGS)' 'GOC=$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $(TFLAGS)' 'GOCFLAGS=$(GOCFLAGS_FOR_TARGET)' 'LD=$r/./gcc/collect-ld' 'LDFLAGS=$(LDFLAGS_FOR_TARGET)' 'LIBCFLAGS=$(LIBCFLAGS_FOR_TARGET)' 'LIBCXXFLAGS=$(LIBCXXFLAGS_FOR_TARGET)' 'NM=$r/./gcc/nm' 'OBJDUMP=$(OBJDUMP_FOR_TARGET)' 'RANLIB=$(RANLIB_FOR_TARGET)' 'READELF=$(READELF_FOR_TARGET)' 'WINDRES=$(WINDRES_FOR_TARGET)' 'WINDMC=$(WINDMC_FOR_TARGET)' 'XGCC_FLAGS_FOR_TARGET=-B/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/bin/ -B/opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/lib/ -isystem /opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/include -isystem /opt/gcc-4.8.2/armv7l-unknown-linux-gnueabihf/sys-include ' "TFLAGS=$TFLAGS" TFLAGS="" all make[2]: *** [Makefile:16825: all-stage1-target-libgcc] Error 139 make[2]: Leaving directory '/run/media/nemo/maemo/Downloads/gcc-4.8.2/gcc-build' make[1]: *** [Makefile:20710: stage1-bubble] Error 2 make[1]: Leaving directory '/run/media/nemo/maemo/Downloads/gcc-4.8.2/gcc-build' make: *** [Makefile:891: all] Error 2
開啟core dump並且使用gdb查看問題
$ gdb -core armv7l-unknown-linux-gnueabihf/libgcc/core.420 Core was generated by `/usr/bin/install -c -m 644 ./libgcc_s.so.1 ../.././gcc/libgcc_s.so.1'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000f60c in ?? () (gdb) bt #0 0x0000f60c in ?? () #1 0x401a58e0 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?)
司徒這才發現/usr/bin/install是使用busybox,最後手動編譯安裝coreutils即可解決這個問題(/usr/bin/install記得symlink到/usr/local/bin/install)