出错信息如下: gcc -mabi=n32 -nostdlib -nostartfiles -o /mnt/xgstage0/tmp/xgstage0/build/elf/sprof -Wl,-dynamic-linker=/tools/lib/ld.so.1 -Wl,-z,relro /mnt/xgstage0/tmp/xgstage0/build/csu/crt1.o /mnt/xgstage0/tmp/xgstage0/build/csu/crti.o `gcc -mabi=n32 --print-file-name=crtbegin.o` /mnt/xgstage0/tmp/xgstage0/build/elf/sprof.o /mnt/xgstage0/tmp/xgstage0/build/dlfcn/libdl.so.2 -Wl,-rpath-link=/mnt/xgstage0/tmp/xgstage0/build:/mnt/xgstage0/tmp/xgstage0/build/math:/mnt/xgstage0/tmp/xgstage0/build/elf:/mnt/xgstage0/tmp/xgstage0/build/dlfcn:/mnt/xgstage0/tmp/xgstage0/build/nss:/mnt/xgstage0/tmp/xgstage0/build/nis:/mnt/xgstage0/tmp/xgstage0/build/rt:/mnt/xgstage0/tmp/xgstage0/build/resolv:/mnt/xgstage0/tmp/xgstage0/build/crypt:/mnt/xgstage0/tmp/xgstage0/build/nptl /mnt/xgstage0/tmp/xgstage0/build/libc.so.6 /mnt/xgstage0/tmp/xgstage0/build/libc_nonshared.a -lgcc -Wl,--as-needed -lgcc_s -Wl,--no-as-needed `gcc -mabi=n32 --print-file-name=crtend.o` /mnt/xgstage0/tmp/xgstage0/build/csu/crtn.o LC_ALL=C sed -e 's%@RTLD@%/tools/lib/ld.so.1%g' -e 's%@VERSION@%2.10.1%g' -e 's%@PKGVERSION@%(EGLIBC) %g' -e 's%@REPORT_BUGS_TO@%< http://www.eglibc.org/issues/>%g' -e 's%@BASH@%/bin/bash%g' -e 's%@TEXTDOMAINDIR@%/tools/share/locale%g' < ldd.bash.in | LC_ALL=C sed -f ../eglibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed > /mnt/xgstage0/tmp/xgstage0/build/elf/ldd.new sed: couldn't open file ../eglibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed: No such file or directory make[2]: *** [/mnt/xgstage0/tmp/xgstage0/build/elf/ldd] Error 4 make[2]: Leaving directory `/mnt/xgstage0/tmp/xgstage0/eglibc-2.10.1/elf' make[1]: *** [elf/others] Error 2 make[1]: Leaving directory `/mnt/xgstage0/tmp/xgstage0/eglibc-2.10.1' make: *** [all] Error 2 [Error] make failed. *** build P010glibc failed. build tools failed. config.make文件和config.status位于build目录下。 修改config.make文件的第26行,将ldd-rewrite.sed文件的路径修改为正确的路径 26 ldd-rewrite-script = ../eglibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed 修改config.status文件的592行,将ldd-rewrite.sed文件的路径修改为正确的路径 592 s,@ldd_rewrite_script@,../eglibc-2.10.1/ports/sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed,;t t 这两处路径修改完成后,重新make即可编译通过。 如果还是要使用工具链脚本编译的话需在修改工具链脚本将P010glibc文件中的 cat > config.cache << "EOF" 至 --cache-file=config.cache 行(即31至42行)全部注释起来,然后再运行./build即可通过编译eglibc