Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:linux:arch_avr_gcc [2011/11/19 07:00]
alex [Arch Linux and Xmega support in avr-gcc]
en:linux:arch_avr_gcc [2019/04/18 10:07]
alex removed
Line 1: Line 1:
 ====== Arch Linux and Xmega support in avr-gcc ====== ====== Arch Linux and Xmega support in avr-gcc ======
  
-Unfortunately,​ the latest version of GCC does not support Atmel chips properly out-of-the-box. ​ The only fix is to use an older version of the compiler and patch the heck out of it.  The latest compiler does not support the newer Xmega series of chips at all.  As Arch Linux only cares about version numbers, the default [[http://​www.archlinux.org/​packages/​community/​i686/​gcc-avr/|gcc-avr packages]] are broken as they do not contain the necessary patches. ​ A [[https://​bugs.archlinux.org/​task/​25798|bug report]] exists for the issue, but it has not been addressed as the required versions of gcc and binutils are rather dated.  ​+avr-gcc historically has needed help with patches from time to time due to the oddball arrangement in how Atmel supports ​avr-gcc.  ​
  
-The solution is to build the three packages from older sources, apply Atmel'​s [[http://​distribute.atmel.no/​tools/​opensource/​avr-gcc/|patches]] , and then force pacman to ignore the '​ancient'​ packages +===== avr-gcc ​4.7 =====
  
-To build the packages, first download the modified PKGBUILDs:+It seems that avr-gcc 4.7 has incorporated all of the required patches for full AVR support. ​ No special compilation is required for xmega suppoort with 4.7.  ​
  
-  * {{:​en:​linux:​binutils-avr-2.20.1-2.pkgbuild}} +===== avr-gcc 4.6 =====
-  * {{:​en:​linux:​gcc-avr-4.5.3-1.pkgbuild}} +
-  * {{:​en:​linux:​avr-libc-1.7.1-1.pkgbuild}}+
  
-Tell pacman to ignore updates to these packages by adding ​the following to ''/​etc/​pacman.conf'':​+avr-gcc 4.6 is the same as 4.5 in that it does not support the xmega series out-of-the-box,​ however the Atmel patches do not work with avr-gcc 4.6.  Ho hum.  Use either 4.5 or 4.7 (recommended).
  
-<​code>​ +===== avr-gcc 4.5 ===== 
-# ignore specific ​avr packages + 
-IgnorePkg ​= binutils-avr gcc-avr avr-libc +Unfortunately,​ the latest version of GCC 4.5 does not support Atmel chips properly out-of-the-box. ​ The only fix is to use an older version of the compiler and patch the heck out of it.  The latest compiler does not support the newer Xmega series of chips at all.  As Arch Linux only cares about version numbers, the default [[http://​www.archlinux.org/​packages/​community/​i686/​avr-gcc/​|avr-gcc ​packages]] are broken as they do not contain the necessary patches. ​ A [[https://​bugs.archlinux.org/​task/​25798|bug report]] exists for the issue, but it has not been properly addressed as the required versions of gcc and binutils are rather dated.  ​ 
-</​code>​+ 
 +The solution is to build the three packages from older sources, apply Atmel'​s [[http://​distribute.atmel.no/​tools/​opensource/​avr-gcc/​|patches]],​ and install them under a different name so pacman does not try to '​upgrade'​ them to the broken versions in community. ​  
 + 
 +The packages are currently available in the AUR here: 
 + 
 +  * [[https://​aur.archlinux.org/​packages.php?​ID=57788|avr-binutils-atmel]] 
 +  * [[https://​aur.archlinux.org/​packages.php?​ID=57789|avr-gcc-atmel]] 
 +  * [[https://​aur.archlinux.org/​packages.php?​ID=57791|avr-libc-atmel]] 
 + 
 +The packages can either be installed with an AUR helper like yaourt, or you can download and build them manually. ​ To build the packages, first download the modified PKGBUILDs:​ 
 + 
 +  * {{:​en:​linux:​avr-binutils-atmel-2.20.1-2.pkgbuild}} 
 +  * {{:​en:​linux:​avr-gcc-atmel-4.5.3-1.pkgbuild}} 
 +  * {{:​en:​linux:​avr-libc-atmel-1.7.1-1.pkgbuild}}
  
 Now, ensure the broken Arch packages are not installed: Now, ensure the broken Arch packages are not installed:
  
 <​code>​ <​code>​
-# pacman -R avr-libc gcc-avr binutils-avr+# pacman -R avr-libc 
 +# pacman -R gcc-avr 
 +# pacman -R avr-gcc 
 +# pacman -R binutils-avr 
 +# pacman -R avr-binutils
 </​code>​ </​code>​
  
 Finally, build and install the packages: Finally, build and install the packages:
 <​code>​ <​code>​
-$ mkdir binutils-avr +$ mkdir avr-binutils-atmel 
-$ cp binutils-avr-*.pkgbuild ​binutils-avr/​PKGBUILD +$ cd avr-binutils-atmel 
-$ cd binutils-avr +$ makepkg -sip ../​avr-binutils-atmel-*.pkgbuild
-$ makepkg -si+
 $ cd .. $ cd ..
-$ mkdir gcc-avr +$ mkdir avr-gcc-atmel 
-$ cp gcc-avr-*.pkgbuild ​gcc-avr/​PKGBUILD +$ cd avr-gcc-atmel 
-$ cd gcc-avr +$ makepkg -sip ../​avr-gcc-atmel-*.pkgbuild
-$ makepkg -si+
 $ cd .. $ cd ..
-$ mkdir avr-libc +$ mkdir avr-libc-atmel 
-cp avr-libc-*.pkgbuild avr-libc/​PKGBUILD +cd avr-libc-atmel 
-cd avr-libc +makepkg -sip ../avr-libc-atmel-*.pkgbuild
-$ makepkg ​-si+
 </​code>​ </​code>​
  
 Finally, start coding for Xmega! Finally, start coding for Xmega!
  
-===== Old PKGCONFIGs =====+Note: Previously the instructions here required adding an IgnorePkg line to pacman.conf. ​ This line is no longer necessary with the new -atmel naming convention, so please remove it if you are upgrading ​ (the only change from the last version is the name so that the packages can be included in the AUR).  ​
  
-  * {{:​en:​linux:​avr-libc-1.7.0-1.pkgbuild}} +===== Old PKGBUILDs =====
-  * {{:​en:​linux:​binutils-avr-2.20.1-1.pkgbuild}} +
-  * {{:​en:​linux:​gcc-avr-4.3.4-1.pkgbuild}}+
  
-~~DISCUSSION~~+  * GCC 4.3.4 
 +    * {{:​en:​linux:​avr-libc-1.7.0-1.pkgbuild}} 
 +    * {{:​en:​linux:​binutils-avr-2.20.1-1.pkgbuild}} 
 +    * {{:​en:​linux:​gcc-avr-4.3.4-1.pkgbuild}} 
 +  * GCC 4.5.3 
 +    * {{:​en:​linux:​binutils-avr-2.20.1-2.pkgbuild}} 
 +    * {{:​en:​linux:​gcc-avr-4.5.3-1.pkgbuild}} 
 +    * {{:​en:​linux:​avr-libc-1.7.1-1.pkgbuild}}