[cfe-dev] Clang triple canonicalization
Dimitry Andric
dimitry at andric.com
Mon Aug 5 12:52:53 PDT 2013
We do the same in FreeBSD, e.g. simply return LLVM_DEFAULT_TARGET_TRIPLE. Now, in theory 'i586' is incorrect, as 'i386' means the *architecture*, not the CPU, but in practice it is used all over the place anyway. :-)
-Dimitry
On Aug 5, 2013, at 15:44, Kal Conley <kcconley at gmail.com> wrote:
> I figured out the normalization is done in llvm::sys::getDefaultTargetTriple. Changing the implementation to simply return LLVM_DEFAULT_TARGET_TRIPLE fixes the problem. I'm still not clear on why this normalization is done. Would it make sense to add a configure option to disable this normalization for cases where the target is known?
>
>
> 2013/8/2 Kal Conley <kcconley at gmail.com>
> Hi,
> I am trying to build clang as a cross compiler and I am having some trouble getting it working. I configured clang with cmake options:
>
> cmake ../llvm-3.3 -DCMAKE_BUILD_TYPE=Release -DLLVM_DEFAULT_TARGET_TRIPLE=i586-XXX-linux-gnu -DDEFAULT_SYSROOT=/usr/i586-XXX-linux-gnu/sys-root -DLLVM_TARGETS_TO_BUILD=X86
>
> But clang -v reports:
>
> Target: i386-XXX-linux-gnu
>
> So clang is canonicalizing the i586 into i386. This is causing clang to fail to find all the gnu cross tools with names /usr/bin/i586-XXX-linux-gnu-*
> Is there any good reason for this canonicalization? Does it make sense to disable it? What is the best way about solving this issue?
>
> Thanks!
> -Kal
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130805/811fbc0b/attachment.html>
More information about the cfe-dev
mailing list