[PATCH] D34446: [Support] sys::getProcessTriple should return a macOS triple using the system's version of macOS
Lang Hames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 27 14:09:53 PST 2022
lhames added inline comments.
================
Comment at: llvm/trunk/lib/Support/Unix/Host.inc:58
+ std::string TargetTripleString =
+ updateTripleOSVersion(LLVM_DEFAULT_TARGET_TRIPLE);
----------------
thakis wrote:
> This is the function that clang calls to determine its default triple (here: http://llvm-cs.pcc.me.uk/tools/clang/lib/Frontend/CompilerInvocation.cpp#3410)
>
> LLVM_DEFAULT_TARGET_TRIPLE is what we tell people to set when they build cross compilers. It's what we use to make sure our compiler isn't dependent on the host OS version.
>
> Changing this here to rewrite LLVM_DEFAULT_TARGET_TRIPLE to use the host OS version seems like the wrong thing to do, from the perspective of clang's default triple. Do you agree?
I missed this at the time.
It looks like this patch only partially changed the behavior here: We were already modifying the OS version for `-darwin` triples but now we're doing it for `-macos` too.
The JIT doesn't use `getDefaultTargetTriple`, so I don't mind if we switch to a behavior that makes more sense to clang. The `getProcessTriple` function should still update the version though.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D34446/new/
https://reviews.llvm.org/D34446
More information about the llvm-commits
mailing list