Clang Cross Compiling for ARM?

后端 未结 2 975
长发绾君心
长发绾君心 2021-01-30 07:34

Is it possible to set up Clang for cross compiling for the ARM processor? The host will likely be on x86 ( AMD64 - Probably Ubuntu 12.04 ) and the target would be ARM ( Raspberr

相关标签:
2条回答
  • 2021-01-30 07:46

    To cross-compile for Raspberry Pi running soft-float Linux distros add flags -ccc-host-triple arm-eabi -marm -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=softfp

    To cross-compile for Raspberry Pi running hard-float Linux distros use the flags -ccc-host-triple arm-eabi -marm -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard

    To cross-compile for Pandaboard use flags -ccc-host-triple arm-eabiv7 -mthumb -mfpu=neon-fp16 -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=hard (assuming that your Pandaboard runs Ubuntu)

    Note: more recent clang version use -target option instead of -ccc-host-triple

    0 讨论(0)
  • 2021-01-30 07:46

    See EmbToolkit project. It gives ability to generate clang/llvm or gcc based cross compiler toolchain.

    0 讨论(0)
提交回复
热议问题