Cross-compilation for Raspberry Pi in GCC. Where to start?

后端 未结 8 1605
轮回少年
轮回少年 2020-12-12 14:09

TL/DR: Where can I find more information about building a GCC 4.7.0 cross-compiling toolchain for ARM (gnueabi) platform (intended to run on

8条回答
  •  天命终不由人
    2020-12-12 14:14

    Here is a step-by-step guide How to build Raspberry Pi cross-compiler in Windows. The reason you are getting Illegal Instruction error is latest Raspbian is hardfp-enabled and requires appropriate patches for gcc and eglibc to support hardfp. Otherwise generated code will use different ABI, i.e. pass function arguments in different registers, so crash at runtime.

    Also misconfiguring GCC for ARMv7 (Raspebby Pi is ARMv6) may lead to Illegal Instruction error. Be sure to specify --with-arch=armv6 option when configuring GCC.

    The guide linked above is based on GCC 4.6.3 though. But I guess it should work with GCC 4.7 too.

提交回复
热议问题