@@ -371,37 +371,56 @@ static void checkOptions(Ctx &ctx) {
371
371
if (!ctx.arg .cmseOutputLib .empty ())
372
372
ErrAlways (ctx) << " --out-implib may not be used without --cmse-implib" ;
373
373
}
374
+ if (ctx.arg .fixCortexA8 && !ctx.arg .isLE )
375
+ ErrAlways (ctx)
376
+ << " --fix-cortex-a8 is not supported on big endian targets" ;
374
377
} else {
375
378
if (ctx.arg .cmseImplib )
376
379
ErrAlways (ctx) << " --cmse-implib is only supported on ARM targets" ;
377
380
if (!ctx.arg .cmseInputLib .empty ())
378
381
ErrAlways (ctx) << " --in-implib is only supported on ARM targets" ;
379
382
if (!ctx.arg .cmseOutputLib .empty ())
380
383
ErrAlways (ctx) << " --out-implib is only supported on ARM targets" ;
384
+ if (ctx.arg .fixCortexA8 )
385
+ ErrAlways (ctx) << " --fix-cortex-a8 is only supported on ARM targets" ;
386
+ if (ctx.arg .armBe8 )
387
+ ErrAlways (ctx) << " --be8 is only supported on ARM targets" ;
381
388
}
382
389
383
- if (ctx.arg .fixCortexA53Errata843419 && ctx.arg .emachine != EM_AARCH64)
384
- ErrAlways (ctx)
385
- << " --fix-cortex-a53-843419 is only supported on AArch64 targets" ;
386
-
387
- if (ctx.arg .fixCortexA8 && ctx.arg .emachine != EM_ARM)
388
- ErrAlways (ctx) << " --fix-cortex-a8 is only supported on ARM targets" ;
389
-
390
- if (ctx.arg .armBe8 && ctx.arg .emachine != EM_ARM)
391
- ErrAlways (ctx) << " --be8 is only supported on ARM targets" ;
392
-
393
- if (ctx.arg .fixCortexA8 && !ctx.arg .isLE )
394
- ErrAlways (ctx) << " --fix-cortex-a8 is not supported on big endian targets" ;
395
-
396
- if (ctx.arg .tocOptimize && ctx.arg .emachine != EM_PPC64)
397
- ErrAlways (ctx) << " --toc-optimize is only supported on PowerPC64 targets" ;
390
+ if (ctx.arg .emachine != EM_AARCH64) {
391
+ if (ctx.arg .executeOnly )
392
+ ErrAlways (ctx) << " --execute-only is only supported on AArch64 targets" ;
393
+ if (ctx.arg .fixCortexA53Errata843419 )
394
+ ErrAlways (ctx) << " --fix-cortex-a53-843419 is only supported on AArch64" ;
395
+ if (ctx.arg .zPacPlt )
396
+ ErrAlways (ctx) << " -z pac-plt only supported on AArch64" ;
397
+ if (ctx.arg .zForceBti )
398
+ ErrAlways (ctx) << " -z force-bti only supported on AArch64" ;
399
+ if (ctx.arg .zBtiReport != " none" )
400
+ ErrAlways (ctx) << " -z bti-report only supported on AArch64" ;
401
+ if (ctx.arg .zPauthReport != " none" )
402
+ ErrAlways (ctx) << " -z pauth-report only supported on AArch64" ;
403
+ if (ctx.arg .zGcsReport != " none" )
404
+ ErrAlways (ctx) << " -z gcs-report only supported on AArch64" ;
405
+ if (ctx.arg .zGcs != GcsPolicy::Implicit)
406
+ ErrAlways (ctx) << " -z gcs only supported on AArch64" ;
407
+ }
398
408
399
- if (ctx.arg .pcRelOptimize && ctx.arg .emachine != EM_PPC64)
400
- ErrAlways (ctx) << " --pcrel-optimize is only supported on PowerPC64 targets" ;
409
+ if (ctx.arg .emachine != EM_PPC64) {
410
+ if (ctx.arg .tocOptimize )
411
+ ErrAlways (ctx) << " --toc-optimize is only supported on PowerPC64 targets" ;
412
+ if (ctx.arg .pcRelOptimize )
413
+ ErrAlways (ctx)
414
+ << " --pcrel-optimize is only supported on PowerPC64 targets" ;
415
+ }
401
416
402
417
if (ctx.arg .relaxGP && ctx.arg .emachine != EM_RISCV)
403
418
ErrAlways (ctx) << " --relax-gp is only supported on RISC-V targets" ;
404
419
420
+ if (ctx.arg .emachine != EM_386 && ctx.arg .emachine != EM_X86_64 &&
421
+ ctx.arg .zCetReport != " none" )
422
+ ErrAlways (ctx) << " -z cet-report only supported on X86 and X86_64" ;
423
+
405
424
if (ctx.arg .pie && ctx.arg .shared )
406
425
ErrAlways (ctx) << " -shared and -pie may not be used together" ;
407
426
@@ -435,35 +454,13 @@ static void checkOptions(Ctx &ctx) {
435
454
}
436
455
437
456
if (ctx.arg .executeOnly ) {
438
- if (ctx.arg .emachine != EM_AARCH64)
439
- ErrAlways (ctx) << " --execute-only is only supported on AArch64 targets" ;
440
-
441
457
if (ctx.arg .singleRoRx && !ctx.script ->hasSectionsCommand )
442
458
ErrAlways (ctx)
443
459
<< " --execute-only and --no-rosegment cannot be used together" ;
444
460
}
445
461
446
462
if (ctx.arg .zRetpolineplt && ctx.arg .zForceIbt )
447
463
ErrAlways (ctx) << " -z force-ibt may not be used with -z retpolineplt" ;
448
-
449
- if (ctx.arg .emachine != EM_AARCH64) {
450
- if (ctx.arg .zPacPlt )
451
- ErrAlways (ctx) << " -z pac-plt only supported on AArch64" ;
452
- if (ctx.arg .zForceBti )
453
- ErrAlways (ctx) << " -z force-bti only supported on AArch64" ;
454
- if (ctx.arg .zBtiReport != " none" )
455
- ErrAlways (ctx) << " -z bti-report only supported on AArch64" ;
456
- if (ctx.arg .zPauthReport != " none" )
457
- ErrAlways (ctx) << " -z pauth-report only supported on AArch64" ;
458
- if (ctx.arg .zGcsReport != " none" )
459
- ErrAlways (ctx) << " -z gcs-report only supported on AArch64" ;
460
- if (ctx.arg .zGcs != GcsPolicy::Implicit)
461
- ErrAlways (ctx) << " -z gcs only supported on AArch64" ;
462
- }
463
-
464
- if (ctx.arg .emachine != EM_386 && ctx.arg .emachine != EM_X86_64 &&
465
- ctx.arg .zCetReport != " none" )
466
- ErrAlways (ctx) << " -z cet-report only supported on X86 and X86_64" ;
467
464
}
468
465
469
466
static const char *getReproduceOption (opt::InputArgList &args) {
0 commit comments