-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't link "nobundle" libs which had already been included in upstrea…
…m crate.
- Loading branch information
Showing
8 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
-include ../tools.mk | ||
|
||
all: $(call NATIVE_STATICLIB,foo) | ||
$(RUSTC) bar.rs | ||
# aaa is a native static library | ||
# bbb is a rlib | ||
# ccc is a dylib | ||
# ddd is an executable | ||
|
||
# Check that libbar.rlib does not contain the definition of `func` | ||
nm $(TMPDIR)/libbar.rlib | (! grep "T _*func") | ||
nm $(TMPDIR)/libbar.rlib | grep "U _*func" | ||
all: $(call NATIVE_STATICLIB,aaa) | ||
$(RUSTC) bbb.rs --crate-type=rlib | ||
|
||
# Check that foo gets passed to the linker (as either `-l foo` or `foo.lib`) | ||
$(RUSTC) main.rs -Z print-link-args | grep -e "-l[\" ]*foo" -e "foo.lib" | ||
# Check that bbb does NOT contain the definition of `native_func` | ||
nm $(TMPDIR)/libbbb.rlib | (! grep "T _*native_func") | ||
nm $(TMPDIR)/libbbb.rlib | grep "U _*native_func" | ||
|
||
$(call RUN,main) | ||
# Check that aaa gets linked (either as `-l aaa` or `aaa.lib`) when building ccc. | ||
$(RUSTC) ccc.rs -C prefer-dynamic --crate-type=dylib -Z print-link-args | grep -e "-l[\" ]*aaa" -e "aaa.lib" | ||
|
||
# Check that aaa does NOT get linked when building ddd. | ||
$(RUSTC) ddd.rs -Z print-link-args | (! grep -e "-l[\" ]*aaa" -e "aaa.lib") | ||
|
||
$(call RUN,ddd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![crate_type = "dylib"] | ||
|
||
extern crate bbb; | ||
|
||
pub fn do_work() { | ||
unsafe { bbb::native_func(); } | ||
bbb::wrapped_func(); | ||
} | ||
|
||
pub fn do_work_generic<T>() { | ||
unsafe { bbb::native_func(); } | ||
bbb::wrapped_func(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters