Previously, if you pass -static to lld, lld searches for only foo.a
and skips foo.so for -lfoo option. However, it didn't reject .so files
if you directly pass their pathnames via the command line, which is a bug.
Details
Diff Detail
- Build Status
Buildable 26118 Build 26117: arc lint + arc unit
Event Timeline
LG, but not sure if the comment should mention -static. I think bfd's comment is better
% ld.bfd t.o -static t.so ld.bfd: attempted static link of dynamic object `t.so'
In gold, -static is a separate state, different from -Bdynamic/-Bstatic.
if (!doing_static_link && options.is_static()) { // We print out just the first .so we see; there may be others. gold_assert(input_objects->dynobj_begin() != input_objects->dynobj_end()); gold_error(_("cannot mix -static with dynamic object %s"), (*input_objects->dynobj_begin())->name().c_str()); }
% gold t.o -static t.so gold: error: cannot mix -static with dynamic object t.so
lld/test/ELF/static-error.s | ||
---|---|---|
7 | POSIX sh does not support >& (but supports >&fd) You may use 2>&1 >/dev/null | FileCheck if you want to emphasize stderr is checked. |
lld/test/ELF/static-error.s | ||
---|---|---|
7 | 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. |
lld/test/ELF/static-error.s | ||
---|---|---|
7 | 2>&1 | FileCheck LG. |
lld/test/ELF/static-error.s | ||
---|---|---|
7 | I don't know how lit runs the script. On my machine, after running the test, I get a 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. |
POSIX sh does not support >& (but supports >&fd)
You may use 2>&1 >/dev/null | FileCheck if you want to emphasize stderr is checked.