epenguin n00b
Joined: 07 Dec 2021 Posts: 25 Location: US
|
Posted: Mon Feb 14, 2022 3:32 pm Post subject: Failure to compile using arm-none-eabi from crossdev |
|
|
Here are the instructions I used to generate the toolchain: https://wiki.gentoo.org/wiki/How_to_build_a_toolchain_for_arm_cortex-m_and_cortex-r . This wiki contains instructions for building a really low footprint toolchain for cortex-m and cortex-r, but I've had a few issues with it.
When compiling this project:
https://github.com/blackmagic-debug/blackmagic
Here is the result:
https://dpaste.com/948Z296GQ
Specifically:
Code: | /usr/libexec/gcc/arm-none-eabi/ld: /usr/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-chk_fail.o): in function `__chk_fail':
chk_fail.c:(.text.__chk_fail+0x3e): undefined reference to `_exit'
/usr/libexec/gcc/arm-none-eabi/ld: /usr/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-signalr.o): in function `_kill_r':
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
/usr/libexec/gcc/arm-none-eabi/ld: /usr/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-signalr.o): in function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
/usr/libexec/gcc/arm-none-eabi/ld: /usr/lib/gcc/arm-none-eabi/11.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-writer.o): in function `_write_r':
writer.c:(.text._write_r+0x10): undefined reference to `_write'
collect2: error: ld returned 1 exit status
make[1]: *** [platforms/native/Makefile.inc:35: blackmagic_dfu.elf] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:17: all] Error 2 |
It would honestly be extremely convenient and preferable to just use the toolchain provided by arm. The gentoo wiki instructions I've linked above seem to imply it cuts a lot of the fat off and provides "a functioning multilib / multiarch for embedded arm development with small code output size". While this option is nice to have, it would be preferable to have a toolchain that can guarantee compatibility with as many cortex m and r devices as possible like the toolchain provided by arm. The reason I don't just use the one from arm is because for some reason (and if you know the reason I would also love to know why, sincerely) they compile gdb with ncurses 5 so I always get this error when using their provided arm-none-eabi-gdb:
Code: | error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory |
I know of a million little hacks to fix this, but this has been around for years and whoever maintains the toolchain at arm already knows about this and doesn't care so I'd really love to get crossdev working to produce a stable embedded arm toolchain. |
|