Skip to content

Fix small errors from #10978 #11073

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

Merged
merged 2 commits into from
Dec 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/etc/mklldeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
f = open(sys.argv[1], 'wb')

components = sys.argv[2].split(' ')
components = [i for i in components if i] # ignore extra whitespaces

f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
Expand Down Expand Up @@ -51,6 +52,10 @@
proc = subprocess.Popen(args, stdout = subprocess.PIPE)
out, err = proc.communicate()

if err:
print("failed to run llconfig: args = `{}`".format(args))
sys.exit(1)

for lib in out.strip().split(' '):
lib = lib[2:] # chop of the leading '-l'
f.write("#[link(name = \"" + lib + "\", kind = \"static\")]\n")
Expand Down
6 changes: 5 additions & 1 deletion src/librustc/metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ fn visit_item(e: &Env, i: @ast::item) {
@"foo"
}
};
cstore::add_used_library(cstore, n.to_owned(), kind);
if n.is_empty() {
e.sess.span_err(m.span, "#[link(name = \"\")] given with empty name");
} else {
cstore::add_used_library(cstore, n.to_owned(), kind);
}
}
None => {}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/bad-extern-link-attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

#[link()] //~ ERROR: specified without `name =
#[link(name = "")] //~ ERROR: with empty name
#[link(name = "foo")]
#[link(name = "foo", kind = "bar")] //~ ERROR: unknown kind
extern {}
Expand Down