Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
srmeister
PostPosted: Feb 19, 2012 - 11:34 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


I compiled a Toolchain including 4.7.0 (as of 2012-17-02) for Windows, including some fixes to known bugs of this version, like the LTO-Bug, the Relax Bug, The Multilib-tiny-stack Bug. There are probably other minor bugs but it works fine for me.

It is a standalone Toolchain, but only the core Components are included. All other Tools can be taken by WinAVR or Atmels Toolchain.

It includes:
- Binutils-2.22 (as of 2012-19-02)
- Avr-Libc-1.8.0
- AVR-Dude 5.11.1
- Languages: C, C++
- Support for ATMega and ATXMega Devices!!

As stated, you can use it as standalone version, but if you are missing some tools, install WinAVR first and then replace its files with those from my Package.

This is the Download Link, size is around 11 MB.

I hope you can profit from this! For my project, which is about 16kb, it improves the size 4,1% with -Os (Optimize for size) and 1,4% with -O2 compared to Atmels most recent Toolchain which is based on gcc 4.5.1

I would like to hear your results and please report any bugs, when found, here or directly to GCC Bugzilla.

Many greetings,
Stefan

Update 02/22: Added the missing .dll file to each directory.


Last edited by srmeister on Feb 23, 2012 - 04:58 PM; edited 2 times in total
 
 View user's profile Send private message  
Reply with quote Back to top
indianajones11
PostPosted: Feb 20, 2012 - 12:45 AM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3893
Location: San Diego, Ca

Thanks for the hard work, Stefan ! I'll let you know . I would've liked it to have USB_Xmega ( crt.o files ) support though, I know it wasn't under your control . Smile

_________________
1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 20, 2012 - 01:36 AM
Newbie


Joined: Feb 19, 2012
Posts: 10


You can take a look at the appended file to see which devices are supported. Alot (or even all) ATXMegaxxxxU devices are supported and crt.o files are there. For exampe for the atxmega128a1u the file is crtx128a1u.o.

Or maybe i understand you wrong?

Edit: every device, that is mentioned in the appended file, is supported.

Please keep in mind that the xmega support is new and has not been tested by anyone besides me until now Smile
Our tanks for this nice work belongs to the hard-working people from the avr-gcc department of GNU Compiler. Atmel itself has not released its sources from their xmega-supporting avr-gcc


Last edited by srmeister on Feb 20, 2012 - 01:50 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
indianajones11
PostPosted: Feb 20, 2012 - 01:45 AM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3893
Location: San Diego, Ca

I meant for the new xmegas with builtin USB, example Xmega32A4U .

_________________
1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 20, 2012 - 01:55 AM
Newbie


Joined: Feb 19, 2012
Posts: 10


Yep this particular device isnt supported atm.
Let me talk to the developers and see what they can do!

Maybe you could take a look and provide a list of missing devices.
 
 View user's profile Send private message  
Reply with quote Back to top
indianajones11
PostPosted: Feb 20, 2012 - 02:03 AM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3893
Location: San Diego, Ca

srmeister wrote:
Maybe you could take a look and provide a list of missing devices.
That's a list I don't have .

_________________
1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 20, 2012 - 11:29 AM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

srmeister wrote:
please report any bugs, when found, here or directly to GCC Bugzilla.
Prior to reporting, please read http://gcc.gnu.org/bugs

There is an up-to date list of most PRs, mainly focused at avr-gcc. You can skim the lists and maybe your problem is already known, worked on or even fixed.
www.mikrocontroller.net: avr-gcc Bugs
gcc.gnu.org/bugzilla: avr
AVR Libc: bugs


Last edited by SprinterSB on Feb 20, 2012 - 05:29 PM; edited 1 time in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Magister
PostPosted: Feb 20, 2012 - 02:44 PM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

wow thanks you, I will test it!

LTO is working?
 
 View user's profile Send private message  
Reply with quote Back to top
DieCore
PostPosted: Feb 20, 2012 - 06:57 PM
Hangaround


Joined: Mar 27, 2009
Posts: 127
Location: Hellas

I tried the toolchain by overwriting it over the AS5.1 default toolchain folders (C:\Program Files (x86)\Atmel\AVR Studio 5.1\extensions\Atmel\AVRGCC\3.3.1.27\AVRToolchain) but it giving me this error when avr-gcc.exe starts and it can't compile.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
dak664
PostPosted: Feb 20, 2012 - 09:30 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1972
Location: North Carolina USA

