Which GCC Version?

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

I am switching to Linux from the Land of Microsoft and I have a couple of questions about building the GCC tool chain.

What version of the GNU GCC distribution should I use?
I think I now understand the release structure – the number after the dash is major release indicator, the number after the first dot is the minor release indicator, and the number after the second dot is the micro release indicator. Distributions with micro indicators are for bug fixes and patches, and may not contain all languages (an example is gcc-4.0.2 which contain the c language but not c++).

How do I patch?
I understand how to build the tool chain but I have no idea how to maintain the beast.

How can I tell which GNU release affects the avr-g++ compiler and is there an easy way to monitor the progress of the avr-g++ compiler?
I assume this information is somewhere at the savannah site but what is the simplest way to keep tabs on the efforts of the gracious people that improve and fix this wonderful tool.

Finally, what should I be wary of in the changing GCC core?
I think the optimization techniques are being reworked (independent of the avr-g++ effort) in the newest distributions of GNU GCC and I can imagine that this could affect the code generated by avr-g++. Is it wise to only upgrade the compiler when the avr-g++ portion of GCC changes or can/should I lead the avr-g++ effort?

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

For the time being 3.4.5 would seem to be the tree to go for as there are doubts about 4.0.x and 4.1.x is perhaps "too new".

The WinAVR that was released just a week ago used 3.4.5 for this very reason.

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

I use linux and the following AVR "components":

Binutils 2.16.1
GCC 4.0.2 <--- ! GCC 3.4.5 didn't support ATMega168 ... ?????
Avrlibc 1.4.2

I started looking for patches for gcc 3.4.5, but since I'm a hobbyist I decided to "take the easy way out" and use 4.0.2 ...

I've been adviced against using GCC 4.0.2 due to some "major bugs", but I program mostly in Assembly, so I should be safe ... :?

I've built and run the demo projects (written in C) that follow AVR-LIBC and so far, so good ...

Rebuilding the entire toolchain doesn't take that long IMO, so instead of patching the individual components I rebuild/install the whole chain instead ...

/J

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

I explained in detail how to build a stable AVR-GCC toolchain with pathes for new devices.

It is not completely up-to-date, but you could give it a try:

http://www.kieltech.de/uweswiki/...

(And it's a wiki:
If you find out how to update the instructions, just do it!)

Regards:

Uwe

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

Clawson, what is a tree structure? Are the compiler, utilities, and library linked into a tree? If so, how do I determine the related releases?

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

I know I shouldn't answer a question not directed to me, but I'm 99.9% sure that Clawson refers to the development branches of the GCC project :

http://gcc.gnu.org/develop.html#... (scroll down for the "tree" ...)

I think the safest solution is to check the latest WinAVR release and use the same versions for binutils,gcc and avrlibc ...

/J

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

Thanks Jussishow. So, your advice would be to follow WinAVR and update when they update, and use the releases they use. Sounds like just the simple solution I was looking for.

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

Quote:
So, your advice would be to follow WinAVR and update when they update, and use the releases they use

Hmmm... I'm not confident enough with GCC to give You any 100% advice ...
But, following the WinAVR versions sounds like a good idea to me ...

That's probably why I didn't :-)

/J

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

I have successfully compiled a basic tool chain and now it is time to take the next step and learn to patch. I would appreciate some help in understanding the types of patches used in WinAVR.

WinAVR now has 4 patches to Binutils. Since I will be running on Linux, I figure that I don’t need the coff patches. The devices I plan to compile for are old, so, I don’t need the newdevices patch. This leaves only the size utility patch to worry with.

However, I am confused by the 7 patches to GCC. I have no idea what the incpath patch is for. The MinGW patches appear to be Windows related so I figure I can skip these. The Ada patch is of no use to me since I don’t plan to use this language. The binary constants patch looks useful but will it become part of the “tree” or will I forever more have to apply this patch when building/updating GCC? The newdevices patch I will skip. However, the dwarf2 size patch could be useful. I understand that dwarf2 is one of the debugging formats that GCC is capable of outputting. But, is it something that I will use on Linux?

I could also use some advice on the best methods to hunt down patches. The Binutils size patch appears to be some text in a mail listing. Are there formal repositories for patches, or, are they elusive prey that one hunts for in the underbrush?

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

I use Jörg Wunsch's patches which can be found here:

gcc:
http://www.freebsd.org/cgi/cvswe...
I use following:
patch-newdevices-gcc
patch-misspelled-signames-gcc
patch-binary-constants-gcc
patch-dwarfdebug-gcc

binutils:
http://www.freebsd.org/cgi/cvswe...
I use:
patch-newdevices-binutil
patch-aa-binutil

Previously I had not used: patch-binary-constants-gcc, patch-dwarfdebug-gcc, patch-aa-binutil these are not required and I haven't ever needed them but last time I rebuilt the tool chain I used all of them. You don't need patch-binary-constants-gcc either. Putting together a simple shell script is also useful.