How to upgrade the AVR-GCC toolset on a Mac?

I'm trying to program an ATtiny84 but I get a compiling error when the program gets above about 50% of its full capacity (~4k of a max 8k).

This is part of the error I get:relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in

I've been told to fix the issue I need to upgrade the AVR-GCC toolset, but I have no idea how to do that on a mac.

Thanks!

I just got into the exact same boat .. and solved it moments ago.

  1. Grab the latest version of CrossPack - http://www.obdev.at/products/crosspack/download.html
  2. Install it (or use something like Pacifist to get the relevant files)
  3. Navigate to /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/ (right-click Arduino.app and Show Package contents) and copy the avr folder to avr-bak.
  4. Copy the files from /usr/local/CrossPack-AVR into the avr folder, replacing all conflicts.
  5. Restart Arduino.app

I had originally replaced the entire avr folder with the one from CrossPack, but that produced another compiler error. Just replacing the shared files appears to work and resolved the above error for me.

Hope this helps!

Crosspack is handy. But it's getting a little old now. It runs GCC 4.5.1, which is 18 months old. In particular, 4.6.3 fixed many bugs, and improved code generation greatly. If you're a bit brave, you can try rolling your own toolset.

I have proven step-by-step instructions for building 4.7.0 tools in Linux on my blog. For Mac, it's not too much harder, there are just a couple extra steps to take care of first.

  • Install XCode, which has the gcc build tools
  • Install HomeBrew
  • Install GCC pre-requisites using homebrew: "brew install gmp mpfr libmpc"

Maniac I appreciate your help, but I'm pretty unfamiliar with this kind of stuff, and I'm definitely not brave enough to dig into at the moment.

Freddie, sorry for my ignorance, but how do you copy files from/usr/local/CrossPack-AVR

I installed it, but it seems like it can only be accessed through the terminal, which I never use and don't know much about. Thanks.

In the Finder, you can go to the Go menu >> Go to Folder... and paste the path "/usr/local/CrossPack-AVR" into that dialog.
Then just copy and paste the files in that folder into the "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/" folder, and choose to replace the any existing files.

Okay I think I did what you said and I'm getting a different compiling error:

dyld: unknown required load command 0x80000022
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ returned 133

These are the steps I followed:

  1. In "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools" I copied the "avr" folder to my desktop and renamed it "avr (old)" just in case there were an issues that occurred
  2. Copied the contents of "/usr/local/CrossPack-AVR/avr" (folders "avr", "bfd", "bin", etc.) into the "avr" folder found in the "tools" folder of the Arduino app.
  3. It asked "an item named "...." already exists in this location. Do you want to replace it with the one you're moving?"
  4. I clicked "Apply to all" and then clicked "Replace"
  5. Re-opened the application and tried to compile and the above error is what I got.

Any ideas??