Skip to content

Commit 61e6231

Browse files
committed
Update for new features, target_foo, and remove mention of -T
1 parent d065a12 commit 61e6231

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

active/0000-target-specification.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Rather than listing specific targets for special treatment, introduce a
3838
general mechanism for specifying certain characteristics of a target triple.
3939
Redesign how targets are handled around this specification, including for the
4040
built-in targets. Extend the `--target` flag to accept a file name of a target
41-
specificatoin. A table of the target specification flags and their meaning:
41+
specification. A table of the target specification flags and their meaning:
4242

4343
* `data-layout`: The [LLVM data
4444
layout](http://llvm.org/docs/LangRef.html#data-layout) to use. Mostly included
@@ -50,9 +50,13 @@ for completeness; changing this is unlikely to be used.
5050
* `dynamic-linking-available`: Whether the `dylib` crate type is allowed.
5151
* `split-stacks-supported`: Whether there is runtime support that will allow
5252
LLVM's split stack prologue to function as intended.
53-
* `target-name`: What name to use for `targ_os` for use in `cfg` and for
54-
passing to LLVM.
53+
* `llvm-target`: What target to pass to LLVM.
5554
* `relocation-model`: What relocation model to use by default.
55+
* `target_endian`, `target_word_size`: Specify the strings used for the
56+
corresponding `cfg` variables.
57+
* `code-model`: Code model to pass to LLVM, overridable with `-C code-model`.
58+
* `no-redzone`: Disable use of any stack redzone, overridable with `-C
59+
no-redzone`
5660

5761
Rather than hardcoding a specific set of behaviors per-target, with no
5862
recourse for escaping them, the compiler would also use this mechanism when
@@ -71,13 +75,14 @@ deciding how to build for a given target. The process would look like:
7175
target.
7276
6. If `-C relocation-model` is specified, replace the target
7377
`relocation-model` with it.
78+
7. If `-C code-model` is specified, replace the target `code-model` with it.
79+
8. If `-C no-redzone` is specified, replace the target `no-redzone` with true.
7480

7581

7682
Then during compilation, this information is used at the proper places rather
77-
than matching against an enum listing the OSes we recognize.
78-
79-
The complete set of target configuration flags would be mixed into the SVH
80-
for that crate, but would not include modifications given with `-C`.
83+
than matching against an enum listing the OSes we recognize. The `target_os`,
84+
`target_family`, and `target_arch` `cfg` variables would be extracted from the
85+
`--target` passed to rustc.
8186

8287
# Drawbacks
8388

@@ -90,5 +95,4 @@ compiler. rustc is the only compiler I know of that would allow that.
9095
A less holistic approach would be to just allow disabling split stacks on a
9196
per-crate basis. Another solution could be adding a family of targets,
9297
`<arch>-unknown-unknown`, which omits all of the above complexity but does not
93-
allow extending to new targets easily. `-T` can easily be extended for the
94-
future needs of other targets.
98+
allow extending to new targets easily.

0 commit comments

Comments
 (0)