-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc 1.13.0-nightly exit with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code. #36260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/rust/rust-nightly-sysalloc-llvm3.9/lib/rustlib/aarch64-unknown-linux-gnu/lib" "../parity-master/target/release/parity.0.o" "-o" "../parity-master/target/release/parity" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "../parity-master/target/release/deps" "-L" "../parity-master/target/release/build/rust-crypto-ed6f35bcd4283630/out" "-L" "../parity-master/target/release/build/rocksdb-sys-85650723073925db/out" "-L" "../parity-master/target/release/build/rocksdb-sys-85650723073925db/out" "-L" "../parity-master/target/release/build/sha3-5886980f897f8041/out" "-L" "../parity-master/target/release/build/eth-secp256k1-fcaa5ca0c6e6e793/out" "-L" "../parity-master/target/release/build/nanomsg-sys-197eca269c49f40e/out" "-L" "/rust/rust-nightly-sysalloc-llvm3.9/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/rustc.sPBlB1kA2Qr1/libnanomsg_sys-ef795781850263eb.rlib" "/tmp/rustc.sPBlB1kA2Qr1/libsha3.rlib" "/tmp/rustc.sPBlB1kA2Qr1/librocksdb_sys-775707c1a0d48a54.rlib" "/tmp/rustc.sPBlB1kA2Qr1/libsecp256k1-ddb291d467b8ff52.rlib" "/tmp/rustc.sPBlB1kA2Qr1/libcrypto-ccca7bf8b1baef5f.rlib" "/tmp/rustc.sPBlB1kA2Qr1/libstd-836a4172.rlib" "-l" "anl" "-l" "snappy" "-l" "rocksdb" "-l" "stdc++" "-l" "stdc++" "-l" "c" "-l" "util" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-s" "-l" "compiler-rt"
= note: ../parity-master/target/release/parity.0.o: In function `drop::hca057d947f770cc6':
parity.cgu-0.rs:(.text._ZN4drop17hca057d947f770cc6E+0x0): undefined reference to `_$LT$alloc..arc..Arc$LT$T$GT$$u20$as$u20$core..ops..Drop$GT$::drop::ha2fd73b0d2df24c5'
../parity-master/target/release/parity.0.o: In function `extern$u20$$u22$rust.call$u22$$u20$fn$LP$$u5b$closure$SP$rpc$u2f$src$u2f$lib.rs.106.19.$u20$108.5$u20$panic_handler.std..sync..Arc$LT$io..PanicHandler$GT$$u5d$$C$$u20$$LP$$RP$$RP$::once_shim.27073::hb6ef47f61e5bd418':
parity.cgu-0.rs:(.text._ZN179extern$u20$$u22$rust.call$u22$$u20$fn$LP$$u5b$closure$SP$rpc$u2f$src$u2f$lib.rs.106.19.$u20$108.5$u20$panic_handler.std..sync..Arc$LT$io..PanicHandler$GT$$u5d$$C$$u20$$LP$$RP$$RP$15once_shim.2707317hb6ef47f61e5bd418E+0xcc): undefined reference to `_$LT$alloc..arc..Arc$LT$T$GT$$u20$as$u20$core..ops..Drop$GT$::drop::ha2fd73b0d2df24c5' |
Nominating since this appears to be a regression. |
Reduced: fn create_fn() -> Box<Fn()> {
let text = String::new();
Box::new(move || { let _ = &text; })
}
fn main() {
let _ = create_fn();
} |
Running
|
This is from the removal of old trans. We should've been covered by on-demand drop glue generation still, though. |
Looking at the IR - the missing methods are
|
@thepowersgang Oh, this is bad. The collector needs to know user definitions being instantiated ahead of time (including We might need to temporarily detect the shim'd cases in the collector and trigger drop glue generation. cc #34151 |
I'm looking into a short-term fix right now. |
…p-glue, r=eddyb trans: Let the collector find drop-glue for all vtables, not just VTableImpl. This fixes rust-lang#36260. So far, the collector has only recorded drop-glue for insertion into a vtable if the vtable was for an impl. But there's actually no reason why it shouldn't do just the same for closure vtables, afaict. r? @eddyb cc @rust-lang/compiler
…ddyb trans: Let the collector find drop-glue for all vtables, not just VTableImpl. This fixes #36260. So far, the collector has only recorded drop-glue for insertion into a vtable if the vtable was for an impl. But there's actually no reason why it shouldn't do just the same for closure vtables, afaict. r? @eddyb cc @rust-lang/compiler
yay! Thanks @jonathandturner |
I found that current rustc 1.13.0-nightly can't compile'Rust by Example - 8.2.5 As output parameters' code, both on my linux pc and Rust Playground.
I tried this code: see Rust by Example 8.2.5
Executing code above on Rust Playground produces the message below when selecting nightly. ( but stable and beta do not produce this error).
error: linking with
cc
failed: exit code: 1|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "./out.0.o" "-o" "./out" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-411f48d3.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-411f48d3.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
= note: ./out.0.o: In function
drop::hf3564cae7b79f1cb': rust_out.cgu-0.rs:(.text._ZN4drop17hf3564cae7b79f1cbE+0xd): undefined reference to
$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..Drop$GT$::drop::h4c07c16183524d21'./out.0.o: In function
drop::hc5f0e028c3876d25': rust_out.cgu-0.rs:(.text._ZN4drop17hc5f0e028c3876d25E+0xd): undefined reference to
$LT$alloc..raw_vec..RawVec$LT$T$GT$$u20$as$u20$core..ops..Drop$GT$::drop::h7a8bb753832b1af2'collect2: error: ld returned 1 exit status
error: aborting due to previous error
Compilation failed.
This happens on my Linux Laptop pc as well.
This is my laptop's rustc version(installing current latest) .
rustc --version --verbose
:rustc 1.13.0-nightly (e07dd59 2016-08-25)
binary: rustc
commit-hash: e07dd59
commit-date: 2016-08-25
host: x86_64-unknown-linux-gnu
release: 1.13.0-nightly
The text was updated successfully, but these errors were encountered: