[PATCH] D85415: [Sparc] Don't use SunStyleELFSectionSwitchSyntax

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 05:58:26 PDT 2020


ro added a comment.

In D85415#2216469 <https://reviews.llvm.org/D85415#2216469>, @efriedma wrote:

>> Instead of adapting the affected tests, this patch changes that default. The internal assembler still accepts both forms as input, only the output syntax is affected.
>
> There's a check in the parser for usesSunStyleELFSectionSwitchSyntax(); what effect does that have?

It now rejects the Sun-style syntax on input.  That's certainly not what I wanted to happen: instead my intent was to produce common ELF syntax on output, but accept both on input as the current/unpatched `clang` does. I must have been dreaming when I tested this!

When I checked large LLVM users (NetBSD and OpenBSD), I found that there is still one large codebase the relies on the ability to read the Sun-style syntax, i.e. OpenSSL.  This is certainly crucial enough to keep support in the parser.

> If we expect that everyone targeting SPARC these days is using an assembler that understands the standard ELF syntax, printing that syntax seems fine.  I assume that's true on Linux; not sure what assemblers are commonly used on Solaris.

It's not true for the Solaris assembler, but a recent `gas` is always bundled on Solaris 11.4, too.  In fact, the included versions of `gcc` are configured to use `gas`, not `/bin/as`.  The situation is similar to what was remedied for the linker with D84029 <https://reviews.llvm.org/D84029>: if you rely on one of two incompatible versions (`/bin/ld` instead of `/usr/gnu/bin/ld`in that case), you must somehow make certain that you always use the right one.

There's normally no issue on Solaris anyway since `clang` uses the internal assembler.  I guess `clang/lib/Driver/ToolChains/Solaris.cpp` (`solaris::Assembler::ConstructJob`) needs a treatment similar to `solaris::Linker::ConstructJob` and `GetLinkerPath`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85415/new/

https://reviews.llvm.org/D85415



More information about the llvm-commits mailing list