[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369019: [Driver][Bundler] Improve bundling of object files. (authored by ABataev, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld accepted this revision. Hahnfeld added a comment. This revision is now accepted and ready to land. LG, thanks for the changes. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/ https://reviews.llvm.org/D65819

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 215421. ABataev added a comment. Rebase Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/ https://reviews.llvm.org/D65819 Files: test/Driver/clang-offload-bundler.c

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. Please submit the test changes unrelated to the code changes in a separate patch! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/ https://reviews.llvm.org/D65819 ___ cfe-commits

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D65819#1631410 , @Hahnfeld wrote: > The code changes look good to me, but the test doesn't pass on x86. We've > faced the same problem when `clang-offload-bundler` was initially committed > and the current testing is the best

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 215399. ABataev added a comment. Fixed comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/ https://reviews.llvm.org/D65819 Files: test/Driver/clang-offload-bundler.c test/Driver/clang-offload-bundler.c.o

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-15 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld requested changes to this revision. Hahnfeld added a comment. This revision now requires changes to proceed. The code changes look good to me, but the test doesn't pass on x86. We've faced the same problem when `clang-offload-bundler` was initially committed and the current testing is

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-14 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 215214. ABataev added a comment. Reworked to keep partial linking to make original host object available for analysis without unbundling. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/

Re: [PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-14 Thread Alexey Bataev via cfe-commits
I said this before that most probably this is the bug in partial linking, made by ld. But clang-offload-bundler is also nit quite correct here since the original host code is actually not unbundled. I'll fix the patch later today to keep the partial linking for the host object, but really

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-14 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. Okay, so I wasn't happy with the current explanations because I don't like "fixing" an issue without understanding the problem. Here's a small reproducer: $ cat main.cpp #include "test.h" int main(int argc, char *argv[]) { m[1] = 2; return 0; } $

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D65819#1627693 , @Hahnfeld wrote: > In D65819#1627638 , @ABataev wrote: > > > In D65819#1627631 , @Hahnfeld > > wrote: > > > > > In

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. In D65819#1627638 , @ABataev wrote: > In D65819#1627631 , @Hahnfeld wrote: > > > In D65819#1627620 , @ABataev wrote: > > > > > In D65819#1627600

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev marked an inline comment as done. ABataev added a comment. In D65819#1627631 , @Hahnfeld wrote: > In D65819#1627620 , @ABataev wrote: > > > In D65819#1627600 ,

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. In D65819#1627620 , @ABataev wrote: > In D65819#1627600 , @Hahnfeld wrote: > > > In D65819#1627036 , @ABataev wrote: > > > > > In D65819#1627032

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev marked an inline comment as done. ABataev added a comment. In D65819#1627600 , @Hahnfeld wrote: > In D65819#1627036 , @ABataev wrote: > > > In D65819#1627032 ,

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added inline comments. Comment at: tools/clang-offload-bundler/ClangOffloadBundler.cpp:541-549 std::vector ClangArgs = {"clang", -"-r", +"-c",

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. In D65819#1627036 , @ABataev wrote: > In D65819#1627032 , @Hahnfeld wrote: > > > In D65819#1617736 , @Hahnfeld > > wrote: > > > > > Will this

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D65819#1627032 , @Hahnfeld wrote: > In D65819#1617736 , @Hahnfeld wrote: > > > Will this patch change the ability to consume a bundled object file without > > calling the unbundler?

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. In D65819#1617736 , @Hahnfeld wrote: > Will this patch change the ability to consume a bundled object file without > calling the unbundler? Using known ELF tools on the produced object files was > an important design decision

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-13 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Ping. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65819/new/ https://reviews.llvm.org/D65819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-08 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Additional note. Seems to me, it has something to do with the partial linking. According to ld documentation, it is recommended to use `-Ur` option for partial linking of the C++ object files to resolve global constructors. -Ur For anything other than C++ programs,

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D65819#1617736 , @Hahnfeld wrote: > Can you detail what "incorrect linking" means? AFAIK the additional sections > were just bloating the executable, but how do they affect correctness? > > Will this patch change the ability

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-06 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. Can you detail what "incorrect linking" means? AFAIK the additional sections were just bloating the executable, but how do they affect correctness? Will this patch change the ability to consume a bundled object file without calling the unbundler? Using known ELF tools

[PATCH] D65819: [Driver][Bundler] Improve bundling of object files.

2019-08-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: yaxunl, tra, jlebar, hfinkel. Herald added a reviewer: jdoerfert. Herald added a project: clang. Previously, object files were bundled using partial linking. It resulted in the following structure of the bundled objects: