[PATCH] D55845: Reject .so files if -static is given.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 13:16:50 PST 2018


MaskRay added inline comments.


================
Comment at: lld/test/ELF/static-error.s:7
+// RUN: ld.lld -o /dev/null %t.o %t.so
+// RUN: not ld.lld -o /dev/null -static %t.o %t.so >& %t.log
+// RUN: FileCheck %s < %t.log
----------------
MaskRay wrote:
> ruiu wrote:
> > MaskRay wrote:
> > > POSIX sh does not support `>&` (but supports `>&fd`)
> > > 
> > > You may use `2>&1 >/dev/null | FileCheck` if you want to emphasize stderr is checked.
> > Even thought lit tests support features such as redirection that you can find in Unix shells, these RUN commands are not run on a Unix shell, so it is safe to use >& as long as it works on lit.
> `2>&1 | FileCheck` LG.
I don't know how lit runs the script.

On my machine, after running the test, I get a script:
`llvm/$build/projects/lld/test/ELF/Output/aarch64-abs16.s.script`

I can run that script with my `$SHELL` (zsh, but it may be `sh` for some people), so the POSIX shell compatibility is good.


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

https://reviews.llvm.org/D55845





More information about the llvm-commits mailing list