【发布时间】:2020-10-29 09:13:58
【问题描述】:
我有一些关于使用介子交叉编译 STM32 的问题。我是介子的新手,并尝试用它编译 STM32 代码。我找到了这个存储库https://github.com/hwengineer/STM32F3Discovery-meson-example 并尝试改变它我需要它。
我的交叉文件是这样的
[binaries]
c = 'arm-none-eabi-gcc'
cpp = 'arm-none-eabi-g++'
ld = 'arm-none-eabi-ld'
ar = 'arm-none-eabi-ar'
as = 'arm-none-eabi-as'
size = 'arm-none-eabi-size'
objdump = 'arm-none-eabi-objdump'
objcopy = 'arm-none-eabi-objcopy'
strip = 'arm-none-eabi-strip'
gdb = 'arm-none-eabi-gdb'
terminal= 'x-terminal-emulator'
openocd = '/usr/local/bin/openocd'
exe_wrapper = 'meson_exe_wrapper.sh'
[properties]
c_args = [
'-mthumb', # define language
#------------------------------------
'-fshort-enums', # otherwise errors at linking...
'-fmessage-length=0', # all error warnings in a single line (default 72)
'-fsigned-char', # char is per default unsigned
'-ffunction-sections', # each function to a seperate section ==> Code-optimization / deletion
'-fdata-sections', # each variable to a seperate section ==> Code-optimization / deletion
'-Wall',
'-ffreestanding',
#------------------------------------
# '-flto',
]
c_link_args = [
'-nostdlib', # do not import the standard library's
# '-flto',
]
[host_machine]
system = 'none'
cpu_family = 'arm'
cpu = 'cortex-m3'
endian = 'little'
但是当我尝试编译介子时会给出这个
Build type: native build
Project name: thermometer_with_meson
Project version: undefined
C compiler for the host machine: cc (gcc 10.2.0 "cc (GCC) 10.2.0")
C linker for the host machine: cc ld.bfd 2.35
Host machine cpu family: x86_64
Host machine cpu: x86_64
主机应该是arm cortex-m3,但是好像有错误。
为什么介子忽略交叉文件?为什么主机是 x86-64?
顺便说一句,它给出了这样的错误,因为 x86_64 应该是 x86-64。
【问题讨论】:
标签: cross-compiling stm32 meson-build