Is it just me or are the install instructions for gcc-arm missing some information? I've downloaded gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2 and uncompressed it. The readme file in there states that all you have to do is add the bin directory to the $PATH. What could be easier? And yes that is easy. The problem with that is that whilst you can find the executable arm-none-eabi-gcc, as it's now in the PATH, the compiler can't find anything it needs to actually work. I can't think of a good analogy at the moment. :-(
So maybe this is the wrong forum for this question. Perhaps it's not even supported, but just in case it is, or somebody in here knows anything about it what are the "real" install instructions. Say for example you had a file containing the text:
#include <stdio.h>
void main(void)
{
}
How would you get that to compile? Actually lets make it even simpler and remove the include file, the linker will probably fall over if you ever got that far.
I usually use other processors but the 1Bitsy kickstarter was an easy in to ARM which I've always meant to have a look at. So that dev board is using an ARM Cortex-M4F so maybe we could try compile with "arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 main.c"
as: unrecognized option '-mcpu=cortex-m4'
Oops the tool chain is executing the wrong executable. Install instructions Fail! :-(
For the laugh lets try clone and make libopencm3 Oops can't find include files yet another fail :-(
It's just not my day.
I have to agree that after testing it, the provided compiler is not very useful. Also, the GOLD linker is extremely useful on ARM, and yet is not packaged with the currently provided compiling tools, which seem to be oriented for bare-metal programs makers.
I'd recommend using the Linaro binaries provided on the Linaro website instead, for the moment :
https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/
Add the bin path to your PATH, and don't forget to -fuse-ld=gold (or copy arm-linux-gnueabihf-ld.gold over arm-linux-gnueabihf-ld) if you compile standard binaries. LD.BFD is only useful for the kernel, which have issues with GOLD.
Hi,
Could you run the same command but adding -v in the list of options and show us the output? Many people (including myself) use this tarball and it really should be as simple as adding the right path into the PATH environment variable.
Best regards.
Thanks for the '-v' option that shed a bit of light on my problem. When I executed that I got a bit of a mess:
$ arm-none-eabi-gcc -vUsing built-in specs.COLLECT_GCC=arm-none-eabi-gccCOLLECT_LTO_WRAPPER=/usr/lib64/gcc/arm-suse-linux-gnueabi/6/lto-wrapperTarget: arm-suse-linux-gnueabiConfigured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++ --enable-checking=release --with-gxx-include-dir=/usr/include/c++/6 --enable-ssp --disable-libssp --disable-libvtv --disable-libmpx --disable-libcc1 --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --with-default-libstdcxx-abi=gcc4-compatible --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-6 --program-prefix=arm-suse-linux-gnueabi- --target=arm-suse-linux-gnueabi --disable-nls --with-sysroot=/usr/arm-suse-linux-gnueabi --with-build-sysroot=/ --with-build-time-tools=/usr/arm-suse-linux-gnueabi/bin --with-arch=armv6zk --with-tune=arm1176jzf-s --with-float=hard --with-abi=aapcs-linux --with-fpu=vfp --disable-sjlj-exceptions --build=x86_64-suse-linux --host=x86_64-suse-linuxThread model: posixgcc version 6.2.1 20160826 [gcc-6-branch revision 239773] (SUSE Linux)
That is outputting a lot of "arm-suse-linux-gnueabi" which led me to look at what I've got installed from the suse package manager. I had "cross-arm-gcc6" installed which for some reason is confusing things, so I removed that package. Then tried again with the "-v" option, which gave:
$ arm-none-eabi-gcc -vbash: /usr/bin/arm-none-eabi-gcc: No such file or directory
That's a strange output given that the executable is in the path:
$ which arm-none-eabi-gcc /home/john/Install/gcc-arm/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc
so I'll try the '-v' with the executable explicitly defined:
$ /home/john/Install/gcc-arm/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc -vUsing built-in specs.COLLECT_GCC=/home/john/Install/gcc-arm/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gccCOLLECT_LTO_WRAPPER=/home/john/Install/gcc-arm/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/lto-wrapperTarget: arm-none-eabiConfigured with: /tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/src/gcc/configure --target=arm-none-eabi --prefix=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native --libexecdir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/lib --infodir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/install-native/arm-none-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-native/host-libs/usr --with-mpfr=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-native/host-libs/usr --with-mpc=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-native/host-libs/usr --with-isl=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-native/host-libs/usr --with-libelf=/tmp/jenkins-GCC-6-buildandreg-104_20170216_1487268972/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors 6-2017-q1-update' --with-multilib-list=rmprofileThread model: singlegcc version 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512] (GNU Tools for ARM Embedded Processors 6-2017-q1-update)
That looks better but it's funny that I have to explicitly define the location of the executable that's never going to work with a Makefile. I'll keep banging at it. As you say it should be as simple as adding it to the PATH. Maybe I'll reboot this machine and add it into bashrc
Try in a new shell or new terminal to see if adding the toolchain in the PATH is enough.
I can't seem to find ARM's GCC version anymore on the website. (´・ω・` )
So, meanwhile, I'll paste the result of the Linaro GCC build, provided by Linaro directly on their website.
$ arm-linux-gnueabihf-gcc -v -o test test.c Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-gcc COLLECT_LTO_WRAPPER=/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/lto-wrapper Target: arm-linux-gnueabihf Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/snapshots/gcc-linaro-6.2-2016.11/configure SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --enable-gnu-indirect-function --disable-multilib --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu Thread model: posix gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/cc1 -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf -iprefix /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/ -isysroot /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc test.c -quiet -dumpbase test.c -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu -auxbase test -version -o /tmp/.private/gamer/cc4R4IfE.s GNU C11 (Linaro GCC 6.2-2016.11) version 6.2.1 20161016 (arm-linux-gnueabihf) compiled by GNU C version 4.8.4, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/6.2.1/include" ignoring nonexistent directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/local/include/arm-linux-gnueabihf" ignoring nonexistent directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/local/include" ignoring duplicate directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/6.2.1/include-fixed" ignoring duplicate directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/include" ignoring nonexistent directory "/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf" #include "..." search starts here: #include <...> search starts here: /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/include /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/include-fixed /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/include /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/include End of search list. GNU C11 (Linaro GCC 6.2-2016.11) version 6.2.1 20161016 (arm-linux-gnueabihf) compiled by GNU C version 4.8.4, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version none GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 3716125e9cf06213d6fc4c676b78a52b COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/as -v -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -meabi=5 -o /tmp/.private/gamer/ccnpsDk2.o /tmp/.private/gamer/cc4R4IfE.s GNU assembler version 2.27.0 (arm-linux-gnueabihf) using BFD version (Linaro_Binutils-2016.11) 2.27.0.20161019 COMPILER_PATH=/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/bin/ LIBRARY_PATH=/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/lib/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/lib/:/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/collect2 -plugin /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/liblto_plugin.so -plugin-opt=/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.1/lto-wrapper -plugin-opt=-fresolution=/tmp/.private/gamer/ccDgwdqq.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc --build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o test /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/crt1.o /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/crti.o /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/crtbegin.o -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1 -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/../../../../arm-linux-gnueabihf/lib -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/lib -L/tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib /tmp/.private/gamer/ccnpsDk2.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.2.1/crtend.o /tmp/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/crtn.o COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
The test.c code was :
#include <stdio.h> int main() { printf("Meow !\n"); return 0; }
Just had to add the extracted folder's bin path in $PATH and it worked. You want to provide a link to that one, IMHO.
Hi Myy,The page for the GNU ARM Embedded Toolchain is [1] and you can find the download page at [2].[1] https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/[2] https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloadsBest regards.
Hi Thomas Preudhomme and thanks for the links !
I was searching for GCC. I should have search for GNU toolchain I guess.
So here's the failing procedure :
$ cd /tmp$ ls$ nano test.c$ gcc -o test test.c
(This one worked fine)
$ rm test$ tar jxvf ~/Download/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 $ export PATH=$PATH:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/$ arm-none-eabi-gcc -o test test.c
/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit': exit.c:(.text.exit+0x2c): undefined reference to `_exit' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r': sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r': writer.c:(.text._write_r+0x24): undefined reference to `_write' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r': closer.c:(.text._close_r+0x18): undefined reference to `_close' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r': lseekr.c:(.text._lseek_r+0x24): undefined reference to `_lseek' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r': readr.c:(.text._read_r+0x24): undefined reference to `_read' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r': fstatr.c:(.text._fstat_r+0x20): undefined reference to `_fstat' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r': isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty' collect2: error: ld returned 1 exit status
$ arm-none-eabi-gcc -v -o test test.c
Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/lto-wrapper Target: arm-none-eabi Configured with: /tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/src/gcc/configure --target=arm-none-eabi --prefix=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native --libexecdir=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/lib --infodir=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/install-native/arm-none-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/build-native/host-libs/usr --with-mpfr=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/build-native/host-libs/usr --with-mpc=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/build-native/host-libs/usr --with-isl=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/build-native/host-libs/usr --with-libelf=/tmp/jenkins-GCC-6-buildandreg-223_20170621_1498033910/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors 6-2017-q2-update' --with-multilib-list=rmprofile Thread model: single gcc version 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437] (GNU Tools for ARM Embedded Processors 6-2017-q2-update) COLLECT_GCC_OPTIONS='-v' '-o' 'test' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/cc1 -quiet -v -iprefix /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/ -isysroot /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi -D__USES_INITFINI__ test.c -quiet -dumpbase test.c -auxbase test -version -o /tmp/.private/gamer/cch8bGix.s GNU C11 (GNU Tools for ARM Embedded Processors 6-2017-q2-update) version 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437] (arm-none-eabi) compiled by GNU C version 4.8.4, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory "/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/6.3.1/include" ignoring nonexistent directory "/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi/usr/local/include" ignoring duplicate directory "/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/6.3.1/include-fixed" ignoring duplicate directory "/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include" ignoring nonexistent directory "/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi/usr/include" #include "..." search starts here: #include <...> search starts here: /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/include /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/include-fixed /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include End of search list. GNU C11 (GNU Tools for ARM Embedded Processors 6-2017-q2-update) version 6.3.1 20170620 (release) [ARM/embedded-6-branch revision 249437] (arm-none-eabi) compiled by GNU C version 4.8.4, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 641331eaad782cbf47c35b6517b58088 COLLECT_GCC_OPTIONS='-v' '-o' 'test' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/as -v -meabi=5 -o /tmp/.private/gamer/ccUSnpQx.o /tmp/.private/gamer/cch8bGix.s GNU assembler version 2.28.0 (arm-none-eabi) using BFD version (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 2.28.0.20170620 COMPILER_PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ LIBRARY_PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/:/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi/lib/ COLLECT_GCC_OPTIONS='-v' '-o' 'test' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/collect2 -plugin /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/liblto_plugin.so -plugin-opt=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/lto-wrapper -plugin-opt=-fresolution=/tmp/.private/gamer/ccTFWJoy.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc --sysroot=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi -X -o test /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o -L/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1 -L/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc -L/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib -L/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../arm-none-eabi/lib /tmp/.private/gamer/ccUSnpQx.o --start-group -lgcc -lc --end-group /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit': exit.c:(.text.exit+0x2c): undefined reference to `_exit' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r': sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r': writer.c:(.text._write_r+0x24): undefined reference to `_write' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r': closer.c:(.text._close_r+0x18): undefined reference to `_close' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r': lseekr.c:(.text._lseek_r+0x24): undefined reference to `_lseek' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r': readr.c:(.text._read_r+0x24): undefined reference to `_read' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r': fstatr.c:(.text._fstat_r+0x20): undefined reference to `_fstat' /tmp/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r': isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty' collect2: error: ld returned 1 exit status
Yes this is targeting bare-metal systems so you should define at least some of these (eg. _sbrk which malloc uses) in the application for it to work. If doing semihosting you can use -specs=rdimon.specs which will define these. Otherwise, you can use -specs=nosys.specs that will silence this but as I said, at least some of them should be defined by you.Best regards.