-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang-offload-bundler mixes symbols from different objects when unbundling an archive #83509
Comments
FYI. @yxsamliu |
Sorry, I need to analyze this issue more carefully. It depends on some non-community changes. |
I have a concern about the code in commit #81700 at: This code is used to get a processed bundle in an ObjectFileHandler by using objcopy to process BundlerConfig.InputFileNames.front(). My concern is how does this code guarantee that BundlerConfig.InputFileNames.front() is connected to this instance of ObjectFileHandler? This caused a problem for me when unbundling an archive with multiple object files. I hit this problem when using the command sequence in my earlier comment. I have not been able to convert the command sequence into one that works with community tools, but I believe it should be possible when processing a multi-object archive. |
Good catch. The code assumes unbundling a non-archive file which has only one input. That is why it breaks for archive. |
Are you using some downstream llvm branch? Clang-offload-bundler in the trunk does not accept -type=aoo and also does not allow extract bundle entry for --targets=host-x86_64-unknown-linux-gnu
|
Yes, it is an INTEL customization. I was not able to figure out how to extract a multi-object archive with the official clang-offload-bundler. Is it possible? |
When unbundling an archive, need to save the content of each object file to a temporary file before passing it to llvm-objcopy, instead of passing the original input archive file to llvm-objcopy. Also allows extracting host bundles for archives. Fixes: llvm#83509
When unbundling an archive, need to save the content of each object file to a temporary file before passing it to llvm-objcopy, instead of passing the original input archive file to llvm-objcopy. Also allows extracting host bundles for archives. Fixes: #83509
Change to clang/lib/Driver/OffloadBundler.cpp in commit #81700 causes clang-offload-bundler to join symbols from different objects when unbundling an archive:
Source file s.cpp:
Source file t.cpp:
Commands:
The output of the nm command without the change is:
The output with the change is:
The text was updated successfully, but these errors were encountered: