[all-commits] [llvm/llvm-project] 779353: [Driver] Improve legibility of ld -z options on So...

rorth via All-commits all-commits at lists.llvm.org
Mon Aug 28 00:26:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 779353e576eaa6ababdfc242784484f3656ecfe0
      https://github.com/llvm/llvm-project/commit/779353e576eaa6ababdfc242784484f3656ecfe0
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2023-08-28 (Mon, 28 Aug 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.h
    M clang/lib/Driver/ToolChains/FreeBSD.cpp
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/lib/Driver/ToolChains/Hexagon.cpp
    M clang/lib/Driver/ToolChains/NetBSD.cpp
    M clang/lib/Driver/ToolChains/OpenBSD.cpp
    M clang/lib/Driver/ToolChains/Solaris.cpp
    M clang/test/Driver/solaris-ld-sanitizer.c
    M clang/test/Driver/solaris-ld.c

  Log Message:
  -----------
  [Driver] Improve legibility of ld -z options on Solaris

Following the lead of the Linux code, this patch passes the `ld -z` options
as two separate args on Solaris, improving legibility.  For lack of a
variadic `std::push_back`, `getAsNeededOption` had to be changed to
`addAsNeededOption`, matching other `add*Options` functions, changing
callers accordingly.  The additional args are also used in a WIP revision
of the Solaris GNU ld patch D85309 <https://reviews.llvm.org/D85309>, which
will allow runtime selection of the linker to use.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D158955




More information about the All-commits mailing list