Hello, Yes, the same prefix should be used for binutils and gcc, and that is what the doc says ... Now I have a brand new gcc to play with ... I just hope I don't spend more time debugging the compiler than my project, but that is the fun part.
Regards Francois On Thu, Aug 2, 2012 at 7:39 PM, Rolf Ebert <rolf.ebert....@gmx.de> wrote: > If you dont use the same --prefix for binutils and gcc you should be quite > sure of what you are doing. At least ensure that the AVR as is earlier in > the path than the standard as. > > hth > Rolf > > Am 02.08.2012 um 16:04 schrieb Francois Lorrain < > francois.lorr...@gmail.com>: > > Hello, > > I think there might be something going on (or I am doing the same > mistake), after trying to create a recent version of the AVR compiler, I am > getting : > > $ avr-gcc -v test.c > Using built-in specs. > COLLECT_GCC=avr-gcc > COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/avr/4.7.2/lto-wrapper > Target: avr > Configured with: /usr/src/gcc-4_7-branch/configure -v > --enable-languages=c,c++ --enable-shared --with-system-zlib > --enable-long-long --enable-nls --without-included-gettext --disable-libssp > --target=avr > Thread model: single > gcc version 4.7.2 20120802 (prerelease) (GCC) > COLLECT_GCC_OPTIONS='-v' > /usr/local/libexec/gcc/avr/4.7.2/cc1 -quiet -v test.c -quiet -dumpbase > test.c -auxbase test -version -o /tmp/ccs8LCB0.s > GNU C (GCC) version 4.7.2 20120802 (prerelease) (avr) > compiled by GNU C version 4.7.1, GMP version 5.0.5, MPFR version > 3.1.0-p10, MPC version 0.9 > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > ignoring nonexistent directory > "/usr/local/lib/gcc/avr/4.7.2/../../../../avr/sys-include" > ignoring nonexistent directory > "/usr/local/lib/gcc/avr/4.7.2/../../../../avr/include" > #include "..." search starts here: > #include <...> search starts here: > /usr/local/lib/gcc/avr/4.7.2/include > /usr/local/lib/gcc/avr/4.7.2/include-fixed > End of search list. > GNU C (GCC) version 4.7.2 20120802 (prerelease) (avr) > compiled by GNU C version 4.7.1, GMP version 5.0.5, MPFR version > 3.1.0-p10, MPC version 0.9 > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > Compiler executable checksum: 7512b8302895f73b499cc5d82f175245 > COLLECT_GCC_OPTIONS='-v' > as -o /tmp/ccUYrflj.o /tmp/ccs8LCB0.s > /tmp/ccs8LCB0.s: Assembler messages: > /tmp/ccs8LCB0.s:13: Error: too many memory references for `in' > /tmp/ccs8LCB0.s:14: Error: too many memory references for `in' > /tmp/ccs8LCB0.s:19: Error: no such instruction: `ldi r24,0' > /tmp/ccs8LCB0.s:20: Error: no such instruction: `ldi r25,0' > > I am on debian wheezy with the package provided avr-binutils and avr-libc. > > The test program is just : > > int main () { > return 0; > } > > Here the compiler is using "as"(x86) instead of "avr-as" so it cannot > compile the assembler output of the compiler. > > so either there is a missing option to the configure script for gcc. Do we > need to provide --program-prefix=avr- configure option ? > > Regards > > Francois > > > On Thu, Aug 2, 2012 at 3:06 PM, Kaan Akşit <kun...@gmail.com> wrote: > >> Dear Senthil, >> >> Unfortunately, I still have the same error in avr-libc compilation :( >> Here is the result of a sample compilation after following your tutorial: >> >> kaan@SAHILEVLERI ~ $ avr-gcc -mmcu=atmega8 -v -c test.c >> >> Using built-in specs. >> COLLECT_GCC=avr-gcc >> Target: avr >> Configured with: ../gcc-4.7.1/configure --target=avr >> --mandir=/usr/share/man --datadir=/usr/share -enable-languages=c,c++ >> --disable-nls --disable-libssp --with-dwarf2 --with-system-zlib >> --enable-vrsion-specific-runtime-libs --with-pkgversion='Pardus Linux' >> --with-bugurl=http://bugs.pardus.org.r >> >> Thread model: single >> gcc version 4.7.1 (Pardus Linux) >> COLLECT_GCC_OPTIONS='-mmcu=atmega8' '-v' '-c' >> /usr/local/libexec/gcc/avr/4.7.1/cc1 -quiet -v -imultilib avr4 test.c >> -quiet -dumpbase test.c -mmu=atmega8 -auxbase test -version -o >> /tmp/ccEgUGtP.s >> >> GNU C (Pardus Linux) version 4.7.1 (avr) >> compiled by GNU C version 4.5.3, GMP version 5.0.1, MPFR version >> 2.4.2, MPC version 0.8.2 >> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 >> ignoring nonexistent directory >> "/usr/local/lib/gcc/avr/4.7.1/../../../../avr/sys-include" >> ignoring nonexistent directory >> "/usr/local/lib/gcc/avr/4.7.1/../../../../avr/include" >> >> #include "..." search starts here: >> #include <...> search starts here: >> /usr/local/lib/gcc/avr/4.7.1/include >> /usr/local/lib/gcc/avr/4.7.1/include-fixed >> >> End of search list. >> GNU C (Pardus Linux) version 4.7.1 (avr) >> compiled by GNU C version 4.5.3, GMP version 5.0.1, MPFR version >> 2.4.2, MPC version 0.8.2 >> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 >> Compiler executable checksum: 722643b1134bcec91c9603abb6d176ac >> COLLECT_GCC_OPTIONS='-mmcu=atmega8' '-v' '-c' >> /usr/local/lib/gcc/avr/4.7.1/../../../../avr/bin/as -mmcu=atmega8 >> -mno-skip-bug -o test.o /tmp/ccgUGtP.s >> >> COMPILER_PATH=/usr/local/libexec/gcc/avr/4.7.1/:/usr/local/libexec/gcc/avr/4.7.1/:/usr/local/libexc/gcc/avr/:/usr/local/lib/gcc/avr/4.7.1/:/usr/local/lib/gcc/avr/:/usr/local/lib/gcc/avr/4.7.1/.././../../avr/bin/ >> >> LIBRARY_PATH=/usr/local/lib/gcc/avr/4.7.1/avr4/:/usr/local/lib/gcc/avr/4.7.1/:/usr/local/lib/gcc/ar/4.7.1/../../../../avr/lib/ >> COLLECT_GCC_OPTIONS='-mmcu=atmega8' '-v' '-c' >> >> Is there anything I might be missing something? >> >> >> Kaan >> >> 2012/8/1 Senthil Kumar Selvaraj <senthil_kumar.selva...@atmel.com> >> >>> On Wed, Aug 01, 2012 at 03:19:58PM +0300, Kaan Akşit wrote: >>> > I am really confused because if I do not set any prefix during >>> > configuration; both avr-gcc and avr-binutils will use /usr/local which >>> > means default is not the supported way. >>> > >>> > So to give an example if I use prefix /usr/local for avr-binutils, >>> should I >>> > be using something outside of /usr/local ? For example /usr/share/avr. >>> > Then I need to export both /usr/local and /usr/share/avr as PATH? Did >>> I get >>> > i right? >>> >>> You are confusing the object/build directory with the install/prefix >>> directory. The object/build directory is the one from which you run the >>> configure script. It is different from the prefix directory, which >>> specifies where the built binaries go when you run "make install". >>> >>> For GCC, the build directory must not be a subdirectory of the source >>> directory. >>> >>> Let's take it step by step. Let's say you extracted the binutils source >>> to ~/src/binutils >>> >>> [~] cd ~ >>> [~] mkdir install >>> [~] mkdir build-binutils && cd build-binutils >>> [build-binutils] pwd >>> ~/build-binutils >>> [build-binutils] ../src/binutils/configure --target=avr >>> --prefix=/home/user/install >>> --disable-nls >>> [build-binutils] make && make install >>> >>> This builds and installs binutils binaries into ~/install/bin (or >>> whatever >>> dir you give as the prefix) >>> >>> Now add the install folder to the path >>> [~] export PATH=~/install/bin:$PATH >>> >>> Assuming gcc is in ~/src/gcc >>> >>> [~] mkdir build-gcc && cd build-gcc >>> [build-gcc] pwd >>> ~/build-gcc >>> [build-gcc] ../src/gcc/configure --target=avr --enable-languages=c >>> --prefix=/home/user/install >>> [build-gcc] make && make install >>> >>> This should build gcc and install avr-gcc and related binaries into >>> ~/install/bin >>> >>> Assuming avr-libc is in ~/src/avr-libc >>> >>> [~] cd ~/src/avr-libc >>> [~/src/avr-libc] ./configure --prefix=/home/user/install --host=avr >>> --build=<your build machine arch> >>> [~/src/avr-libc] make and make install >>> >>> should do the job. >>> >>> Essentially, for binutils and particularly gcc, the build folder from >>> which you run the configure script must not be a subdir of source. Make >>> sure you specify the same prefix for all three configure invocations. >>> >>> Hope this helps. >>> >>> Regards >>> Senthil >>> >>> >>> > >>> > Kaan >>> > >>> > 2012/8/1 Senthil Kumar Selvaraj <senthil_kumar.selva...@atmel.com> >>> > >>> > > On Wed, Aug 01, 2012 at 12:35:47PM +0300, Kaan Akşit wrote: >>> > > > I am using below code to configure avr-gcc, I don't understand >>> what is >>> > > > wrong with it: >>> > > > >>> > > > ../configure --target=avr --mandir=/usr/share/man >>> --datadir=/usr/share >>> > > > --prefix=/usr/share/avr --enable-languages="c,c++" --disable-nls >>> > > > --disable-libssp --with-dwarf2 --with-system-zlib >>> > > > --enable-version-specific-runtime-libs --with-pkgversion="Pardus >>> Linux" >>> > > > --with-bugurl=http://bugs.pardus.org.tr >>> > > > >>> > > > Kaan >>> > > >>> > > Running configure from within a subdirectory of the gcc source >>> directory >>> > > (as inferred from ../configure) is >>> > > not supported. See http://gcc.gnu.org/install/configure.html. You >>> need >>> > > to create a directory outside the toplevel source directory for GCC >>> and >>> > > run configure from there. >>> > > >>> > > Regards >>> > > Senthil >>> > > >>> > > > >>> > > > 2012/8/1 Georg-Johann Lay <a...@gjlay.de> >>> > > > >>> > > > > Kaan Akşit schrieb: >>> > > > > >>> > > > > >>> > > > > $ avr-gcc -mmcu=atmega8 -v -c demo.c >>> > > > >> Using built-in specs. >>> > > > >> COLLECT_GCC=avr-gcc >>> > > > >> Target: avr >>> > > > >> Configured with: ../configure --target=avr >>> --mandir=/usr/share/man >>> > > > >> >>> > > > > >>> > > > > You still configure in the source tree which is not supported. >>> > > > > >>> > > > > Johann >>> > > > > >>> > > >>> >> >> >> _______________________________________________ >> AVR-GCC-list mailing list >> AVR-GCC-list@nongnu.org >> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list >> >> > _______________________________________________ > AVR-GCC-list mailing list > AVR-GCC-list@nongnu.org > https://lists.nongnu.org/mailman/listinfo/avr-gcc-list > >
_______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list