Skip to content

Commit 2ebe33c

Browse files
committed
Drop kind="abstract".
Reword "minus unbundling".
1 parent d08e636 commit 2ebe33c

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

text/0000-dllimport.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ statically in others which is why build scripts are leveraged to make these
5151
dynamic decisions. In order to support this kind of dynamism, the following
5252
modifications are proposed:
5353

54-
- A new library kind, "abstract". An "abstract" library by itself does not
55-
cause any libraries to be linked. Its purpose is to establish an identifier,
56-
that may be later referred to from the command line flags.
5754
- Extend syntax of the `-l` flag to `-l [KIND=]lib[:NEWNAME]`. The `NEWNAME`
5855
part may be used to override name of a library specified in the source.
5956
- Add new meaning to the `KIND` part: if "lib" is already specified in the source,
@@ -64,34 +61,35 @@ Example:
6461

6562
```rust
6663
// mylib.rs
67-
#[link(name = "foo", kind="dylib")]
64+
#[link(name="foo", kind="dylib")]
6865
extern {
6966
// dllimport applied
7067
}
7168

72-
#[link(name = "bar", kind="static")]
69+
#[link(name="bar", kind="static")]
7370
extern {
7471
// dllimport not applied
7572
}
7673

77-
#[link(name = "baz", kind="abstract")]
74+
#[link(name="baz")]
7875
extern {
79-
// dllimport not applied, "baz" not linked
76+
// kind defaults to "dylib", dllimport applied
8077
}
8178
```
8279

83-
```
80+
```sh
8481
rustc mylib.rs -l static=foo # change foo's kind to "static", dllimport will not be applied
85-
rustc mylib.rs -l foo:newfoo # link newfoo instead of foo
86-
rustc mylib.rs -l dylib=baz:quoox # specify baz's kind as "dylib", change link name to quoox.
82+
rustc mylib.rs -l foo:newfoo # link newfoo instead of foo, keeping foo's kind as "dylib"
83+
rustc mylib.rs -l dylib=bar # change bar's kind to "dylib", dllimport will be applied
8784
```
8885

8986
### Unbundled static libs (optional)
9087

9188
It had been pointed out that sometimes one may wish to link to a static system library
9289
(i.e. one that is always available to the linker) without bundling it into .lib's and .rlib's.
9390
For this use case we'll introduce another library "kind", "static-nobundle".
94-
Such libraries would be treated in the same way as "static", minus the bundling.
91+
Such libraries would be treated in the same way as "static", except they will not be bundled into
92+
the target .lib/.rlib.
9593

9694
# Drawbacks
9795
[drawbacks]: #drawbacks
@@ -147,6 +145,4 @@ meaning that it will be common that these attributes are left off by accident.
147145
# Unresolved questions
148146
[unresolved]: #unresolved-questions
149147

150-
- Should un-overridden "abstract" kind cause an error, a warning, or be silently ignored?
151-
- Do we even need "abstract"? Since kind can be overridden, there's no harm in providing a default in the source.
152148
- Should we allow dropping a library specified in the source from linking via `-l lib:` (i.e. "rename to empty")?

0 commit comments

Comments
 (0)