Petr Hosek via llvm-dev
2021-Apr-04 23:24 UTC
[llvm-dev] Updating config.guess, license change
You can construct the triple from the variables CMake provides, we already do this for some of the targets: https://github.com/llvm/llvm-project/blob/00d5f1ecccc6d8ece9ac6dd19e9ad807c8a60097/llvm/cmake/modules/GetHostTriple.cmake I'd prefer expanding GetHostTriple.cmake until it covers all the targets we support. I don't think it'd necessarily require reimplementing all of config.guess, since config.guess covers a lot of targets most of which aren't supported by LLVM. On Sat, Apr 3, 2021 at 8:59 AM Harald van Dijk via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 02/04/2021 22:52, Michael Kruse wrote: > > Is there a possibility to ask CMake for the host's triple? > > There isn't, unfortunately: CMake does not use triples and does not > provide it in a variable. It does provide us with predefined variables > that provide information similar to what uname gives, which could be > used to build the triple ourselves, but that would amount to rewriting > config.guess in CMake. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210404/58d131d8/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3996 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210404/58d131d8/attachment.bin>
Harald van Dijk via llvm-dev
2021-Apr-05 08:44 UTC
[llvm-dev] Updating config.guess, license change
On 05/04/2021 00:24, Petr Hosek wrote:> You can construct the triple from the variables CMake provides, we > already do this for some of the targets: > https://github.com/llvm/llvm-project/blob/00d5f1ecccc6d8ece9ac6dd19e9ad807c8a60097/llvm/cmake/modules/GetHostTriple.cmake > <https://github.com/llvm/llvm-project/blob/00d5f1ecccc6d8ece9ac6dd19e9ad807c8a60097/llvm/cmake/modules/GetHostTriple.cmake>"Some of the targets" used to be only Windows, where we do not necessarily have a way to run config.guess at all. That seems like a perfectly good reason to me to add an exception for. I do not know why <https://reviews.llvm.org/D74256> then also added logic for AIX there. Either config.guess is buggy, or it is not. If config.guess is buggy, it is also buggy for every single autoconf-based project there is and will need to be fixed there as well. There has been no relevant change to upstream config.guess for AIX that I can see, but I may have missed something. If config.guess is not buggy, the change is wrong. Am I missing something here, perhaps some some scenario that LLVM supports but config.guess does not, that would make it correct to change that only in LLVM, and not in upstream config.guess?> I'd prefer expanding GetHostTriple.cmake until it covers all the targets > we support. I don't think it'd necessarily require reimplementing all of > config.guess, since config.guess covers a lot of targets most of which > aren't supported by LLVM.Not all, sure, but I do think you're underestimating how much work it will be, at least for an outside contributor who cannot ask people who have access to relevant systems to run some quick tests. Getting an overview of all targets supported by LLVM, the values the relevant CMake variables will be set to, and the triples that config.guess figures out for those systems, that would still be a massive amount of work. Once we have that, writing it up in CMake should be fairly easy, sure, but that's not where the main work will be. All that just to get a result we can get without any extra effort already. Cheers, Harald van Dijk