Problem with new build script on avr-libc

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I attempted Bingo's build script (aptosid debian).

Everything went well for:
ok-build-avrdude-5.11.1
ok-build-binutils-2.20.1
ok-build-gcc-4.5.1
ok-build-avarice-2.12

but then came up with the following error:

<br />
avr-libc-1.8.0/common/ntz.h<br />
avr-libc-1.8.0/common/sectionname.h<br />
(./buildavr-toolchain.sh) patching libc source<br />
(./buildavr-toolchain.sh) configuring libc source<br />
configure: error: in `/usr/local/avr/build/avr-libc-1.8.0':<br />
configure: error: cannot compute suffix of object files: cannot compile<br />
See `config.log' for more details<br />
(./buildavr-toolchain.sh) libc configuration failed<br />
[\code]</p>
<p>I studied the config.log but haven't been able to determine the what really caused the error.  I tried just running ./configure on a separate copy of avr-libc-1.8.0 and had no issues.  (I don't know much about configure scripts)</p>
<p>Any clues? Workarounds? I suppose I could </p>
<p>[code]configure:2743: found /usr/bin/gawk<br />
configure:2754: result: gawk<br />
configure:2765: checking whether make sets $(MAKE)<br />
configure:2787: result: yes<br />
configure:2886: checking for avr-gcc<br />
configure:2913: result: /usr/local/avr/bin/avr-gcc<br />
configure:3182: checking for C compiler version<br />
configure:3191: /usr/local/avr/bin/avr-gcc --version >&5<br />
avr-gcc (GCC) 4.5.1<br />
Copyright (C) 2010 Free Software Foundation, Inc.<br />
This is free software; see the source for copying conditions.  There is NO<br />
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
<p>configure:3202: $? = 0<br />
configure:3191: /usr/local/avr/bin/avr-gcc -v >&5<br />
Using built-in specs.<br />
COLLECT_GCC=/usr/local/avr/bin/avr-gcc<br />
COLLECT_LTO_WRAPPER=/usr/local/avr/libexec/gcc/avr/4.5.1/lto-wrapper<br />
Target: avr<br />
Configured with: ../../source/gcc-4.5.1/configure -v --target=avr --disable-nls --prefix=/usr/local/avr --with-gnu-ld --with-gnu-as --enable-languages=c,c++ --disable-libssp --with-dwarf2 --with-gmp-include=/usr/local/avr/source/gcc-4.5.1/gmp<br />
Thread model: single<br />
gcc version 4.5.1 (GCC)<br />
configure:3202: $? = 0<br />
configure:3191: /usr/local/avr/bin/avr-gcc -V >&5<br />
avr-gcc: '-V' option must have argument<br />
configure:3202: $? = 1<br />
configure:3191: /usr/local/avr/bin/avr-gcc -qversion >&5<br />
avr-gcc: unrecognized option '-qversion'<br />
avr-gcc: no input files<br />
configure:3202: $? = 1<br />
configure:3222: /usr/local/avr/bin/avr-gcc -o conftest    conftest.c  >&5<br />
/tmp/cc6X3AFT.s: Assembler messages:<br />
/tmp/cc6X3AFT.s:14: Error: too many memory references for `in'<br />
/tmp/cc6X3AFT.s:15: Error: too many memory references for `in'<br />
/tmp/cc6X3AFT.s:20: Error: no such instruction: `ldi r24,lo8(0)'<br />
/tmp/cc6X3AFT.s:21: Error: no such instruction: `ldi r25,hi8(0)'<br />
configure:3226: $? = 1<br />
configure:3439: checking whether we are cross compiling<br />
configure:3477: result: yes<br />
configure:3481: checking for suffix of object files<br />
configure:3503: /usr/local/avr/bin/avr-gcc -c   conftest.c >&5<br />
/tmp/ccFWjROS.s: Assembler messages:<br />
/tmp/ccFWjROS.s:14: Error: too many memory references for `in'<br />
/tmp/ccFWjROS.s:15: Error: too many memory references for `in'<br />
/tmp/ccFWjROS.s:20: Error: no such instruction: `ldi r24,lo8(0)'<br />
/tmp/ccFWjROS.s:21: Error: no such instruction: `ldi r25,hi8(0)'<br />
configure:3507: $? = 1<br />
configure: failed program was:<br />
| /* confdefs.h */<br />
| #define PACKAGE_NAME "avr-libc"<br />
| #define PACKAGE_TARNAME "avr-libc"<br />
| #define PACKAGE_VERSION "1.8.0"<br />
| #define PACKAGE_STRING "avr-libc 1.8.0"<br />
| #define PACKAGE_BUGREPORT "avr-libc-dev@nongnu.org"<br />
| #define PACKAGE_URL ""<br />
| #define PACKAGE "avr-libc"<br />
| #define VERSION "1.8.0"<br />
| /* end confdefs.h.  */<br />
|<br />
| int<br />
| main ()<br />
| {<br />
|<br />
|   ;<br />
|   return 0;<br />
| }<br />
configure:3521: error: in `/usr/local/avr/build/avr-libc-1.8.0':<br />
configure:3523: error: cannot compute suffix of object files: cannot compile<br />
See `config.log' for more details<br />

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, *that* was interesting...I just changed the prefix variable in the build-scripts and didi the compile in "non root" as indicated in the readme file and the build went flawlessly! Hmmm. (yes, I did run "sudo ./buildavr-toolchain.sh" the first time)

It seems I found a workaround, but I never found out why the original script failed when run with sudo.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> but I never found out why the original script failed when run with sudo.

It picked up the wrong assembler.

It's usually a good idea to start out with a minimal $PATH setting
(and with $LD_LIBRARY_PATH completely unset).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried to build avr-libc but get the following error after ATTiny CRT libraries are built successfully and during building libc with -mmcu=avr2:

Error compiling ../../../libc/misc/eerd_block.S
    missing argument to '-mmcu='
Compiler arguments:
    avr-gcc -DHAVE_CONFIG_H -I. -I../../../ -I../../../common -I../../../include -I../../../include -Wall -W -Wstrict-prototypes -D__COMPILING_AVR_LIBC__ -mcall-prologues -Os -x assembler-with-cpp -D__COMPILING_AVR_LIBC__ -c -o eerd_block_at90s1200.o

 

How can I fix this? I actually need only time.c in libc for an atxmega256a3bu, but the binary libc does not link with my code. I am using avr-gcc 3.4.1061 that comes with Atmel Studio 6.2. (Unfortunately, libc that Atmel provides for that MCU does not provide the time module.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I solved it by replacing lastword with $(word $(words text),text) $(word $(words text),text) $(word $(words text),text)word $(words ... in Makefile/$(eeprom_asm_objectlist). I guess my binutils are too old to support lastword.

 

Building libc from source did not solve my original problem, though. I still cannot link to the library.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now I also solved the linker issue. Atmel Studio somehow forces linking with their libc. My guess is that it is an entry in the .proj XML file.

For now, I have replaced the Atmel libc in folder C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\avr\lib\avrxmega6 with the avr-libc

until I find a way to point the project entry away from the original libc folder to my avr-libc folder.