Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Driver] Always use gas with -fno-integrated-as on Solaris #65489

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Sep 6, 2023

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.

`clang -fno-integrated-as` doesn't currently work on Solaris: it doesn't
even select between 32 or 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`.
@rorth rorth requested a review from MaskRay September 6, 2023 14:43
@rorth rorth requested a review from a team as a code owner September 6, 2023 14:43
@github-actions github-actions bot added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Sep 6, 2023
clang/test/Driver/solaris-as.c Show resolved Hide resolved
@rorth rorth merged commit 77e0863 into llvm:main Sep 7, 2023
1 of 2 checks passed
avillega pushed a commit to avillega/llvm-project that referenced this pull request Sep 11, 2023
`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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants