编译rustc提示 relocation truncated to fit是为什么?

https://github.com/rust-lang/rust/issues/52108
上游有 bug 汇报。
看来是 rustc 自己的问题。不过很奇怪的是为什么 mips 的 got 表这么小? 
+ python3 ./x.py build
Compiling unicode-xid v0.1.0
Compiling cfg-if v0.1.2
Compiling itoa v0.4.1
Compiling cc v1.0.10
Compiling libc v0.2.40
Compiling fixedbitset v0.1.9
Compiling num-traits v0.2.2
Compiling serde v1.0.40
Compiling dtoa v0.4.2
Compiling ordermap v0.3.5
Compiling build_helper v0.1.0 (file:///builddir/build/BUILD/rustc-1.27.0-src/src/build_helper)
Compiling lazy_static v0.2.11
Compiling getopts v0.2.17
Compiling proc-macro2 v0.3.6
Compiling filetime v0.1.15
Compiling num_cpus v1.8.0
Compiling time v0.1.39
Compiling cmake v0.1.30
Compiling petgraph v0.4.12
Compiling quote v0.5.1
Compiling syn v0.13.1
Compiling serde_json v1.0.15
Compiling toml v0.4.6
Compiling serde_derive_internals v0.23.1
Compiling serde_derive v1.0.40
Compiling bootstrap v0.0.0 (file:///builddir/build/BUILD/rustc-1.27.0-src/src/bootstrap)
error: linking with `cc` failed: exit code: 1
|

= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.138pesuvab4dy035.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.15kq92zzbmxot4k9.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.16u6js6g0l3k1ic6.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1ckp3bwk0jmrbky4.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1im38lueib99jsk0.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1mvmz58owquyropc.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1y16o1qfye96o7m0.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1zeawhkbeobww1zn.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.1zwd8n7bcl3vhvvh.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.23tqyymcb18u96mb.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.2jqywn86b2gsqohu.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.2lyh15q6cjwzy18c.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.3171x0bwu82dptu7.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.35af7odfhiqsblci.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.3ayaeypdcro9d6yk.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.3cx7oljifvb206q7.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.3g94tobrpgum5dk6.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.3rngp6bm2u2q5z0y.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.43v6g0y2xsxoggnt.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.45nf4z58qqykpcpi.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.48721dc4k5qxei0u.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.49a7n47po4ttqjl7.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4b8ptp1vn215jmoe.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4dvpkvhelzqn37of.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4xq48u46a1pwiqn7.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4ybye971cqflgun6.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4yh8x2b62dcih00t.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.4ypvbwho0bu5tnww.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.8xzrsc1ux72v29j.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.9elsx31vb4it187.rcgu.o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.e19kx9t7xhzajfl.rcgu.o" "-o" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/bootstrap-76d7ea5a3317b797.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps" "-L" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib" "-Wl,-Bstatic" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libpetgraph-29d11741e0a19150.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libordermap-1fbaf4cd8ba87ddf.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libfixedbitset-93425c9ebb6fb1cd.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libtime-a9ad4e9c9041a50b.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libtoml-286469bcaf6f4cef.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libnum_cpus-750e3ca72291cc93.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libgetopts-3cacbd87eaefa645.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libfiletime-e3a9d3a40a72da25.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/liblibc-9ab7151fd42e62b6.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libcfg_if-1171b5625a2c27af.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libcmake-e1fce7fd817592b6.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libcc-a23237eabe0d48f2.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libserde_json-23430e0932b314fc.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libitoa-f13231ec26693a8a.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libdtoa-63feb42fc4ffd92b.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libserde-2bb77629a97cebcb.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libnum_traits-a05c88ba8f1b5ae4.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/liblazy_static-9d670ba8801362a0.rlib" "/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbuild_helper-50266fa444720eab.rlib" "-Wl,--start-group" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libstd-dd23a7b37767960c.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libpanic_unwind-6b76fe143301e0c9.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libunwind-12834a0f3192c0f3.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/liballoc_system-6b2d8aa9b5f7749a.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/liblibc-7afb6951903a1614.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/liballoc-701c907ae10c4f7e.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libstd_unicode-72fe684b84a5e845.rlib" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libcore-71d55a187b71a836.rlib" "-Wl,--end-group" "/usr/lib/rustlib/mips64el-unknown-linux-gnuabi64/lib/libcompiler_builtins-05a1636955e06766.rlib" "-Wl,-Bdynamic" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util"
= note: /builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::HashMap<K, V, S> as core::clone::Clone>::clone':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:399:(.text._ZN102_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h55339348c661ea5fE+0x8c): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::HashMap<K, V, S> as core::iter::traits::IntoIterator>::into_iter':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1834:(.text._ZN116_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..iter..traits..IntoIterator$GT$9into_iter17h2f4a7ffbcb2b8c5cE+0x84): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::HashMap<K, V, S> as core::iter::traits::Extend<(K, V)>>::extend':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:2581:(.text._ZN136_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..iter..traits..Extend$LT$$LP$K$C$$u20$V$RP$$GT$$GT$6extend17h76fab61df23764faE+0xcc): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::HashMap<K, V, S> as core::iter::traits::Extend<(K, V)>>::extend':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:2581:(.text._ZN136_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..iter..traits..Extend$LT$$LP$K$C$$u20$V$RP$$GT$$GT$6extend17h8e5cf8a842d5535fE+0xb4): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::InternalEntry<K, V, &'a mut std::collections::hash::table::RawTable<K, V>>>::into_entry':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1680:(.text._ZN157_$LT$std..collections..hash..map..InternalEntry$LT$K$C$$u20$V$C$$u20$$RF$$u27$a$u20$mut$u20$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$$GT$10into_entry17h6ff08cd565995aa2E+0x2ac): relocation truncated to fit: R_MIPS_CALL16 against `memcpy@@GLIBC_2.0'
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1686:(.text._ZN157_$LT$std..collections..hash..map..InternalEntry$LT$K$C$$u20$V$C$$u20$$RF$$u27$a$u20$mut$u20$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$$GT$10into_entry17h6ff08cd565995aa2E+0x44c): relocation truncated to fit: R_MIPS_CALL16 against `memcpy@@GLIBC_2.0'
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1686:(.text._ZN157_$LT$std..collections..hash..map..InternalEntry$LT$K$C$$u20$V$C$$u20$$RF$$u27$a$u20$mut$u20$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$$GT$10into_entry17h6ff08cd565995aa2E+0x478): relocation truncated to fit: R_MIPS_CALL16 against `memcpy@@GLIBC_2.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `<std::collections::hash::map::InternalEntry<K, V, &'a mut std::collections::hash::table::RawTable<K, V>>>::into_entry':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1680:(.text._ZN157_$LT$std..collections..hash..map..InternalEntry$LT$K$C$$u20$V$C$$u20$$RF$$u27$a$u20$mut$u20$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$$GT$10into_entry17ha43b4a1717213530E+0x26c): relocation truncated to fit: R_MIPS_CALL16 against `memcpy@@GLIBC_2.0'
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:1686:(.text._ZN157_$LT$std..collections..hash..map..InternalEntry$LT$K$C$$u20$V$C$$u20$$RF$$u27$a$u20$mut$u20$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$$GT$10into_entry17ha43b4a1717213530E+0x46c): relocation truncated to fit: R_MIPS_CALL16 against `memcpy@@GLIBC_2.0'
/builddir/build/BUILD/rustc-1.27.0-src/build/bootstrap/debug/deps/libbootstrap-b174a1b5f8328193.rlib(bootstrap-b174a1b5f8328193.2w6xsa2hbi53xhak.rcgu.o): In function `std::collections::hash::map::robin_hood':
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:503:(.text._ZN3std11collections4hash3map10robin_hood17h0114868a0efecd28E+0xb0): relocation truncated to fit: R_MIPS_CALL16 against `_Unwind_Resume@@GCC_3.0'
/builddir/build/BUILD/rustc-1.26.2-src/src/libstd/collections/hash/map.rs:519:(.text._ZN3std11collections4hash3map10robin_hood17h0114868a0efecd28E+0x260): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `bootstrap`.
warning: build failed, waiting for other jobs to finish...
error: build failed
failed to run: /usr/bin/cargo build --manifest-path /builddir/build/BUILD/rustc-1.27.0-src/src/bootstrap/Cargo.toml --frozen
Build completed unsuccessfully in 0:03:56
错误:/var/tmp/rpm-tmp.1cLgWS (%build) 退出状态不好
/var/tmp/rpm-tmp.1cLgWS (%build) 退出状态不好


已邀请:

xen0n

赞同来自:

emmmm 我好久没折腾 rustc 了,现在代码规模都这么大了吗?
 
不过 n64 这个 ABI 其实也算是年久失修了,可惜 NUBI64/32 一直没人推。我其实有想过搞出一个 NUBI64 新天地,但好像 MIPS 周边生态一个人不太能搞得过来。

ambrosehua

赞同来自:

LLVM 6.0目前在loongson上目前还没有能够自举,问题还是很多

要回复问题请先登录注册