Skip to content

Empty main fails to link when using optimizations #15209

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

Closed
wackywendell opened this issue Jun 27, 2014 · 2 comments
Closed

Empty main fails to link when using optimizations #15209

wackywendell opened this issue Jun 27, 2014 · 2 comments

Comments

@wackywendell
Copy link
Contributor

Here is an example. This started about 3 days ago (approximately Jun 23).

This is a transcript:

Error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'out' 'out.o' '-lmorestack' '-nodefaultlibs' '-Wl,--gc-sections' '-Wl,--as-needed' '-Wl,-O1' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-59beb4f7-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-2ea8f361-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libsync-305341d2-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustrt-d8560cb2-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-d412c0c4-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1085c790-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-4f9a876d-0.11.0-pre.rlib' '/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c5ed6fb4-0.11.0-pre.rlib' '-L' '/home/rust/.rust' '-L' '/home/rust' '-Wl,-Bdynamic' '-ldl' '-lpthread' '-lgcc_s' '-lpthread' '-lc' '-lm' '-Wl,-rpath,$ORIGIN/../../usr/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib' '-lcompiler-rt'
note: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o): In function `io::helper_thread::imp::new::h0d2a4e4166f99e80Aga::v0.11.0.pre':
(.text._ZN2io13helper_thread3imp3new20h0d2a4e4166f99e80Aga11v0.11.0.preE+0x20): undefined reference to `__morestack'
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o): In function `io::helper_thread::imp::signal::h26ab199be3006ab7Vga::v0.11.0.pre':
(.text._ZN2io13helper_thread3imp6signal20h26ab199be3006ab7Vga11v0.11.0.preE+0x20): undefined reference to `__morestack'
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o): In function `io::file::FileDesc::inner_write::h6a6d7310ccbe3c7czuc::v0.11.0.pre':
(.text._ZN2io4file8FileDesc11inner_write20h6a6d7310ccbe3c7czuc11v0.11.0.preE+0x20): undefined reference to `__morestack'
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o): In function `io::file::FileDesc::new::h7d4e6e7953140ef49sc::v0.11.0.pre':
(.text._ZN2io4file8FileDesc3new20h7d4e6e7953140ef49sc11v0.11.0.preE+0x20): undefined reference to `__morestack'
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o): In function `io..file..FileDesc::glue_drop.4666::h79789ec73bd99e31':
(.text._ZN18io..file..FileDesc14glue_drop.466617h79789ec73bd99e31E+0x20): undefined reference to `__morestack'
/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-1fb5e2c0-0.11.0-pre.rlib(native.o):(.text._ZN2io8addrinfo18GetAddrInfoRequest3run20hb725453b9f360021Kha11v0.11.0.preE+0x28): more undefined references to `__morestack' follow
collect2: error: ld returned 1 exit status

error: aborting due to previous error
@schmee
Copy link
Contributor

schmee commented Jun 27, 2014

Looks like a dupe of #15108, and should have been fixed in #15126. What version are you using?

@huonw
Copy link
Member

huonw commented Jun 27, 2014

@schmee it was the rustc that the playpen was using 8 hours ago.

The code now works, so I assume the playpen rustc recently updated to include that patch. Closing (thanks for noticing @schmee).

@huonw huonw closed this as completed Jun 27, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 17, 2023
internal: Stronger typing for AstId and AstIdMap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants