[AIX][clang][driver] Check the command string to the linker for exportlist opts
authorzhijian <zhijian@ca.ibm.com>
Tue, 30 Aug 2022 14:38:38 +0000 (10:38 -0400)
committerzhijian <zhijian@ca.ibm.com>
Tue, 30 Aug 2022 14:38:38 +0000 (10:38 -0400)
commitfafa48e7b51899f0fda80b0962679d57a1f58169
treef4b5685604c54cf0b89b228c967d0bbe23b355f0
parent123c4b02517865b11af1079d206bc838edad79a6
[AIX][clang][driver] Check the command string to the linker for exportlist opts
Summary:
Some of code in the patch are contributed by David Tenty.

1.  We currently only check driver Wl options and don't check for the plain -b, -Xlinker or other options which get passed through to the linker when we decide whether to run llvm-nm --export-symbols, so we may run it in situations where we wouldn't if the user had used the equivalent -Wl, prefixed options. If we run the export list utility when the user has specified an export list, we could export more symbols than they intended.
2.  Add a new functionality to allow redirecting the stdin, stdout, stderr of individual Jobs, if redirects are set for the Job use them, otherwise fall back to the global Compilation redirects if any.

Reviewers: David Tenty, Fangrui Song, Steven Wan
Differential Revision: https://reviews.llvm.org/D119147
clang/docs/ReleaseNotes.rst
clang/include/clang/Driver/Job.h
clang/lib/Driver/Job.cpp
clang/lib/Driver/ToolChains/AIX.cpp
clang/test/Driver/aix-ld.c