简体   繁体   English

交叉编译和直接在目标上编译时,GCC臂选项之间的区别是什么?

[英]Difference between GCC arm options necessary when cross-compiling and when compiling directly on target?

I'm have created a c++ app and want to compile it for debian jessie 8.0 armbian target of a cubietruck board (ARM® Cortex™-A7 Dual-Core). 我已经创建了一个c ++应用程序,并希望将其编译为库房板(ARM®Cortex™-A7双核)的debian jessie 8.0 armbian目标。 The - cat /proc/cpuinfo gives : - cat /proc/cpuinfo给出:

Processor       : ARMv7 Processor rev 4 (v7l)
processor       : 0
BogoMIPS        : 956.30

processor       : 1
BogoMIPS        : 959.75

Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 4

Hardware        : sun7i
Revision        : 0000
Serial          : 1651668805c0e142
Chipid          : 16516688-80515475-52574848-05c0e142

and the - dpkg --print-architecture - dpkg --print-architecture

armhf

I have concluded that the related arm gcc option for cross compilation I need are: 我得出的结论是,我需要进行交叉编译的相关arm gcc选项是:

--with-abi=aapcs-linux  (-mabi)
--with-cpu=cortex-a7  (-mcpu)
--with-tune=cortex-a7 (-mtune)
--with-mode=arm/thumb  (-marm  -mthumb)
--with-fpu=neon-vfpv4  (-mfpu)
--with-float=hard 

If I want to build the same source directly on board is the option -march=native (if it is supported) sufficient or do I need any of the above flags as well? 如果我想直接在板上构建相同的源,则选项-march=native (如果支持)是否足够?或者我是否还需要上述任何标志?

To find what flags -march=native activates use gcc -march=native -Q --help=target . 要查找-march=native激活的标志,请使用gcc -march=native -Q --help=target

This is the output in my board (Pine64 - Cortex A53 with Linux 64 bits): 这是我板上的输出(Pine64-具有Linux 64位的Cortex A53):

debian@pine64:~$ gcc -march=native -Q --help=target
The following options are target specific:
    -mabi=ABI                           lp64
    -march=ARCH                         native
    -mbig-endian                        [disabled]
    -mbionic                            [disabled]
    -mcmodel=                           small
    -mcpu=CPU                           
    -mfix-cortex-a53-835769             [enabled]
    -mgeneral-regs-only                 [disabled]
    -mglibc                             [enabled]
    -mlittle-endian                     [enabled]
    -mlra                               [enabled]
    -momit-leaf-frame-pointer           [enabled]
    -mstrict-align                      [disabled]
    -mtls-dialect=                      desc
    -mtune=CPU                          
    -muclibc                            [disabled]
    ....
    [Omitted output]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM