[Lldb-commits] [PATCH] D134751: [lldb] Fix running tests when LLVM target triple is different from host
Alvin Wong via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Sep 29 04:15:41 PDT 2022
alvinhochun added a comment.
Thanks for the review.
In D134751#3818743 <https://reviews.llvm.org/D134751#3818743>, @JDevlieghere wrote:
> Supporting builds with different host and target triples makes sense. However, I have a few concerns about the current patch:
>
> - I wouldn't cal it the "host triple". The API tests (`dotest.py`) support running the test suite for a different platform/architecture. Take a look at the Darwin builder and you'll see a bunch of support for that.
How about calling it "clang triple"?
> - How does this interact with the `-arch` flag? When the host and target triple differ, which part of the triple is different? In theory it can be any part, but maybe your use case could be covered by setting the `--arch` flag?
If I run Clang with `--target=x86_64-linux-gnu -m32` then it automatically targets `i386-linux-gnu`, so I suppose -arch should override the arch part of the target, which is correct. `DarwinBuilder::getArchCFlags`on the other hand has a different handling which generates a `-target` option from arch and other Apple-specific details without considering the new host-triple flag (or whatever we end up calling it), so it should behave the same as before this change.
For me, my Linux native build has the default target triple configured to x86_64-w64-windows-gnu, and linking of lldb tests fail due to missing mingw-w64 libraries. (Even if they do link the tests probably won't work anyway.) The Shell tests that use the %clang_host lit substitution work because they include the host --target flag, so I thought the tests using the build scripts should do the same.
> - This doesn't update `getTriple` in `builder.py` which is necessary for some of the decorators to work (in particular the ones that invoke the compiler to see if something is supported).
I see, I will change this too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134751/new/
https://reviews.llvm.org/D134751
More information about the lldb-commits
mailing list