diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2024-07-11 14:04:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 14:04:45 +0200 |
commit | 0248b597b1442ba803b61ba1d099ec8ef3872b2d (patch) | |
tree | f1b22e0ae7f10b65526a96a0800c9f545871270a /llvm/lib/Object/COFFImportFile.cpp | |
parent | e1bd337865fca9f455225ba37b76595d37bad213 (diff) | |
download | llvm-0248b597b1442ba803b61ba1d099ec8ef3872b2d.zip llvm-0248b597b1442ba803b61ba1d099ec8ef3872b2d.tar.gz llvm-0248b597b1442ba803b61ba1d099ec8ef3872b2d.tar.bz2 |
[clang][Driver] Fix safestack -u ordering (#98468)
When re-enabling safestack testing on Solaris after the unexplained
b0260c5b1052f8e3ff1ec77dc42a11f42da762cc, all tests `FAIL`ed to link:
```
Undefined first referenced
symbol in file
__safestack_unsafe_stack_ptr buffer-copy-vla.o
__safestack_init (command line)
ld: fatal: symbol referencing errors
```
The problem is that `-u __safestack_init` was passed to the linker after
the corresponding version of `libclang_rt.safestack-*.a`. Since the
Solaris linker (like Unix linkers for decades) respects the command line
argument order (unlike e.g. GNU ld which uses GNU getopt), this cannot
work. Fixed by moving the `-u` arg further to the front. Two affected
testcases were fixed accordingly.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`,
`x86_64-pc-linux-gnu`, and `sparc64-unknown-linux-gnu`.
Diffstat (limited to 'llvm/lib/Object/COFFImportFile.cpp')
0 files changed, 0 insertions, 0 deletions