[llvm-dev] Cross-compiling for ARM Cortex-A9 on x86
Peter Smith via llvm-dev
llvm-dev at lists.llvm.org
Mon Feb 26 07:56:53 PST 2018
Hello Irune,
I tried to reproduce your command line options on a simple c file
containing some floating point instructions using the clang-3.8 binary
I have on my Ubuntu 16.04 machine with ARM_SYSROOT and
ARM_GCC_TOOLCHAIN configured to point at a Linaro Hard float toolchain
and clang used the hard float abi as expected. My clang-3.8 also
accepted -mfloat-abi=hard.
With my gcc toolchain the gnu/stubs-soft.h file is included from
gnu/stubs.h when __ARM_PCS_VFP is not defined.
With this in mind the only things I can think of are:
- There is something in your source code that is undefining __ARM_PCS_VFP.
- Your gcc toolchain has a different stubs.h that is always soft float.
As a first step; are you able to compile a hard float test program
that doesn't include anything from the C-library and does it use the
hard-float abi? If you can then I think there is likely to be
something in the source code or in the gcc toolchain you are
configuring against.
Regards
Peter
On 23 February 2018 at 16:40, Yarza Irune via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hello list,
>
>
>
> I have some problems using LLVM version 3.8.0 to cross-compile code for ARM
> Cortex-A9 on x86.
>
>
>
> I am trying to generate LLVM IR using Clang: clang -S --emit-llvm
> --target=armv7a-linux-gnueabihf --sysroot=$(ARM_SYSROOT)
> --gcc-toolchain=$(ARM_GCC_TOOLCHAIN) -c -o translated.ll
>
>
>
> But somehow clang it is trying to use soft-float and I get the following
> error: ‘gnu/stubs-soft.h’ file not found
>
>
>
> Is there any way I can specify to use hard floating point? I have tried
> -mfloat-abi=hard but Clang does not recognize it.
>
>
>
> Please, let me know if there is any other information you need.
>
>
>
> Thanks in advance,
>
>
>
> Irune
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
More information about the llvm-dev
mailing list