如何构建支持ARMV8M的GCC工具链

发布于 2025-02-12 13:04:38 字数 3955 浏览 0 评论 0原文

我已经下载了GCC 11.2(GCC-SRC-SNAPSHOT-11.2-2022.02.02.tar.xz)的源代码。

我需要使用某些CXX标志来构建此GCC工具链,以禁用冗长的异常。 我需要此工具链主要支持Cortex M33 ARMV8体系结构的构建代码。

我尝试使用以下配置选项。

../configure --target=arm-none-eabi   --prefix=/home/hdd2/arm_gcc_11/build --with-gmp=/home/hdd2/arm_gcc_11/tools/ --with-mpfr=/home/hdd2/arm_gcc_11/tools/ --with-mpc=/home/hdd2/arm_gcc_11/tools/  --with-mode=thumb  --with-no-thumb-interwork   --enable-languages="c,c++" --enable-cxx-flags='--disable-libstdcxx-verbose'

但是,当我尝试使用此GCC构建源代码时,我会遇到以下错误。我在此处添加了冗长的输出,以更好地理解。

Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: ../configure --target=arm-none-eabi --prefix=/home/hdd2/arm_gcc_11/build --with-gmp=/home/hdd2/arm_gcc_11/tools/ --with-mpfr=/home/hdd2/arm_gcc_11/tools/ --with-mpc=/home/hdd2/arm_gcc_11/tools/ --with-mode=thumb --with-no-thumb-interwork --enable-languages=c,c++ --enable-cxx-flags=--disable-libstdcxx-verbose
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220111 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-builtin' '-mfpu=fpv5-sp-d16' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-implicit-function-declaration' '-Wno-unused-function' '-Wno-unused-but-set-variable' '-g' '-Os' '-fno-strict-aliasing' '-fomit-frame-pointer' '-mcpu=cortex-m33' '-mcmse' '-mfloat-abi=soft' '-I' '.' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/../framework/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/../external/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/net/lwip/src/include' '-D' '__KERNEL__' '-pipe' '-ffunction-sections' '-fdata-sections' '-mthumb' '-mcmse' '-v' '-D' 'CONFIG_PLATFORM_8721D' '-D' 'CONFIG_USE_MBEDTLS_ROM_ALG' '-D' 'DM_ODM_SUPPORT_TYPE=32' '-D' 'STD_PRINTF' '-D' 'CONFIG_PLATFORM_TIZENRT_OS=1' '-D' 'ARM_CORE_CM4' '-o' 'os_start.o' '-mlibarch=armv8-m.main+dsp' '-march=armv8-m.main+dsp'
 /home/hdd2/arm_gcc_11/build/libexec/gcc/arm-none-eabi/11.2.1/cc1 -quiet -v -I . -imultilib thumb -D__USES_INITFINI__ -D __KERNEL__ -D CONFIG_PLATFORM_8721D -D CONFIG_USE_MBEDTLS_ROM_ALG -D DM_ODM_SUPPORT_TYPE=32 -D STD_PRINTF -D CONFIG_PLATFORM_TIZENRT_OS=1 -D ARM_CORE_CM4 -isystem /home/kishore/tinyara/TizenRT_kishore/os/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/../framework/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/../external/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/net/lwip/src/include init/os_start.c -quiet -dumpbase os_start.c -dumpbase-ext .c -mfpu=fpv5-sp-d16 -mcpu=cortex-m33 -mcmse -mfloat-abi=soft -mthumb -mcmse -mlibarch=armv8-m.main+dsp -march=armv8-m.main+dsp -g -Os -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable -version -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -o - |
 as -march=armv8-m.main+dsp -mfloat-abi=soft -mfpu=fpv5-sp-d16 -meabi=5 -o os_start.o
GNU C17 (GCC) version 11.2.1 20220111 (arm-none-eabi)
    compiled by GNU C version 7.5.0, GMP version 6.2.1, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.19-GMP

warning: GMP header version 6.2.1 differs from library version 6.1.2.
warning: MPFR header version 3.1.6 differs from library version 3.1.4.
warning: MPC header version 1.0.3 differs from library version 1.1.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/hdd2/arm_gcc_11/build/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/sys-include"
ignoring nonexistent directory "/home/hdd2/arm_gcc_11/build/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/include"

