The linker wrapper does its own library searching for static archives
that can contain device code. The device linking phases happen before
the host linking phases so that we can generate the necessary
registration code and link it in with the rest of the code. Previously,
If a library containing needed device code was not found the execution
would continue silently until it failed with undefined symbols. This
patch allows the linker wrapper to perform its own check beforehand to
catch these errors.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
260 ms | x64 debian > Clang.Driver::linker-wrapper-image.c |
Event Timeline
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp | ||
---|---|---|
1278 | So if the library is found but not an archive we silently continue still? |
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp | ||
---|---|---|
1278 | In that case it won't be used for device linking so the host linker will handle that. |
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp | ||
---|---|---|
1278 | Can you add a comment, I still don't understand when/how this happens but a comment might do. |
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp | ||
---|---|---|
1278 | Sorry I didn't explain the logic correctly. The else means that we will error on any library that's found but not present in the linker wrapper. This conditional simply ensures that we only attempt to extract offloading files if it's in a static library. |
So if the library is found but not an archive we silently continue still?