@@ -144,6 +144,9 @@ pub enum LinkerFlavorCli {
144
144
Bpf ,
145
145
Ptx ,
146
146
147
+ // Generic (unstable) flavors.
148
+ Any ( Cc , Lld ) ,
149
+
147
150
// Legacy stable values
148
151
Gcc ,
149
152
Ld ,
@@ -162,7 +165,8 @@ impl LinkerFlavorCli {
162
165
| LinkerFlavorCli :: Msvc ( Lld :: Yes )
163
166
| LinkerFlavorCli :: EmCc
164
167
| LinkerFlavorCli :: Bpf
165
- | LinkerFlavorCli :: Ptx => true ,
168
+ | LinkerFlavorCli :: Ptx
169
+ | LinkerFlavorCli :: Any ( ..) => true ,
166
170
LinkerFlavorCli :: Gcc
167
171
| LinkerFlavorCli :: Ld
168
172
| LinkerFlavorCli :: Lld ( ..)
@@ -223,6 +227,15 @@ impl LinkerFlavor {
223
227
LinkerFlavorCli :: Bpf => LinkerFlavor :: Bpf ,
224
228
LinkerFlavorCli :: Ptx => LinkerFlavor :: Ptx ,
225
229
230
+ // Generic flavors
231
+ LinkerFlavorCli :: Any ( cc, lld) => match lld_flavor {
232
+ LldFlavor :: Ld if is_gnu => LinkerFlavor :: Gnu ( cc, lld) ,
233
+ LldFlavor :: Ld64 => LinkerFlavor :: Darwin ( cc, lld) ,
234
+ LldFlavor :: Wasm => LinkerFlavor :: WasmLld ( cc) ,
235
+ LldFlavor :: Ld => LinkerFlavor :: Unix ( cc) ,
236
+ LldFlavor :: Link => LinkerFlavor :: Msvc ( lld) ,
237
+ } ,
238
+
226
239
// Below: legacy stable values
227
240
LinkerFlavorCli :: Gcc => match lld_flavor {
228
241
LldFlavor :: Ld if is_gnu => LinkerFlavor :: Gnu ( Cc :: Yes , Lld :: No ) ,
@@ -289,6 +302,9 @@ impl LinkerFlavor {
289
302
LinkerFlavorCli :: EmCc => ( Some ( Cc :: Yes ) , Some ( Lld :: Yes ) ) ,
290
303
LinkerFlavorCli :: Bpf | LinkerFlavorCli :: Ptx => ( None , None ) ,
291
304
305
+ // Generic flavors
306
+ LinkerFlavorCli :: Any ( cc, lld) => ( Some ( cc) , Some ( lld) ) ,
307
+
292
308
// Below: legacy stable values
293
309
LinkerFlavorCli :: Gcc => ( Some ( Cc :: Yes ) , None ) ,
294
310
LinkerFlavorCli :: Ld => ( Some ( Cc :: No ) , Some ( Lld :: No ) ) ,
@@ -503,6 +519,14 @@ linker_flavor_cli_impls! {
503
519
( LinkerFlavorCli :: Bpf ) "bpf"
504
520
( LinkerFlavorCli :: Ptx ) "ptx"
505
521
522
+ // Generic flavors
523
+ ( LinkerFlavorCli :: Any ( Cc :: No , Lld :: No ) ) "*"
524
+ ( LinkerFlavorCli :: Any ( Cc :: No , Lld :: Yes ) ) "*-lld"
525
+ ( LinkerFlavorCli :: Any ( Cc :: Yes , Lld :: No ) ) "*-cc"
526
+ ( LinkerFlavorCli :: Any ( Cc :: Yes , Lld :: Yes ) ) "*-lld-cc"
527
+ ( LinkerFlavorCli :: Any ( Cc :: Clang , Lld :: No ) ) "*-clang"
528
+ ( LinkerFlavorCli :: Any ( Cc :: Clang , Lld :: Yes ) ) "*-lld-clang"
529
+
506
530
// Legacy stable flavors
507
531
( LinkerFlavorCli :: Gcc ) "gcc"
508
532
( LinkerFlavorCli :: Ld ) "ld"
0 commit comments