Seems working in cygwin under Win7/64. I renamed the folder to C:/avr-gcc47 and added it to the beginning of the PATH, as you said winavr picks up the rest:
Code:
$ PATH=/cygdrive/c/avr-gcc47/bin:$PATH

Thanks!

Code:
$ avr-gcc --version
avr-gcc.exe (WinAVR 20100110) 4.3.3
$ avr-size -C --mcu=atmega1284p webserver6.avr-raven
AVR Memory Usage
----------------
Device: atmega1284p
Program:   73838 bytes (56.3% Full)
(.text + .data + .bootloader)

Data:      13044 bytes (79.6% Full)
(.data + .bss + .noinit)

$ avr-gcc --version
avr-gcc.exe (GCC) 4.7.0 20120217 - by SRMeister
]$ avr-size -C --mcu=atmega1284p webserver6.avr-raven
AVR Memory Usage
----------------
Device: atmega1284p

Program:   68896 bytes (52.6% Full)
(.text + .data + .bootloader)

Data:      13060 bytes (79.7% Full)
(.data + .bss + .noinit)


Last edited by dak664 on Feb 20, 2012 - 10:00 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 20, 2012 - 09:47 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

DieCore wrote:
I tried the toolchain by overwriting it over the AS5.1 default toolchain folders (C:\Program Files (x86)\Atmel\AVR Studio 5.1\extensions\Atmel\AVRGCC\3.3.1.27\AVRToolchain) but it giving me this error when avr-gcc.exe starts and it can't compile.
In INSTALL-DIR/avr/bin there should be a libiconv-2.dll.

BTW: I'd propose you could use path name with umlauts, ligatures and some chinese and khmer characters Wink
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Magister
PostPosted: Feb 21, 2012 - 03:17 PM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

I still have a
Quote:
lto1.exe: internal compiler error: Segmentation fault

if I enable LTO (Windows 32 bits host)
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 12:48 AM
Newbie


Joined: Feb 19, 2012
Posts: 10


DieCore wrote:
but it giving me this error when avr-gcc.exe starts and it can't compile.


Im sorry for this, its a mistake on my side.
I forgot to copy the file "libiconv-2.dll" in every directory where .exe files are. (For example where cc1.exe is)
The file is there though, you would just copy it from \AVR-Toolchain\bin to AVR-Toolchain\libexec\gcc\avr\4.7.0\

I will fix this of course, in the next release!

dak664 wrote:
Seems working in cygwin under Win7/64

I compiled it under MinGW32 so didnt even know that it would work in cygwin. Nice, you got over 7% decrease in size!

Magister wrote:

I still have a
lto1.exe: internal compiler error: Segmentation fault.
if I enable LTO (Windows 32 bits host)


Thats probably caused by the above mentioned missing libiconv-2.dll. Please tell me if this fixes your problem. Iam sorry for this! Was a little bit late when i packed the file together Smile

Probably another method would be to add the \AVR-Toolchain\bin folder to your PATH variable, like dak664 did.

Edit: i updated the package in the first post to fix this issue.

Hope this helps!!
Stefan
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Feb 22, 2012 - 09:36 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71189
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

I forgot to copy the file

Why would you need to make copies - you just ensure the directory where it is located is on the PATH don't you?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 22, 2012 - 09:54 AM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

clawson wrote:
Quote:
I forgot to copy the file
Why would you need to make copies - you just ensure the directory where it is located is on the PATH don't you?
This would force you to use the by setting PATH. It's great to be able to use the tools without changing *anything* in the environment.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Feb 22, 2012 - 10:04 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71189
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

This would force you to use the by setting PATH. It's great to be able to use the tools without changing *anything* in the environment.

WinAVr has always added \winavr\bin and \winavr\utils\bin to the PATH during installation - I don't think it's ever been considered a "problem".

