代码之家  ›  专栏  ›  技术社区  ›  Red Riding Hood

--的主机标志/为cortex m4编译时配置

  •  1
  • Red Riding Hood  · 技术社区  · 8 年前

    我正在为ARM编译一个库,但是配置文件需要一个--host选项来进行交叉编译。

    在正常的简单情况下,我会使用

    CC = arm-none-eabi-gcc
    
    CFLAGS =--specs=nosys.specs -Wall -O2 -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math
    

    我试过了 ./configure --host=arm-none-eabi-gcc

    但这给了 checking host system type... Invalid configuration arm-none-eabi-gcc: machine arm-none-eabi not recognized

    我也试过了 --host=armv7e-m

    我试图搜索主机列表,但它们很旧/未维护/不完整:
    https://gcc.gnu.org/gcc-3.3/buildstat.html
    https://gcc.gnu.org/install/specific.html

    2 回复  |  直到 8 年前
        1
  •  2
  •   Kyrill    8 年前

    通常 --host 指定编译器将在其上运行的系统。生成的交叉编译器将为其生成代码的系统称为 --target . 例如,如果您计划在x86\u 64 Linux机器上运行交叉编译器,您可能需要类似的东西 --host=x86_64-unknown-linux-gnu . --target=arm-none-eabi .

    看这里 https://gcc.gnu.org/install/configure.html 关于如何配置GCC的示例(尽管它不是一个完整的指南)。

        2
  •  0
  •   Red Riding Hood    8 年前

    正在查看 http://git.savannah.gnu.org/cgit/autoconf.git/tree/build-aux/config.sub ,我可以使用 armv7 . 似乎转化为 armv7-unknown-none