-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Driver] Always use gas with -fno-integrated-as on Solaris (#65489)
`clang -fno-integrated-as` doesn't currently work on Solaris: it doesn't even select between 32 and 64-bit objects. Besides, Solaris has both the native assembler (`/usr/bin/as`) and the GNU assembler (`/usr/bin/gas` resp. `/usr/gnu/bin/as`). The native sparc and x86 assemblers aren't compatible with `clang`'s assembler syntax to varying degrees, and the command line options for `as` and `gas` are completely different. Therefore this patch chooses to always use `gas` on Solaris, using `gnutools::Assembler::ConstructJob` to pass the correct options. Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and `x86_64-pc-linux-gnu`.
- Loading branch information
Showing
5 changed files
with
26 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// General tests for assembler invocations on Solaris. | ||
|
||
/// Test that clang uses gas on Solaris. | ||
// RUN: %clang -x assembler %s -### -c -fno-integrated-as \ | ||
// RUN: --target=sparc-sun-solaris2.11 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-GAS %s | ||
// RUN: %clang -x assembler %s -### -c -fno-integrated-as \ | ||
// RUN: --target=sparc-sun-solaris2.11 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-GAS %s | ||
/// Allow for both "/usr/bin/gas" (native) and "gas" (cross) forms. | ||
// CHECK-GAS: gas" |