(though it's true that if you have more than one make.exe or more than one cygwin1.dll it has caused some upset).

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 12:04 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


Yeah WinAVR did that, but my Toolchain does not have a installer, so one would have to do it by hand.
OR
as i stated in first post, first install WinAVR and overwrite its files by those in my package.
But anyways, its fixed now. No need to edit PATH

Some people complained about WinAVR changig PATH, because it can interfere with other programs.
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 22, 2012 - 12:18 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

srmeister wrote:
Some people complained about WinAVR changig PATH, because it can interfere with other programs.
*confused* AFAIR WinAVR installer asks if it should change PATH or not...
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
dak664
PostPosted: Feb 22, 2012 - 12:29 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1972
Location: North Carolina USA

For anyone worried that changing PATH will break the existing tools, note PATH=foo:$PATH:bar affects only the current command window. So testing is harmless, and once you get it working you can add an alias to your .profile or .bash like alias usegcc47='PATH=foo:$PATH'. In Windows command windows it's set PATH=foo;% PATH% without the space after %
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 12:45 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


SprinterSB wrote:
srmeister wrote:
Some people complained about WinAVR changig PATH, because it can interfere with other programs.
*confused* AFAIR WinAVR installer asks if it should change PATH or not...


I only read about it, for example look at first 3 posts at the bottom of this page.
 
 View user's profile Send private message  
Reply with quote Back to top
Magister
PostPosted: Feb 22, 2012 - 12:54 PM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

I always change the PATH when I test toolchain, so I know it can find the libiconv-2.dll. LTO not working may be a bug in binutils.

EDIT: binutils version is 2.22.52, not 2.23?
 
 View user's profile Send private message  
Reply with quote Back to top
dak664
PostPosted: Feb 22, 2012 - 04:19 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1972
Location: North Carolina USA

srmeister wrote:
I compiled it under MinGW32 so didnt even know that it would work in cygwin.

Well, cygwin does not like your rm.exe during a make clean, e.g. if *.map does not exist it gives an error. I renamed it to rmbad.exe to get the winavr version. The first rm below deletes the file, the second gives an error since the file is gone:
Code:
$ rm --version
rm (GNU coreutils) 5.3.0

$ rm *.map
$ rm *.map
C:\avr-gcc47\bin\rm.exe: cannot remove `*.map': Invalid argument
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 22, 2012 - 05:09 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

Just use rm -f

_________________
avr-gcc NewsABIOptions4.8-WindowsInline Asm
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
dak664
PostPosted: Feb 22, 2012 - 06:58 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1972
Location: North Carolina USA

Well it was the makefile that showed the error and that did use -f. But it still gives an error:
Code:

$ echo 1>test.map
$ rm -f *.map
$ rm -f *.map
C:\avr-gcc47\bin\rm.exe: cannot remove `*.map': Invalid argument
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 07:19 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


well, i dont understand why you're using cygwin.
These linux commandline tools are probably made with MinGW (ripped them off of AVR Studio 5), so maybe there is some incompatibility when trying to run a mingw program using cygwin.

maybe what you really need is a linux compiled version of gcc-4.7 so you wouldnt need to use cygwin to emulate the environment... idk.
people reported its working when combined with AVR Studio, when combined with WinAVR, and even standalone combined with some other IDE.
It is not intented to run in every imaginary way possible, otherwise i would have to write an installer and put a huge load of other work and research into it.

If you got THIS problem with rm.exe, just replace it with another rm.exe that works for you(or stop using cygwin). The same advice applies to any file that does not seem to be working.
Maybe it was a bad idea of me to make it "standalone" in that sense to include all these GNU command line tools.


Last edited by srmeister on Feb 22, 2012 - 07:39 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 07:25 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


Magister wrote:
I always change the PATH when I test toolchain, so I know it can find the libiconv-2.dll. LTO not working may be a bug in binutils.
EDIT: binutils version is 2.22.52, not 2.23?


Hello Magister,
please can you specify what command line options you used. Also, what is your OS?
please copy and paste your console output.

binutils is the most recent version of its trunk.
 
 View user's profile Send private message  
Reply with quote Back to top
Magister
PostPosted: Feb 22, 2012 - 07:43 PM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

I have XP 32 bits, I launch the make under a command prompt. I just added the -flto flag to CFLAGS
Quote:
lto1.exe: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: avr-gcc returned 1 exit status
c:/avr/tools/4.7/bin/../lib/gcc/avr/4.7.0/../../../../avr/bin/ld.exe: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status


Without the -flto, everything works fine.
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 22, 2012 - 09:25 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

And console output with these?
-flto -v -Wl,-v -save-temps

_________________
avr-gcc NewsABIOptions4.8-WindowsInline Asm
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Magister
PostPosted: Feb 22, 2012 - 09:41 PM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

Not a lot of useful info, lto1.exe does a sigsegv

Quote:
COLLECT_GCC_OPTIONS='-c' '-mmcu=atmega168' '-mmcu=atmega168' '-fno-move-loop-inv
ariants' '-fno-tree-loop-optimize' '-funsigned-char' '-fpack-struct' '-ffunction
-sections' '-fdata-sections' '-fno-inline-small-functions' '-mcall-prologues' '-
mstrict-X' '-v' '-save-temps' '-gstabs' '-D' 'F_CPU=16000000' '-D' 'GRAPHIC' '-O
s' '-L.' '-Lcanlib/src' '-dumpdir' './' '-dumpbase' 'obduino3.elf.wpa' '-fltrans
-output-list=obduino3.elf.ltrans.out' '-fwpa' '-fresolution=-lcan.res'
c:/avr/tools/4.7/lib/gcc/../../libexec/gcc/avr/4.7.0/lto1.exe -quiet -dumpdir .
/ -dumpbase obduino3.elf.wpa -mmcu=atmega168 -mmcu=atmega168 -mcall-prologues -m
strict-X -auxbase obduino3 -gstabs -Os -version -fno-move-loop-invariants -fno-t
ree-loop-optimize -funsigned-char -fpack-struct -ffunction-sections -fdata-secti
ons -fno-inline-small-functions -fltrans-output-list=obduino3.elf.ltrans.out -fw
pa -fresolution=-lcan.res @C:\DOCUME~1\Frederic\LOCALS~1\Temp\ccce08yy
GNU GIMPLE (GCC) version 4.7.0 20120217 (experimental) (avr)
compiled by GNU C version 4.6.2, GMP version 5.0.4, MPFR version 3.1.0,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (GCC) version 4.7.0 20120217 (experimental) (avr)
compiled by GNU C version 4.6.2, GMP version 5.0.4, MPFR version 3.1.0,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
lto1.exe: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: avr-gcc returned 1 exit status
[Leaving LTRANS obduino3.elf.ltrans.out]
[Leaving LTRANS C:\DOCUME~1\Frederic\LOCALS~1\Temp\cc6oPJ8t.args]
c:/avr/tools/4.7/bin/../lib/gcc/avr/4.7.0/../../../../avr/bin/ld.exe: lto-wrappe
r failed
collect2.exe: error: ld returned 1 exit status
 
 View user's profile Send private message  
Reply with quote Back to top
srmeister
PostPosted: Feb 22, 2012 - 10:29 PM
Newbie


Joined: Feb 19, 2012
Posts: 10


either, it is caused by wrong PATH setting, or there is a real bug.

Maybe it is loading some libs from a wrong dir. Could you try setting your PATH in such a way, that the Toolchain dir is first dir, eg. PATH=/toolchain-4.7/bin:$PATH (or its windows equivalent).

If we do deal here with a real bug, im no expert at that, but im sure SprinterSB will try:)
 
 View user's profile Send private message  