Compiler executable checksum: Assembler messages:
Fatal error: invalid -march= option: `armv8-m.main+dsp'

我不确定为什么它不支持ARMV8-m.main+DSP。有什么建议吗?

问候

I have downloaded the source code for GCC 11.2 (gcc-arm-src-snapshot-11.2-2022.02.tar.xz).

I need to build this GCC toolchain with certain cxx flags to disable verbose exceptions.
I need this toolchain to mainly support building code for Cortex M33 ARMV8 architecture.

I have tried using the following config options.

../configure --target=arm-none-eabi   --prefix=/home/hdd2/arm_gcc_11/build --with-gmp=/home/hdd2/arm_gcc_11/tools/ --with-mpfr=/home/hdd2/arm_gcc_11/tools/ --with-mpc=/home/hdd2/arm_gcc_11/tools/  --with-mode=thumb  --with-no-thumb-interwork   --enable-languages="c,c++" --enable-cxx-flags='--disable-libstdcxx-verbose'

However, when I try to build my source code with this GCC, I am getting following error. I have added the verbose output here for better understanding.

Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: ../configure --target=arm-none-eabi --prefix=/home/hdd2/arm_gcc_11/build --with-gmp=/home/hdd2/arm_gcc_11/tools/ --with-mpfr=/home/hdd2/arm_gcc_11/tools/ --with-mpc=/home/hdd2/arm_gcc_11/tools/ --with-mode=thumb --with-no-thumb-interwork --enable-languages=c,c++ --enable-cxx-flags=--disable-libstdcxx-verbose
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220111 (GCC) 
COLLECT_GCC_OPTIONS='-c' '-fno-builtin' '-mfpu=fpv5-sp-d16' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-Wno-implicit-function-declaration' '-Wno-unused-function' '-Wno-unused-but-set-variable' '-g' '-Os' '-fno-strict-aliasing' '-fomit-frame-pointer' '-mcpu=cortex-m33' '-mcmse' '-mfloat-abi=soft' '-I' '.' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/../framework/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/../external/include' '-isystem' '/home/kishore/tinyara/TizenRT_kishore/os/net/lwip/src/include' '-D' '__KERNEL__' '-pipe' '-ffunction-sections' '-fdata-sections' '-mthumb' '-mcmse' '-v' '-D' 'CONFIG_PLATFORM_8721D' '-D' 'CONFIG_USE_MBEDTLS_ROM_ALG' '-D' 'DM_ODM_SUPPORT_TYPE=32' '-D' 'STD_PRINTF' '-D' 'CONFIG_PLATFORM_TIZENRT_OS=1' '-D' 'ARM_CORE_CM4' '-o' 'os_start.o' '-mlibarch=armv8-m.main+dsp' '-march=armv8-m.main+dsp'
 /home/hdd2/arm_gcc_11/build/libexec/gcc/arm-none-eabi/11.2.1/cc1 -quiet -v -I . -imultilib thumb -D__USES_INITFINI__ -D __KERNEL__ -D CONFIG_PLATFORM_8721D -D CONFIG_USE_MBEDTLS_ROM_ALG -D DM_ODM_SUPPORT_TYPE=32 -D STD_PRINTF -D CONFIG_PLATFORM_TIZENRT_OS=1 -D ARM_CORE_CM4 -isystem /home/kishore/tinyara/TizenRT_kishore/os/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/../framework/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/../external/include -isystem /home/kishore/tinyara/TizenRT_kishore/os/net/lwip/src/include init/os_start.c -quiet -dumpbase os_start.c -dumpbase-ext .c -mfpu=fpv5-sp-d16 -mcpu=cortex-m33 -mcmse -mfloat-abi=soft -mthumb -mcmse -mlibarch=armv8-m.main+dsp -march=armv8-m.main+dsp -g -Os -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-implicit-function-declaration -Wno-unused-function -Wno-unused-but-set-variable -version -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -o - |
 as -march=armv8-m.main+dsp -mfloat-abi=soft -mfpu=fpv5-sp-d16 -meabi=5 -o os_start.o
GNU C17 (GCC) version 11.2.1 20220111 (arm-none-eabi)
    compiled by GNU C version 7.5.0, GMP version 6.2.1, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.19-GMP

warning: GMP header version 6.2.1 differs from library version 6.1.2.
warning: MPFR header version 3.1.6 differs from library version 3.1.4.
warning: MPC header version 1.0.3 differs from library version 1.1.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/hdd2/arm_gcc_11/build/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/sys-include"
ignoring nonexistent directory "/home/hdd2/arm_gcc_11/build/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/include"

Compiler executable checksum: Assembler messages:
Fatal error: invalid -march= option: `armv8-m.main+dsp'

I am not sure why it is not supporting armv8-m.main+dsp. Any suggestions pls?

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宁愿没拥抱 2025-02-19 13:04:38

我发现手动建造海湾合作委员会非常困难。最终决定使用Crosstool-NG。感谢您的回答。

I found it too difficult to build gcc manually. Finally decided to use crosstool-ng. Thanks for your answers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文