还是编译器的问题?update:还就是编译器的问题

update:确实是编译器的问题,换了编译参数就好了。
刚编译完用的 spec 和旧的 spec 区别:
[mockbuild@localhost ~]$ diff glibc.spec rpmbuild/SPECS/glibc.spec
1003c1003
< BuildFlags="-march=mips64r2 -mabi=64 "
---
> BuildFlags="-march=mips64r2 -mabi=64 -mrelax-pic-calls"
1029c1029
< build_CFLAGS="$BuildFlags -g -O2 $*"
---
> build_CFLAGS="$BuildFlags -g -O3 $*"

------------------------------------------------

编译 glibc 的 rpm 出错。
+ make -j4 install_root=/home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el install-locales -C ../localedata objdir=/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux
make: Entering directory '/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/localedata'
.././scripts/mkinstalldirs /home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el/usr/lib/locale
mkdir -p -- /home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el/usr/lib/locale
aa_ER.UTF-8aa_DJ.ISO-8859-1aa_DJ.UTF-8......C.UTF-8.../bin/sh: line 13: 13429 Segmentation fault (core dumped) I18NPATH=. GCONV_PATH=/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/iconvdata LC_ALL=C /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf/ld.so.1 --library-path /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/math:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/dlfcn:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nss:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nis:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/rt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/resolv:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/crypt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/mathvec:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/support:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nptl /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el $locale
make: *** [Makefile:220: install-aa_ER/UTF-8] Error 139
make: *** Waiting for unfinished jobs....
.../bin/sh: line 13: 13437 Segmentation fault (core dumped) I18NPATH=. GCONV_PATH=/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/iconvdata LC_ALL=C /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf/ld.so.1 --library-path /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/math:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/dlfcn:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nss:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nis:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/rt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/resolv:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/crypt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/mathvec:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/support:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nptl /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el $locale
make: *** [Makefile:220: install-aa_DJ/ISO-8859-1] Error 139
/bin/sh: line 13: 13438 Segmentation fault (core dumped) I18NPATH=. GCONV_PATH=/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/iconvdata LC_ALL=C /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf/ld.so.1 --library-path /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/math:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/dlfcn:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nss:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nis:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/rt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/resolv:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/crypt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/mathvec:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/support:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nptl /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el $locale
make: *** [Makefile:220: install-C.UTF-8/UTF-8] Error 139
/bin/sh: line 13: 13441 Segmentation fault (core dumped) I18NPATH=. GCONV_PATH=/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/iconvdata LC_ALL=C /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf/ld.so.1 --library-path /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/math:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/dlfcn:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nss:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nis:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/rt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/resolv:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/crypt:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/mathvec:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/support:/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/nptl /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/home/mockbuild/rpmbuild/BUILDROOT/glibc-2.26-15.fc27.mips64el $locale
make: *** [Makefile:220: install-aa_DJ.UTF-8/UTF-8] Error 139
make: Leaving directory '/home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/localedata'
error: Bad exit status from /var/tmp/rpm-tmp.7410ai (%install)


直接运行一下试试,结果:
[mockbuild@localhost localedata]$ /home/mockbuild/rpmbuild/BUILD/glibc-2.26-65-ga76376df7c/build-mips64el-redhat-linux/elf/ld.so.1
Segmentation fault (core dumped)
[mockbuild@localhost localedata]$

编译器信息:
[mockbuild@localhost ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips64el-redhat-linux/7/lto-wrapper
Target: mips64el-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --disable-multilib --with-system-zlib --cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-gnu-indirect-function --with-arch=mips64r2 --with-abi=64 --build=mips64el-redhat-linux
Thread model: posix
gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)
[mockbuild@localhost ~]$ ld -v
GNU ld version 2.29.1-9.fc27
[mockbuild@localhost ~]$
已邀请:

jiangtao9999

赞同来自:

不过好消息是,居然没有遇到 ELF 的那个错误。
之前编译 arch 绕不开。

要回复问题请先登录注册