@@ -38,7 +38,7 @@ Rather than listing specific targets for special treatment, introduce a
38
38
general mechanism for specifying certain characteristics of a target triple.
39
39
Redesign how targets are handled around this specification, including for the
40
40
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:
42
42
43
43
* ` data-layout ` : The [ LLVM data
44
44
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.
50
50
* ` dynamic-linking-available ` : Whether the ` dylib ` crate type is allowed.
51
51
* ` split-stacks-supported ` : Whether there is runtime support that will allow
52
52
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.
55
54
* ` 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`
56
60
57
61
Rather than hardcoding a specific set of behaviors per-target, with no
58
62
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:
71
75
target.
72
76
6 . If ` -C relocation-model ` is specified, replace the target
73
77
` 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.
74
80
75
81
76
82
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.
81
86
82
87
# Drawbacks
83
88
@@ -90,5 +95,4 @@ compiler. rustc is the only compiler I know of that would allow that.
90
95
A less holistic approach would be to just allow disabling split stacks on a
91
96
per-crate basis. Another solution could be adding a family of targets,
92
97
` <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