Reply with quote Back to top
dak664
PostPosted: Feb 22, 2012 - 11:11 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1972
Location: North Carolina USA

srmeister wrote:
well, i dont understand why you're using cygwin.

There are several other toolchains I use which are easy installations under cygwin, which also tries very hard to use installed windows applications. I have not been able to get Perl serialport.pm working in any other shell, possibly this is a 64 bit .dll problem.

But the rm error is trivial and I am happy to have the 4.7.0 build option.
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 22, 2012 - 11:40 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1733
Location: Saar-Lor-Lux

The only way (for me) to track it down is to reproduce this on linux host. IF it works there I have no idea.

Is there still segmentation fault without -fdata-sections?

_________________
avr-gcc NewsABIOptions4.8-WindowsInline Asm
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
david.prentice
PostPosted: Feb 22, 2012 - 11:58 PM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20524
Location: Wormshill, England

@srmeister,

Thankyou very much. You have compiled avrdude-5.11.1 for Windows.

And it works nicely with usbasp and TPI devices !!

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Magister
PostPosted: Feb 23, 2012 - 12:15 AM
Hangaround


Joined: Aug 06, 2008
Posts: 146
Location: Montréal, QC

SprinterSB wrote:
The only way (for me) to track it down is to reproduce this on linux host. IF it works there I have no idea.

Is there still segmentation fault without -fdata-sections?

Yes, I even removed "-ffunction-sections -fdata-sections -Wl,--relax,--gc-sections" and it still sigsegv
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits