forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#85554 - 12101111:fix-dedup-native-libs, r=pet…
…rochenkov native lib: defer the duplicate check after relevant_lib check. rust-lang#84794 break code using conditional-compilation with `#[link]` attributes. ```rust #[cfg(target_env = "musl")] cfg_if::cfg_if! { if #[cfg(any(target_feature = "crt-static", feature = "llvm-libunwind"))] { #[link(name = "unwind", kind = "static", modifiers = "-bundle")] extern "C" {} } else { #[link(name = "unwind", cfg(feature = "system-llvm-libunwind"))] #[link(name = "gcc_s", cfg(not(feature = "system-llvm-libunwind")))] extern "C" {} } } ```
- Loading branch information
Showing
6 changed files
with
44 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ignore-msvc | ||
|
||
-include ../tools.mk | ||
|
||
all: | ||
$(RUSTC) depa.rs | ||
$(RUSTC) depb.rs | ||
$(RUSTC) depc.rs | ||
$(RUSTC) empty.rs --cfg bar 2>&1 | $(CGREP) '"-ltesta" "-ltestb" "-ltesta"' | ||
$(RUSTC) empty.rs 2>&1 | $(CGREP) '"-ltesta"' | ||
$(RUSTC) empty.rs 2>&1 | $(CGREP) -v '"-ltestb"' | ||
$(RUSTC) empty.rs 2>&1 | $(CGREP) -v '"-ltesta" "-ltesta"' |
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,7 @@ | ||
#![crate_type = "rlib"] | ||
|
||
#[link(name = "testa")] | ||
extern "C" {} | ||
|
||
#[link(name = "testa")] | ||
extern "C" {} |
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,8 @@ | ||
#![feature(link_cfg)] | ||
#![crate_type = "rlib"] | ||
|
||
#[link(name = "testb", cfg(foo))] | ||
extern "C" {} | ||
|
||
#[link(name = "testb", cfg(bar))] | ||
extern "C" {} |
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,4 @@ | ||
#![crate_type = "rlib"] | ||
|
||
#[link(name = "testa")] | ||
extern "C" {} |
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,5 @@ | ||
extern crate depa; | ||
extern crate depb; | ||
extern crate depc; | ||
|
||
fn main() {} |