I want compile some binaries for RPi model B (revision 2.0) 512MB , I got installed arm-linux-gnueabi-gcc on Fedora 23

dnf copr enable lantw44/arm-linux-gnueabi-toolchain 
dnf install arm-linux-gnueabi-{binutils,gcc,glibc}

so arm-hello build with:

arm-linux-gnueabi-gcc -o arm-hello test.c

runs in my RPi , but

rm-linux-gnueabi-readelf -A arm-hello

says: Tag_CPU_arch: v5T


arm-linux-gnueabi-gcc  -o arm-hello test.c -march=armv6

I already got: Tag_CPU_arch: v6

What gcc flags are the standard for a RPi Model B (an armv6) ?

gcc show me the possible targets that I can choose :

  /usr/bin/arm-linux-gnueabi-gcc --target-help

  Known ARM ABIs (for use with the -mabi= option):
    aapcs aapcs-linux apcs-gnu atpcs iwmmxt

  Known ARM architectures (for use with the -march= option):
    armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a
    armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc iwmmxt iwmmxt2 native

  Known __fp16 formats (for use with the -mfp16-format= option):
    alternative ieee none

  Known ARM ,s (for use with the -mfpu= option):
    crypto-neon-fp-armv8 fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16 neon neon-fp-armv8 neon-fp16 neon-vfpv4 vfp vfp3 vfpv3 vfpv3-d16 vfpv3-d16-fp16
    vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16

  Valid arguments to -mtp=:
    auto cp15 soft

  Known floating-point ABIs (for use with the -mfloat-abi= option):
    hard soft softfp

  Known ARM CPUs (for use with the -mcpu= and -mtune= options):
    arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250
    arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d
    arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e
    arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a17 cortex-a17.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53
    cortex-a7 cortex-a72 cortex-a72.cortex-a53 cortex-a8 cortex-a9 cortex-m0 cortex-m0.small-multiply cortex-m0plus cortex-m0plus.small-multiply
    cortex-m1 cortex-m1.small-multiply cortex-m3 cortex-m4 cortex-m7 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 exynos-m1 fa526 fa606te fa626
    fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110
    xgene1 xscale

or asking in other way , what is the CPU, ARM ABI, floating-point ABI ,FPU , architecture etc ?


Answers to these questions:

https://github.com/raspberrypi/tools/tree/master/configs (on target options)

Which CPU flags are suitable for gcc on Raspberry Pi?

-march=armv6zk -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp
  • If you run gcc -v on the Raspberry Pi it will show the built in configuration. I believe --with-arch=armv6 is what you want. – Milliways Nov 16 '15 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.