[llvm-dev] clang triple and clang target

Ramakrishna Mallireddy via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 14 12:32:54 PDT 2016


As --version output, your native target triple is:
 x86_64-unknown-linux-gnu, & for cross-compilation need to check the build
make file settings.

try with x86_64-unknown-linux-gnu, for linux-X86 target.

*This is related to llvm 3.9.0,*

  if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
  set(LLVM_NATIVE_ARCH X86)
elseif (LLVM_NATIVE_ARCH STREQUAL "x86")
  set(LLVM_NATIVE_ARCH X86)
elseif (LLVM_NATIVE_ARCH STREQUAL "amd64")
  set(LLVM_NATIVE_ARCH X86)
elseif (LLVM_NATIVE_ARCH STREQUAL "x86_64")
  set(LLVM_NATIVE_ARCH X86)
elseif (LLVM_NATIVE_ARCH MATCHES "sparc")
  set(LLVM_NATIVE_ARCH Sparc)
elseif (LLVM_NATIVE_ARCH MATCHES "powerpc")
  set(LLVM_NATIVE_ARCH PowerPC)
elseif (LLVM_NATIVE_ARCH MATCHES "aarch64")
  set(LLVM_NATIVE_ARCH AArch64)
elseif (LLVM_NATIVE_ARCH MATCHES "arm64")
  set(LLVM_NATIVE_ARCH AArch64)
elseif (LLVM_NATIVE_ARCH MATCHES "arm")
  set(LLVM_NATIVE_ARCH ARM)
elseif (LLVM_NATIVE_ARCH MATCHES "mips")
  set(LLVM_NATIVE_ARCH Mips)
elseif (LLVM_NATIVE_ARCH MATCHES "xcore")
  set(LLVM_NATIVE_ARCH XCore)
elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
  set(LLVM_NATIVE_ARCH MSP430)
elseif (LLVM_NATIVE_ARCH MATCHES "hexagon")
  set(LLVM_NATIVE_ARCH Hexagon)
elseif (LLVM_NATIVE_ARCH MATCHES "s390x")
  set(LLVM_NATIVE_ARCH SystemZ)
elseif (LLVM_NATIVE_ARCH MATCHES "wasm32")
  set(LLVM_NATIVE_ARCH WebAssembly)
elseif (LLVM_NATIVE_ARCH MATCHES "wasm64")
  set(LLVM_NATIVE_ARCH WebAssembly)
else ()
  message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()


On Tue, Mar 15, 2016 at 12:07 AM, Rail Shafigulin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> On Sat, Mar 12, 2016 at 2:38 PM, Tim Northover <t.p.northover at gmail.com>
> wrote:
>
>> On 12 March 2016 at 11:51, Rail Shafigulin via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> > I tried every possible combination of --target I could think of but
>> nothing
>> > worked. Would you mind helping me out?
>>
>> First, 64-bit x86 is "x86_64", and 32-bit is "i386" in the triple. For
>> ARM you'd probably want "thumbv8" or "aarch64". Also, "eabi" is only a
>> thing on ARM targets, try "gnu" for x86.
>>
>> Cheers.
>>
>> Tim.
>>
>
> Hi Tim.
>
> Thanks for the response. I tried the x86 suggestion but it didn't work.
> Clearly I'm doing something wrong, but I don't know what exactly. I would
> really appreciate your help in this. Here is the command line I'm using
>
> clang -S test.c -o test.sse2.x86_64.s --target=x86_64-pc-linux-gnu
> -mfloat-abi=hard -mcpu=k8 -mfpu=SSE2 -fslp-vectorize-aggressive
> -fslp-vectorize-aggressive -fslp-vectorize -fvectorize
> -fno-lax-vector-conversions -O3
>
> Here is the response that I get:
>
> clang-3.5: warning: argument unused during compilation: '-mfloat-abi=hard'
> clang-3.5: warning: argument unused during compilation: '-mcpu=k8'
> clang-3.5: warning: argument unused during compilation: '-mfpu=SSE2'
> error: unable to create target: 'No available targets are compatible with
> this triple, see -version for the available targets.'
>
> clang --version command produces the following result:
>
> clang version 3.5.0
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
> test.c is attached to this email.
>
> So what am I doing wrong?
>
> --
> Rail Shafigulin
> Software Engineer
> Esencia Technologies
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://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/20160315/1771bf46/attachment.html>


More information about the llvm-dev mailing list