[PATCH] D158206: [Driver] Add PIE support on Solaris

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 12:41:37 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Solaris.cpp:55
                                    const char *LinkingOutput) const {
+  const bool IsPIE =
+      !Args.hasArg(options::OPT_shared) &&
----------------
On Linux, `clang -r` `-static` also disable the linker option `-pie`.
`-static-pie` is handled as a special case which also disables the regular `-pie` code path.


================
Comment at: clang/test/Driver/solaris-ld.c:110
+// Check the right ld flags are present with -pie.
+// RUN: %clang -### %s -pie 2>&1 \
+// RUN:     --target=sparc-sun-solaris2.11 \
----------------
The convention is to put `2>&1` at the end of the command, aka before `|`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158206



More information about the cfe-commits mailing list