Attempts to get LLVM-gcc working are not yet succesful; but builder-defs updates are useful.

svn path=/nixpkgs/trunk/; revision=11457
This commit is contained in:
Michael Raskin 2008-04-02 19:55:40 +00:00
parent 76b73720da
commit a693c53ec4
4 changed files with 142 additions and 2 deletions

View File

@ -0,0 +1,86 @@
source $stdenv/setup
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
mkdir $NIX_FIXINC_DUMMY
export X_CFLAGS="-I${gmp}/include -I${mpfr}/include -L${gmp}/lib -L${mpfr}/lib";
# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
# Thing.
export CPP="gcc -E"
if test "$noSysDirs" = "1"; then
if test -e $NIX_GCC/nix-support/orig-libc; then
# Figure out what extra flags to pass to the gcc compilers
# being generated to make sure that they use our glibc.
extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
# Use *real* header files, otherwise a limits.h is generated
# that does not include Glibc's limits.h (notably missing
# SSIZE_MAX, which breaks the build).
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
else
# Hack: support impure environments.
extraCFlags="-isystem /usr/include"
extraLDFlags="-L/usr/lib64 -L/usr/lib"
export NIX_FIXINC_DUMMY=/usr/include
fi
extraCFlags="-g0 $extraCFlags"
extraLDFlags="--strip-debug $extraLDFlags"
export NIX_EXTRA_CFLAGS=$extraCFlags
for i in $extraLDFlags; do
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
done
makeFlagsArray=( \
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
LIMITS_H_TEST=true \
X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
)
fi
preConfigure=preConfigure
preConfigure() {
# Perform the build in a different directory.
mkdir ../build
cd ../build
configureScript=../$sourceRoot/configure
}
postInstall=postInstall
postInstall() {
# Remove precompiled headers for now. They are very big and
# probably not very useful yet.
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
# Remove `fixincl' to prevent a retained dependency on the
# previous gcc.
rm -rf $out/libexec/gcc/*/*/install-tools
# Get rid of some "fixed" header files
rm -rf $out/lib/gcc/*/*/include/root
}
if test -z "$staticCompiler"; then
if test -z "$profiledCompiler"; then
buildFlags="bootstrap $buildFlags"
else
buildFlags="profiledbootstrap $buildFlags"
fi
fi
genericBuild

View File

@ -0,0 +1,28 @@
args : with args;
rec {
src = fetchurl {
url = http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz;
sha256 = "11vjn8wn76cq63jam7y5ralq1b12r6cdipf22nsnzw90srb49qkp";
};
buildInputs = [llvm bison flex perl mpfr gmp];
configureFlags = [" --enable-llvm=$(ls -d $PWD/../llvm-?.?) "];
makeFlags = [" -f Makefile "];
phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];
preConfigure = FullDepEntry (''
cd ..
mkdir obj install
tar xf ${llvmSrc}
cd obj
'') ["doUnpack" "minInit"];
configureCommand = "$(ls ../llvm-gcc*.*.source/configure)";
name = "llvm-gcc42-2.2";
meta = {
description = "LLVM GCC frontend";
};
}

View File

@ -1252,6 +1252,21 @@ let pkgs = rec {
inherit stdenv;
};
g77_42 = import ../build-support/gcc-wrapper {
name = "g77-4.2";
nativeTools = false;
nativeLibc = false;
gcc = import ../development/compilers/gcc-4.2/fortran.nix {
inherit fetchurl stdenv noSysDirs;
langF77 = true;
langCC = false;
langC = false;
inherit gmp mpfr;
};
inherit (stdenv.gcc) binutils libc;
inherit stdenv;
};
gcc = gcc42;
gcc295 = wrapGCC (import ../development/compilers/gcc-2.95 {
@ -1524,6 +1539,15 @@ let pkgs = rec {
inherit fetchurl stdenv gcc flex perl libtool;
};
llvmGccFun = builderDefsPackage (import ../development/compilers/llvm/llvm-gcc.nix) {
flex=flex2535;
bison=bison23;
inherit llvm perl mpfr gmp;
llvmSrc = llvm.src;
};
llvmGCC =llvmGccFun null;
mono = import ../development/compilers/mono {
inherit fetchurl stdenv bison pkgconfig;
inherit (gtkLibs) glib;
@ -1699,7 +1723,7 @@ let pkgs = rec {
octave = import ../development/interpreters/octave {
inherit stdenv fetchurl readline ncurses perl flex;
g77 = g77_41;
g77 = g77_42;
};
perl = if !stdenv.isLinux then sysPerl else realPerl;

View File

@ -208,8 +208,10 @@ args: with args; with stringsWithDeps; with lib;
(if args ? goSrcDir then args.goSrcDir else "")
) ["minInit"];
configureCommand = getAttr ["configureCommand"] "./configure" args;
doConfigure = FullDepEntry ("
./configure --prefix=\"\$prefix\" ${toString configureFlags}
${configureCommand} --prefix=\"\$prefix\" ${toString configureFlags}
") ["minInit" "addInputs" "doUnpack"];
doAutotools = FullDepEntry ("