Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc 1.13.0-nightly exit with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code. #36260
Comments
koizumi9n
changed the title
rustc 1.13.0-nightly can't compile 'Rust by Example - 8.2.5 As output parameters' code.
rustc 1.13.0-nightly exit with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code.
Sep 4, 2016
koizumi9n
changed the title
rustc 1.13.0-nightly exit with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code.
rustc 1.13.0-nightly exits with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code.
Sep 4, 2016
koizumi9n
changed the title
rustc 1.13.0-nightly exits with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code.
rustc 1.13.0-nightly exit with linkage error, when compiling 'Rust by Example - 8.2.5 As output parameters' code.
Sep 4, 2016
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Sep 4, 2016
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' |
This comment has been minimized.
This comment has been minimized.
|
Nominating since this appears to be a regression. |
This comment has been minimized.
This comment has been minimized.
|
Reduced: fn create_fn() -> Box<Fn()> {
let text = String::new();
Box::new(move || { let _ = &text; })
}
fn main() {
let _ = create_fn();
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Running
|
This comment has been minimized.
This comment has been minimized.
|
This is from the removal of old trans. We should've been covered by on-demand drop glue generation still, though. |
This comment has been minimized.
This comment has been minimized.
|
Looking at the IR - the missing methods are
|
This comment has been minimized.
This comment has been minimized.
|
@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 |
brson
added
A-linkage
T-compiler
A-mir
P-high
and removed
A-mir
labels
Sep 13, 2016
michaelwoerister
self-assigned this
Sep 13, 2016
This comment has been minimized.
This comment has been minimized.
|
I'm looking into a short-term fix right now. |
michaelwoerister
referenced this issue
Sep 14, 2016
Merged
trans: Let the collector find drop-glue for all vtables, not just VTableImpl. #36468
bors
added a commit
that referenced
this issue
Sep 14, 2016
bors
added a commit
that referenced
this issue
Sep 14, 2016
nrc
removed
the
I-nominated
label
Sep 15, 2016
jonathandturner
added a commit
to jonathandturner/rust
that referenced
this issue
Sep 15, 2016
bors
added a commit
that referenced
this issue
Sep 17, 2016
bors
closed this
in
#36468
Sep 17, 2016
This comment has been minimized.
This comment has been minimized.
|
yay! Thanks @jonathandturner |
koizumi9n commentedSep 4, 2016
•
edited
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
ccfailed: 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