This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Installing gcc-arm on OpenSUSE

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.

Parents Reply Children
  • Hi 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