forked from OSchip/llvm-project
648feabc65
When nonexistent linker inputs are passed to the driver, the linker now errors out, instead of the compiler. If the linker does not run, clang now emits a "warning: linker input unused" instead of an error for nonexistent files. The motivation for this change is that I noticed that `clang-cl /winsysroot sysroot main.cc ole32.lib` emitted a "ole32.lib not found" error, even though the linker finds it just fine when I run `clang-cl /winsysroot sysroot main.cc /link ole32.lib`. The same problem occurs if running `clang-cl main.cc ole32.lib` in a non-MSVC shell. The problem is that DiagnoseInputExistence() only looked for libs in %LIB%, but MSVCToolChain uses much more involved techniques. For this particular problem, we could make DiagnoseInputExistence() ask the toolchain to see if it can find a .lib file, but in general the driver can't know what the linker will do to find files, so it shouldn't try. For example, if we implement PR24616, lld-link will look in the registry to determine a good default for %LIB% if it isn't set. This is less or a problem for the gcc driver, since .a paths there are either passed via -l flags (which honor -L), or via a qualified path (that doesn't honor -L) -- but for example ld.lld's --chroot flag can also trigger this problem. Without this patch, `clang -fuse-ld=lld -Wl,--chroot,some/dir /file.o` will complain that `/file.o` doesn't exist, even though `clang -fuse-ld=lld -Wl,--chroot,some/dir -Wl,/file.o` succeeds just fine. This implements rnk's suggestion on the old bug PR27234. Differential Revision: https://reviews.llvm.org/D109624 |
||
---|---|---|
.. | ||
Inputs | ||
code-gen.f90 | ||
cpp-nocpp-command-line-macro.f90 | ||
cpp-nocpp-predefined-macro.F90 | ||
debug-measure-parse-tree.f90 | ||
debug-parsing-log.f90 | ||
debug-provenance.f90 | ||
driver-error-cc1.c | ||
driver-error-cc1.cpp | ||
driver-help-hidden.f90 | ||
driver-help.f90 | ||
driver-version.f90 | ||
dump-all.f90 | ||
dump-parse-tree-no-sema.f90 | ||
escaped-backslash.f90 | ||
fdefault.f90 | ||
fixed-free-detection.f90 | ||
fixed-free-flag.f90 | ||
fixed-line-length.f90 | ||
flarge-sizes.f90 | ||
frontend-forwarding.f90 | ||
get-definition.f90 | ||
implicit-none.f90 | ||
include-header.f90 | ||
init-only.f90 | ||
input-from-stdin.f90 | ||
intrinsic-module-path.f90 | ||
macro-def-undef.F90 | ||
macro-multiline.F90 | ||
missing-arg.f90 | ||
missing-input.f90 | ||
module-suffix.f90 | ||
output-paths.f90 | ||
parse-error.f95 | ||
phases.f90 | ||
plugin-invalid-name.f90 | ||
predefined-macros-compiler-version.F90 | ||
scanning-error.f95 | ||
std2018-wrong.f90 | ||
std2018.f90 | ||
syntax-only.f90 | ||
unparse-use-analyzed.f95 | ||
use-module-error.f90 | ||
use-module.f90 | ||
werror-parse.f | ||
werror-scan.f | ||
werror-sema.f90 | ||
werror-wrong.f90 | ||
write-module.f90 |