Skip to content

‘rustc’ fails with verbose output when target executable exists as a directory #15451

Closed
@Icelandjack

Description

@Icelandjack
% cat foo.rs
fn main() { println!("Hello, world!\n"); }
% mkdir foo
% rustc foo.rs 
error: linking with `cc` failed: exit code: 1
note: cc '-m32' '-L' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib' '-o' 'foo' 'foo.o' '-Wl,--whole-archive' '-lmorestack' '-Wl,--no-w\
hole-archive' '-nodefaultlibs' '-Wl,--gc-sections' '-Wl,--as-needed' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libnative-1fb5e2c0-\
0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-59beb4f7-0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-l\
inux-gnu/lib/libsync-305341d2-0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librustrt-d8560cb2-0.11.0-pre.rlib' '/usr\
/local/lib/rustlib/i686-unknown-linux-gnu/lib/librand-2ea8f361-0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcolle\
ctions-d412c0c4-0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-1085c790-0.11.0-pre.rlib' '/usr/local/lib/rust\
lib/i686-unknown-linux-gnu/lib/libcore-c5ed6fb4-0.11.0-pre.rlib' '/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-4f9a876d-0.11.0\
-pre.rlib' '-L' '/tmp/rusterr/.rust' '-L' '/tmp/rusterr' '-Wl,-Bdynamic' '-ldl' '-lpthread' '-lgcc_s' '-lpthread' '-lc' '-lm' '-Wl,-rpath,$\
ORIGIN/../../usr/local/lib/rustlib/i686-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib' '-lcompiler-r\
t'
note: /usr/bin/ld: cannot open output file foo: Is a directory
collect2: ld returned 1 exit status

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions