On Fri, 15 Mar 2019 at 19:32, Klaus Rudolph <lts-rudolph@xxxxxx> wrote: > > I try to get a avr toolchain up and running. > > I have the following Makefile > > GCC_VER=8.3.0 > PRE_PREFIX=/opt > LINUX=linux-gnu > AVR=avr > > unpack: > mkdir unpack > ( cd unpack; \ > tar xf ../mpc* ;\ > tar xf ../mpfr* ; \ > tar xf ../gmp* ; \ > tar xf ../gcc* ; \ > tar xf ../binutils* ; \ > cd gcc* ;\ > mv ../mpc* ./mpc ;\ > mv ../mpfr* ./mpfr ; \ > mv ../gmp* ./gmp ; \ > ) > > > > avrbinutils: > ( cd unpack/binutils* ; \ > mkdir build_binutils_avr ; \ > cd build_binutils_avr ; \ > ../configure --prefix=$(PRE_PREFIX)/$(AVR)_$(GCC_VER) > --target=avr --disable-nls --enable-gold --enable-plugins; \ > make -j8 ; \ > sudo make install \ > ) > > avrgcc: > ( cd unpack/gcc* ; \ > mkdir build_gccavr; \ > cd build_gccavr ; \ > ../configure --prefix=$(PRE_PREFIX)/$(AVR)_$(GCC_VER) > --target=avr --enable-languages=c,c++ --enable-lto --disable-nls > --disable-libssp; \ > make ; \ > ) > > So I do: > make unpack > make avrbinutils > make avrgcc > > During compiling gcc for target avr I got: > > make[3]: Entering directory > '/home/krud/git_my_checkout/first/own_components/gcc_install/unpack/gcc-8.3.0/build_gccavr/gcc' > TARGET_CPU_DEFAULT="" \ > HEADERS="auto-host.h ansidecl.h" DEFINES="" \ > /bin/sh ../../gcc/mkconfig.sh config.h > TARGET_CPU_DEFAULT="" \ > HEADERS="options.h insn-constants.h config/elfos.h config/avr/elf.h > config/avr/avr-arch.h config/avr/avr.h config/avr/specs.h > config/dbxelf.h config/avr/avr-stdint.h config/avr/avrlibc.h > config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 > LIBC_BIONIC=3 LIBC_MUSL=4 WITH_AVRLIBC" \ > /bin/sh ../../gcc/mkconfig.sh tm.h > TARGET_CPU_DEFAULT="" \ > HEADERS="config/avr/avr-protos.h tm-preds.h" DEFINES="" \ > /bin/sh ../../gcc/mkconfig.sh tm_p.h > TARGET_CPU_DEFAULT="" \ > HEADERS="auto-host.h ansidecl.h" DEFINES="" \ > /bin/sh ../../gcc/mkconfig.sh bconfig.h > g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions > -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing > -Wwrite-strings -Wcast-qual -Wmissing-format-attribute > -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros > -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. > -Ibuild -I../../gcc -I../../gcc/build -I../../gcc/../include > -I../../gcc/../libcpp/include \ > -o build/genmodes.o ../../gcc/genmodes.c > /opt/avr_8.3.0/avr/bin/as: unrecognized option '--64' > make[3]: *** [Makefile:2669: build/genmodes.o] Error 1 > make[3]: Leaving directory > '/home/krud/git_my_checkout/first/own_components/gcc_install/unpack/gcc-8.3.0/build_gccavr/gcc' > make[2]: *** [Makefile:4254: all-gcc] Error 2 > make[2]: Leaving directory > '/home/krud/git_my_checkout/first/own_components/gcc_install/unpack/gcc-8.3.0/build_gccavr' > make[1]: *** [Makefile:889: all] Error 2 > make[1]: Leaving directory > '/home/krud/git_my_checkout/first/own_components/gcc_install/unpack/gcc-8.3.0/build_gccavr' > make: *** [Makefile.gcc8.3.0:65: avrgcc] Error 2 > > Looks very crazy, because it calls g++ from host and got an error from > avr-as if I did not interpret the things wrong here. Check the output of 'env' -- is /opt/avr_8.3.0/avr/bin in your PATH? Do you have any variables like AS_FOR_BUILD set?