Updating avr-gcc and avr-libc (old link is inaccessible)

svn path=/nixpkgs/trunk/; revision=28767
This commit is contained in:
Michael Raskin 2011-08-23 07:56:34 +00:00
parent c44359b973
commit 716df38be1
3 changed files with 47 additions and 12 deletions

View File

@ -0,0 +1,29 @@
# Patch from Gentoo
diff -ur 1/include/avr/pgmspace.h 2/include/avr/pgmspace.h
--- 1/include/avr/pgmspace.h 2011-05-31 18:19:44.524000823 +0200
+++ 2/include/avr/pgmspace.h 2011-05-31 18:20:27.576000824 +0200
@@ -252,7 +252,7 @@
# define PSTR(s) ((const PROGMEM char *)(s))
#else /* !DOXYGEN */
/* The real thing. */
-# define PSTR(s) (__extension__({static char __c[] PROGMEM = (s); &__c[0];}))
+# define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#endif /* DOXYGEN */
#define __LPM_classic__(addr) \
diff -ur 1/libc/stdlib/dtostre.c 2/libc/stdlib/dtostre.c
--- 1/libc/stdlib/dtostre.c 2011-05-31 18:19:44.639000823 +0200
+++ 2/libc/stdlib/dtostre.c 2011-05-31 18:20:27.639000824 +0200
@@ -37,9 +37,9 @@
char *
dtostre (double val, char *sbeg, unsigned char prec, unsigned char flags)
{
- __attribute__((progmem)) static char str_nan[2][4] =
+ __attribute__((progmem)) static const char str_nan[2][4] =
{"nan", "NAN"};
- __attribute__((progmem)) static char str_inf[2][sizeof(str_nan[0])] =
+ __attribute__((progmem)) static const char str_inf[2][sizeof(str_nan[0])] =
{"inf", "INF"};
char *d; /* dst */
char *s; /* src */

View File

@ -1,21 +1,23 @@
{ stdenv, fetchurl, writeTextFile, coreutils, gnumake, gcc, gnutar, bzip2, gnugrep, gnused, gawk }: { stdenv, fetchurl, writeTextFile, coreutils, gnumake, gcc, gnutar, bzip2
, gnugrep, gnused, gawk, diffutils, patch
, gmp, mpfr, mpc }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "avr-gcc-libc"; name = "avr-gcc-libc";
srcBinutils = fetchurl { srcBinutils = fetchurl {
url = ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2; url = "mirror://gnu/binutils/binutils-2.21.tar.bz2";
sha256 = "0pm20n2l9ddgdpgzk3zhnbb8nbyb4rb2kvcw21pkd6iwybk3rhz2"; sha256 = "1iyhc42zfa0j2gaxy4zvpk47sdqj4rqvib0mb8597ss8yidyrav0";
}; };
srcGCC = fetchurl { srcGCC = fetchurl {
url = ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2; url = "mirror://gcc/releases/gcc-4.6.1/gcc-core-4.6.1.tar.bz2";
sha256 = "07binc1hqlr0g387zrg5sp57i12yzd5ja2lgjb83bbh0h3gwbsbv"; sha256 = "0bbb8f754a31f29013f6e9ad4c755d92bb0f154a665c4b623e86ae7174d98e33";
}; };
srcAVRLibc = fetchurl { srcAVRLibc = fetchurl {
url = http://www.very-clever.com/download/nongnu/avr-libc/avr-libc-1.4.5.tar.bz2; url = http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2;
sha256 = "058iv3vs6syy01pfkd5894xap9zakjx8ki1bpjdnihn6vk6fr80l"; sha256 = "1b1s4cf787izlm3r094vvkzrzb3w3bg6bwiz2wz71cg7q07kzzn6";
}; };
phases = "doAll"; phases = "doAll";
@ -24,7 +26,7 @@ stdenv.mkDerivation {
builder = writeTextFile { builder = writeTextFile {
name = "avrbinutilsgccavrlibc-builder-script"; name = "avrbinutilsgccavrlibc-builder-script";
text = '' text = ''
PATH=${coreutils}/bin:${gnumake}/bin:${gcc}/bin:${gnutar}/bin:${bzip2}/bin:${gnugrep}/bin:${gnused}/bin:${gawk}/bin PATH=${coreutils}/bin:${gnumake}/bin:${gcc}/bin:${gnutar}/bin:${bzip2}/bin:${gnugrep}/bin:${gnused}/bin:${gawk}/bin:${diffutils}/bin:${patch}/bin
# that's all a bit too hacky...! # that's all a bit too hacky...!
for i in `cat ${gcc}/nix-support/propagated-user-env-packages`; do for i in `cat ${gcc}/nix-support/propagated-user-env-packages`; do
echo adding $i echo adding $i
@ -33,6 +35,11 @@ stdenv.mkDerivation {
mkdir -p "$out" mkdir -p "$out"
export > env-vars export > env-vars
for i in "${gmp}" "${mpfr}" "${mpc}"; do
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$i/include "
export NIX_LDFLAGS="$NIX_LDFLAGS -L$i/lib "
done
# important, without this gcc won't find the binutils executables # important, without this gcc won't find the binutils executables
PATH=$PATH:$out/bin PATH=$PATH:$out/bin
@ -51,13 +58,14 @@ stdenv.mkDerivation {
cd gcc-* cd gcc-*
mkdir obj-avr mkdir obj-avr
cd obj-avr cd obj-avr
../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c --disable-libssp ../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c --disable-libssp --with-dwarf2
make $MAKE_FLAGS make $MAKE_FLAGS
make install make install
cd $TMP cd $TMP
tar jxf $srcAVRLibc tar jxf $srcAVRLibc
cd avr-libc-* cd avr-libc-*
patch -Np1 -i ${./avr-libc-fix-gcc-4.6.0.patch}
./configure --prefix="$prefix" --build=`./config.guess` --host=avr ./configure --prefix="$prefix" --build=`./config.guess` --host=avr
make $MAKE_FLAGS make $MAKE_FLAGS
make install make install

View File

@ -2598,9 +2598,7 @@ let
### DEVELOPMENT / MISC ### DEVELOPMENT / MISC
avrgcclibc = callPackage ../development/misc/avr-gcc-with-avr-libc { avrgcclibc = callPackage ../development/misc/avr-gcc-with-avr-libc {};
gcc = gcc40;
};
avr8burnomat = callPackage ../development/misc/avr8-burn-omat { }; avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };