Skip to content

Linking fails when using a crate name alias #1706

Closed
@brson

Description

@brson
use stdlib(name = "std");                                                                                                                                                     

fn main() {                                                                                                                                                                   
}                                                                                                                                                                             
error: linking with gcc failed with code 1
note: gcc arguments: -L/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -m64 -o x86_64-unknown-linux-gnu/test/run-pass/corelib.stage1-x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu/test/run-pass/corelib.o -L/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lcore-14bd852465126fe7-0.1 -L/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -lstd-79ca5fac56b63fde-0.1 -lm -lrustrt -lrt -ldl -lmorestack -Wl,-rpath,$ORIGIN/../../stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -Wl,-rpath,/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib -Wl,-rpath,/home/brian/dev/rust-install/lib/rustc/x86_64-unknown-linux-gnu/lib
note: x86_64-unknown-linux-gnu/test/run-pass/corelib.o:(.data.rel+0x10): undefined reference to `_rust_crate_map_stdlib'
collect2: ld returned 1 exit status

error: aborting due to previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions