Problem building avr-gcc on Ubuntu 9.10 using Bingo's Script

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

Hello all,

Today I attempted to build the agv-gcc toolchain for Ubuntu 9.10 (Karmic) - file is build-avr-gcc-4.3.3-libc-1.6.7-insight6.8-arch25-fix.zip from thread https://www.avrfreaks.net/index.p...

When executing ./buildavr-no-insight.sh , I get the following build error:

../../../source/avarice-2.10/src/jtag2.h: In constructor "˜jtag2::jtag2(const char*, char*, bool, bool, bool, bool)':
../../../source/avarice-2.10/src/jtag2.h:155: warning: large integer implicitly truncated to unsigned type
mv -f .deps/jtag2misc.Tpo .deps/jtag2misc.Po
g++ -DHAVE_CONFIG_H -I. -I../../../source/avarice-2.10/src     -g -O2 -MT jtag2prog.o -MD -MP -MF .deps/jtag2prog.Tpo -c -o jtag2prog.o ../../../source/avarice-2.10/src/jtag2prog.cc
In file included from ../../../source/avarice-2.10/src/jtag2prog.cc:43:
../../../source/avarice-2.10/src/jtag2.h: In constructor "˜jtag2::jtag2(const char*, char*, bool, bool, bool, bool)':
../../../source/avarice-2.10/src/jtag2.h:155: warning: large integer implicitly truncated to unsigned type
../../../source/avarice-2.10/src/jtag2prog.cc: In member function "˜virtual void jtag2::downloadToTarget(const char*, bool, bool)':
../../../source/avarice-2.10/src/jtag2prog.cc:250: warning: deprecated conversion from string constant to "˜char*'
mv -f .deps/jtag2prog.Tpo .deps/jtag2prog.Po
g++ -DHAVE_CONFIG_H -I. -I../../../source/avarice-2.10/src     -g -O2 -MT jtag2run.o -MD -MP -MF .deps/jtag2run.Tpo -c -o jtag2run.o ../../../source/avarice-2.10/src/jtag2run.cc
In file included from ../../../source/avarice-2.10/src/jtag2run.cc:39:
../../../source/avarice-2.10/src/jtag2.h: In constructor "˜jtag2::jtag2(const char*, char*, bool, bool, bool, bool)':
../../../source/avarice-2.10/src/jtag2.h:155: warning: large integer implicitly truncated to unsigned type
../../../source/avarice-2.10/src/jtag2run.cc: In member function "˜bool jtag2::eventLoop()':
../../../source/avarice-2.10/src/jtag2run.cc:130: warning: ignoring return value of "˜ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result
mv -f .deps/jtag2run.Tpo .deps/jtag2run.Po
g++ -DHAVE_CONFIG_H -I. -I../../../source/avarice-2.10/src     -g -O2 -MT jtag2rw.o -MD -MP -MF .deps/jtag2rw.Tpo -c -o jtag2rw.o ../../../source/avarice-2.10/src/jtag2rw.cc
In file included from ../../../source/avarice-2.10/src/jtag2rw.cc:38:
../../../source/avarice-2.10/src/jtag2.h: In constructor "˜jtag2::jtag2(const char*, char*, bool, bool, bool, bool)':
../../../source/avarice-2.10/src/jtag2.h:155: warning: large integer implicitly truncated to unsigned type
mv -f .deps/jtag2rw.Tpo .deps/jtag2rw.Po
g++ -DHAVE_CONFIG_H -I. -I../../../source/avarice-2.10/src     -g -O2 -MT jtag2usb.o -MD -MP -MF .deps/jtag2usb.Tpo -c -o jtag2usb.o ../../../source/avarice-2.10/src/jtag2usb.cc
../../../source/avarice-2.10/src/jtag2usb.cc: In function "˜usb_dev_handle* opendev(const char*, emulator, int&)':
../../../source/avarice-2.10/src/jtag2usb.cc:98: error: invalid conversion from "˜const char*' to "˜char*'
../../../source/avarice-2.10/src/jtag2usb.cc: In function "˜void childhandler(int)':
../../../source/avarice-2.10/src/jtag2usb.cc:249: warning: ignoring return value of "˜ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result
make[2]: *** [jtag2usb.o] Error 1
make[2]: Leaving directory `/usr/local/avr/build/avarice-2.10/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/avr/build/avarice-2.10/src'
make: *** [all-recursive] Error 1

It appears that it is building as C++, and therefore has the following two prototypes:

const char * strchr ( const char * str, int character );
      char * strchr (       char * str, int character );

Since jtagDeviceName is a const char*, it expects that serno is also a const char*l which is isn't, hence the error.

The following trivial patch makes it build. I have no idea if it introduces any bugs:

damien@damien-desktop:~$ sudo diff -u /root/jtag2usb.cc /usr/local/avr/build/avarice-2.10/src/../../../source/avarice-2.10/src/jtag2usb.cc
--- /root/jtag2usb.cc   2009-11-01 12:21:42.000000000 +1000
+++ /usr/local/avr/build/avarice-2.10/src/../../../source/avarice-2.10/src/jtag2usb.cc  2009-11-01 12:23:52.000000000 +1000
@@ -95,7 +95,7 @@
    * right-to-left, so only the least significant nibbles need to be
    * specified.
    */
-  if ((serno = strchr(jtagDeviceName, ':')) != NULL)
+  if ((serno = strchr(const_cast(jtagDeviceName), ':')) != NULL)
     {
       /* first, drop all colons there if any */
       cp2 = ++serno;

Recently, I built the same script for 9.04 without issue on another box.

-- Damien

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

Using "Bingo's Script" can be a bit of a gamble... :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

@OP

Are you using GCC 4.4.1 (native ubuntu gcc) to build the toolchain ?

Someone did hit a similar thing here
https://www.avrfreaks.net/index.p...

/Bingo

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

@OP (or others) would it be possible to try out this new buildscript

https://www.avrfreaks.net/index.p...

I don't have a ubuntu 9.10 (gcc 4.4.1) install

/Bingo

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

Bingo600 wrote:
@OP

Are you using GCC 4.4.1 (native ubuntu gcc) to build the toolchain ?

Someone did hit a similar thing here
https://www.avrfreaks.net/index.p...

/Bingo

Yes, the native gcc for Ubuntu 9.10:

damien@damien-desktop:~/code$ gcc --version
gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

damien_d wrote:
Bingo600 wrote:
@OP

Are you using GCC 4.4.1 (native ubuntu gcc) to build the toolchain ?

Someone did hit a similar thing here
https://www.avrfreaks.net/index.p...

/Bingo

Yes, the native gcc for Ubuntu 9.10:

damien@damien-desktop:~/code$ gcc --version
gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


@damien_d

Did you try the new buildscript ?

/Bingo

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

Bingo600 wrote:

Did you try the new buildscript ?

/Bingo

Just got home from work... yep, it built fine :)

Thank you very much.

-- Damien

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

damien_d wrote:
Bingo600 wrote:

Did you try the new buildscript ?

/Bingo

Just got home from work... yep, it built fine :)

Thank you very much.

-- Damien

Thanx

The script is now updated in the first post in the "sticky"

/Bingo

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


What on God's green earth has an ATI radeon graphics problem in Ubuntu got to do with the subject of this thread?

Or are you just joining fora and grapeshotting any mention of "Ubuntu" however irrelevant in the hope of finding someone with ATI experience?