Rail Shafigulin via llvm-dev
2016-Mar-11 21:20 UTC
[llvm-dev] clang triple and clang target
Can someone explain what exactly a clang triple is (--triple option) and what is the connection between triple and a target? I know there is an article ( http://clang.llvm.org/docs/CrossCompilation.html) that show how to cross compile code, but I'm not clear about is why I need to specify triple, why I can't just say compile for a given target? Any help is appreciated. -- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160311/416c83be/attachment.html>
Joerg Sonnenberger via llvm-dev
2016-Mar-12 02:38 UTC
[llvm-dev] clang triple and clang target
On Fri, Mar 11, 2016 at 01:20:11PM -0800, Rail Shafigulin via llvm-dev wrote:> Can someone explain what exactly a clang triple is (--triple option) and > what is the connection between triple and a target? I know there is an > article ( http://clang.llvm.org/docs/CrossCompilation.html) that show how > to cross compile code, but I'm not clear about is why I need to specify > triple, why I can't just say compile for a given target?I assume with target you mean the backend? Consider the x86 backend. It supports 32bit and 64bit mode, with the GNU x32 ABI in between. There are three different executable formats support (ELF, PE, MachO) with different constraints. Some platforms require 32bit alignment of the stack, others require 128bit alignment. The list goes on. The triple specifies the combination of target, OS and potentially file format and sub-ABI. Joerg
Rail Shafigulin via llvm-dev
2016-Mar-12 19:51 UTC
[llvm-dev] clang triple and clang target
> > I assume with target you mean the backend? Consider the x86 backend. It > supports 32bit and 64bit mode, with the GNU x32 ABI in between. There > are three different executable formats support (ELF, PE, MachO) with > different constraints. Some platforms require 32bit alignment of the > stack, others require 128bit alignment. The list goes on. The triple > specifies > the combination of target, OS and potentially file format and sub-ABI. > > Joerg > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >Thanks for the response. I was trying to generate assembly which would use vector instructions. I need to see how they look, whether it is ARM, Mips or X86. However for some reason clang would generate an error saying that a given target does not exist. Here is the command line I used: clang -S test.c -o test.sse2.x86-64.s --target=x86-unknown-linux-eabi -mfloat-abi=hard -mcpu=x86-64 -mfpu=SSE2 -fslp-vectorize-aggressive -fslp-vectorize-aggressive -fslp-vectorize -fvectorize -fno-lax-vector-conversions Here is the response I got: clang: warning: argument unused during compilation: '-mfloat-abi=hard' clang: warning: argument unused during compilation: '-mcpu=x86-64' clang: warning: argument unused during compilation: '-mfpu=SSE2' error: unknown target triple 'x86-unknown-linux-eabi', please use -triple or -arch I tried every possible combination of --target I could think of but nothing worked. Would you mind helping me out? Any help is appreciated. -- Rail Shafigulin Software Engineer Esencia Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160312/49b23c81/attachment.html>