Merge remote-tracking branch 'upstream/master' into hardened-stdenv
This commit is contained in:
@@ -61,6 +61,9 @@ let
|
||||
in elmPkgs // {
|
||||
inherit elmPkgs;
|
||||
elmVersion = elmRelease.version;
|
||||
|
||||
# To unbreak elm-compiler
|
||||
language-ecmascript = self.language-ecmascript_0_17_0_2;
|
||||
};
|
||||
};
|
||||
in hsPkgs.elmPkgs // {
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
|
||||
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
|
||||
mkdir $NIX_FIXINC_DUMMY
|
||||
|
||||
|
||||
# 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_CC/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_CC/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/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_CC/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 -I$gmp/include -I$mpfr/include $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
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
if test -z "$crossStageStatic"; then
|
||||
extraXCFlags="-B${libcCross}/lib -idirafter ${libcCross}/include"
|
||||
extraXLDFlags="-L${libcCross}/lib"
|
||||
export NIX_EXTRA_CFLAGS_TARGET=$extraXCFlags
|
||||
for i in $extraXLDFlags; do
|
||||
export NIX_EXTRA_LDFLAGS_TARGET="$NIX_EXTRA_LDFLAGS_TARGET -Wl,$i"
|
||||
done
|
||||
fi
|
||||
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
|
||||
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
|
||||
)
|
||||
else
|
||||
export NIX_EXTRA_CFLAGS_TARGET=$NIX_EXTRA_CFLAGS
|
||||
export NIX_EXTRA_LDFLAGS_TARGET=$NIX_EXTRA_LDFLAGS
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
CFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
)
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
|
||||
# We don't want the gcc build to assume there will be a libc providing
|
||||
# limits.h in this stagae
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
LIMITS_H_TEST=false \
|
||||
)
|
||||
else
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
LIMITS_H_TEST=true \
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
# The host strip will destroy everything in the target binaries otherwise
|
||||
dontStrip=1
|
||||
fi
|
||||
|
||||
preConfigure() {
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
configureScript=../$sourceRoot/configure
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
rm -rf $out/lib/gcc/*/*/install-tools
|
||||
|
||||
# Get rid of some "fixed" header files
|
||||
rm -rf $out/lib/gcc/*/*/include/root
|
||||
|
||||
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
||||
for i in $out/bin/*-gcc*; do
|
||||
if cmp -s $out/bin/gcc $i; then
|
||||
ln -sfn gcc $i
|
||||
fi
|
||||
done
|
||||
|
||||
for i in $out/bin/*-c++* $out/bin/*-g++*; do
|
||||
if cmp -s $out/bin/g++ $i; then
|
||||
ln -sfn g++ $i
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$postInstallGhdl"
|
||||
}
|
||||
|
||||
|
||||
if test -z "$targetConfig"; then
|
||||
if test -z "$profiledCompiler"; then
|
||||
buildFlags="bootstrap $buildFlags"
|
||||
else
|
||||
buildFlags="profiledbootstrap $buildFlags"
|
||||
fi
|
||||
else
|
||||
:
|
||||
# buildFlags="all-gcc all-target-libgcc $buildFlags"
|
||||
# installTargets="install-gcc install-target-libgcc"
|
||||
fi
|
||||
|
||||
genericBuild
|
||||
@@ -1,186 +0,0 @@
|
||||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
|
||||
, langJava ? false
|
||||
, langVhdl ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, texinfo ? null
|
||||
, gmp, mpfr
|
||||
, bison ? null, flex ? null
|
||||
, zlib ? null, boehmgc ? null
|
||||
, enableMultilib ? false
|
||||
, name ? "gcc"
|
||||
, cross ? null
|
||||
, binutilsCross ? null
|
||||
, libcCross ? null
|
||||
, crossStageStatic ? true
|
||||
, gnat ? null
|
||||
}:
|
||||
|
||||
assert langTreelang -> bison != null && flex != null;
|
||||
|
||||
assert cross != null -> profiledCompiler == false && enableMultilib == true;
|
||||
assert (cross != null && crossStageStatic) -> (langCC == false && langFortran
|
||||
== false && langTreelang == false);
|
||||
|
||||
assert langVhdl -> gnat != null;
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
version = "4.3.6";
|
||||
|
||||
crossConfigureFlags =
|
||||
"--target=${cross.config}" +
|
||||
(if crossStageStatic then
|
||||
" --disable-libssp --disable-nls" +
|
||||
" --without-headers" +
|
||||
" --disable-threads " +
|
||||
" --disable-libmudflap " +
|
||||
" --disable-libgomp " +
|
||||
" --disable-shared"
|
||||
else
|
||||
" --with-headers=${libcCross}/include" +
|
||||
" --enable-__cxa_atexit" +
|
||||
" --enable-long-long" +
|
||||
" --enable-threads=posix" +
|
||||
" --enable-nls"
|
||||
);
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else
|
||||
"-stage-final";
|
||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}-${version}" + crossNameAddon;
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src =
|
||||
optional /*langC*/ true (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
|
||||
sha256 = "0ygrfw3hgp48hkqipbl9lw38f27npigc2sm6f01g9iswpq1igbw6";
|
||||
}) ++
|
||||
optional langCC (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
||||
sha256 = "105xz3991b57zx3146xwlpchdb2sjmlknclvi1iac2gawm4mhxhf";
|
||||
}) ++
|
||||
optional langFortran (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
||||
sha256 = "12bqvf53hvhrwjnh101vn9frb5g8cr98cra4f11dzhzs4ppydpi1";
|
||||
}) ++
|
||||
optional langJava (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
|
||||
sha256 = "03w6jln9gmdv149s774rlw4rzi2zhbqna54r86cd6mql8flmy7fs";
|
||||
});
|
||||
|
||||
patches =
|
||||
[ ./pass-cxxcpp.patch ./libmudflap-cpp.patch ./siginfo_t_fix.patch ]
|
||||
++ optional noSysDirs ./no-sys-dirs.patch
|
||||
++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch
|
||||
++ optional langJava ./java-jvgenmain-link.patch
|
||||
++ optional langVhdl ./ghdl-ortho-cflags.patch
|
||||
++ optional langVhdl ./ghdl-runtime-o2.patch;
|
||||
|
||||
inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
|
||||
binutilsCross libcCross;
|
||||
targetConfig = if cross != null then cross.config else null;
|
||||
|
||||
buildInputs = [texinfo gmp mpfr]
|
||||
++ (optionals langTreelang [bison flex])
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optional (boehmgc != null) boehmgc)
|
||||
++ (optionals (cross != null) [binutilsCross])
|
||||
++ (optionals langVhdl [gnat])
|
||||
;
|
||||
|
||||
hardeningDisable = [ "format" "stackprotector" ];
|
||||
|
||||
configureFlags = "
|
||||
${if enableMultilib then "" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
--disable-libstdcxx-pch
|
||||
--with-system-zlib
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langTreelang "treelang"
|
||||
++ optional langVhdl "vhdl"
|
||||
)
|
||||
)
|
||||
}
|
||||
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
||||
${if cross != null then crossConfigureFlags else ""}
|
||||
";
|
||||
#Above I added a hack on making the build different than the host.
|
||||
|
||||
# Needed for the cross compilation to work
|
||||
AR = "ar";
|
||||
LD = "ld";
|
||||
CC = "gcc";
|
||||
|
||||
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
||||
|
||||
inherit gmp mpfr;
|
||||
|
||||
passthru = { inherit langC langCC langFortran langVhdl langTreelang
|
||||
enableMultilib; };
|
||||
|
||||
# ghdl does not build fine with parallel building
|
||||
enableParallelBuilding = !langVhdl;
|
||||
|
||||
meta = {
|
||||
homepage = "http://gcc.gnu.org/";
|
||||
license = "GPL/LGPL";
|
||||
description = "GNU Compiler Collection, 4.3.x";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
|
||||
} // (if langJava then {
|
||||
postConfigure = ''
|
||||
make configure-gcc
|
||||
sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${zlib}/include@ ; s@^LDFLAGS = .*@& -L${zlib}/lib@'
|
||||
sed -i gcc/Makefile -e 's@^CFLAGS = .*@& -I${boehmgc}/include@ ; s@^LDFLAGS = .*@& -L${boehmgc}/lib -lgc@'
|
||||
'';
|
||||
} else {})
|
||||
// (if langVhdl then rec {
|
||||
name = "ghdl-0.29";
|
||||
|
||||
ghdlSrc = fetchurl {
|
||||
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
|
||||
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
|
||||
};
|
||||
|
||||
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
|
||||
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
|
||||
# content of that .cf to that value. This way ghdl does not complain on
|
||||
# the installed object files from the basic libraries (ieee, ...)
|
||||
postInstallGhdl = ''
|
||||
pushd $out
|
||||
find . -name "*.cf" -exec \
|
||||
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
|
||||
popd
|
||||
'';
|
||||
|
||||
postUnpack = ''
|
||||
tar xvf ${ghdlSrc}
|
||||
mv ghdl-*/vhdl gcc*/gcc
|
||||
rm -Rf ghdl-*
|
||||
'';
|
||||
|
||||
passthru.isGNU = true;
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
|
||||
} else {}))
|
||||
@@ -1,36 +0,0 @@
|
||||
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
|
||||
index 8f481df..681ac59 100644
|
||||
--- a/gcc/vhdl/Make-lang.in
|
||||
+++ b/gcc/vhdl/Make-lang.in
|
||||
@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
|
||||
AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
|
||||
-I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
|
||||
-I$(AGCC_GCCSRC_DIR)/libcpp/include
|
||||
-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
|
||||
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS)
|
||||
|
||||
AGCC_LOCAL_OBJS=ortho-lang.o
|
||||
|
||||
@@ -140,7 +140,7 @@ ghdl$(exeext): force
|
||||
|
||||
# Ghdl libraries.
|
||||
ghdllib: ghdl$(exeext) $(GCC_PASSES) force
|
||||
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
|
||||
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
|
||||
|
||||
# Build hooks:
|
||||
|
||||
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
|
||||
index d754c6c..07abc4a 100644
|
||||
--- a/gcc/vhdl/Makefile.in
|
||||
+++ b/gcc/vhdl/Makefile.in
|
||||
@@ -80,7 +80,8 @@ T_CPPFLAGS =
|
||||
X_ADAFLAGS =
|
||||
T_ADAFLAGS =
|
||||
|
||||
-ADAC = $(CC)
|
||||
+# Never use the bootstrapped compiler, as it may not be built for ada
|
||||
+ADAC = gcc
|
||||
|
||||
ECHO = echo
|
||||
CHMOD = chmod
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
|
||||
index b8d2ed0..0e8bd55 100644
|
||||
--- a/gcc/vhdl/Makefile.in
|
||||
+++ b/gcc/vhdl/Makefile.in
|
||||
@@ -682,7 +682,7 @@ install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \
|
||||
PDIR=`pwd` && cd $(DESTDIR)$(VHDL_LIB_DIR) && \
|
||||
$(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. \
|
||||
LIBSRC_DIR="src" LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 \
|
||||
- ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \
|
||||
+ ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none -Wc,-O2" \
|
||||
std.v93 std.v87 ieee.v93 ieee.v87 synopsys.v93 synopsys.v87 mentor.v93
|
||||
# Copy std_standard (this is done after libraries, since they remove dirs).
|
||||
$(INSTALL_DATA) std87_standard.o \
|
||||
@@ -1,17 +0,0 @@
|
||||
The `jvgenmain' executable must be linked against `vec.o', among others,
|
||||
since it uses its vector API.
|
||||
|
||||
--- gcc-4.3.3/gcc/java/Make-lang.in 2008-12-05 00:00:19.000000000 +0100
|
||||
+++ gcc-4.3.3/gcc/java/Make-lang.in 2009-07-03 16:11:41.000000000 +0200
|
||||
@@ -109,9 +109,9 @@ jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIB
|
||||
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
|
||||
$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
|
||||
|
||||
-jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
|
||||
+jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) $(BUILD_RTL)
|
||||
rm -f $@
|
||||
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
|
||||
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(BUILD_RTL) $(LIBS)
|
||||
|
||||
#
|
||||
# Build hooks:
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index d24c1af..b86e522 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -230,6 +229,7 @@ RAW_CXX_TARGET_EXPORTS = \
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
+ CPP="$(CC_FOR_TARGET) -E"; export CPP; \
|
||||
CXX="$(CXX_FOR_TARGET)"; export CXX;
|
||||
|
||||
# Where to find GMP
|
||||
@@ -1,15 +0,0 @@
|
||||
diff -ru gcc-4.3.1-orig/libgfortran/configure gcc-4.3.1/libgfortran/configure
|
||||
--- gcc-4.3.1-orig/libgfortran/configure 2008-06-06 16:49:11.000000000 +0200
|
||||
+++ gcc-4.3.1/libgfortran/configure 2008-06-27 08:25:08.000000000 +0200
|
||||
@@ -35405,6 +35405,11 @@
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
|
||||
--- gcc-4.3.1-orig/gcc/cppdefault.c 2007-07-26 10:37:01.000000000 +0200
|
||||
+++ gcc-4.3.1/gcc/cppdefault.c 2008-06-25 17:48:23.000000000 +0200
|
||||
@@ -41,6 +41,10 @@
|
||||
# undef CROSS_INCLUDE_DIR
|
||||
#endif
|
||||
|
||||
+#undef LOCAL_INCLUDE_DIR
|
||||
+#undef SYSTEM_INCLUDE_DIR
|
||||
+#undef STANDARD_INCLUDE_DIR
|
||||
+
|
||||
const struct default_include cpp_include_defaults[]
|
||||
#ifdef INCLUDE_DEFAULTS
|
||||
= INCLUDE_DEFAULTS;
|
||||
diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
|
||||
--- gcc-4.3.1-orig/gcc/gcc.c 2008-03-02 23:55:19.000000000 +0100
|
||||
+++ gcc-4.3.1/gcc/gcc.c 2008-06-25 17:52:53.000000000 +0200
|
||||
@@ -1478,10 +1478,10 @@
|
||||
/* Default prefixes to attach to command names. */
|
||||
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_1
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 ""
|
||||
#endif
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_2
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 ""
|
||||
#endif
|
||||
|
||||
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
|
||||
@@ -1515,8 +1515,8 @@
|
||||
/* For native compilers, these are well-known paths containing
|
||||
components that may be provided by the system. For cross
|
||||
compilers, these paths are not used. */
|
||||
-static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
|
||||
-static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
|
||||
+static const char *const standard_exec_prefix_1 = "/no-such-path/";
|
||||
+static const char *const standard_exec_prefix_2 = "/no-such-path/";
|
||||
static const char *md_exec_prefix = MD_EXEC_PREFIX;
|
||||
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
|
||||
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
|
||||
diff -ru gcc-4.3.1-orig/gcc/Makefile.in gcc-4.3.1/gcc/Makefile.in
|
||||
--- gcc-4.3.1-orig/gcc/Makefile.in 2008-05-11 20:54:15.000000000 +0200
|
||||
+++ gcc-4.3.1/gcc/Makefile.in 2008-06-25 17:48:23.000000000 +0200
|
||||
@@ -378,7 +378,11 @@
|
||||
MD5_H = $(srcdir)/../include/md5.h
|
||||
|
||||
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
|
||||
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
|
||||
+# `fixinc' from fixing header files in /usr/include. However,
|
||||
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
|
||||
+# it to some dummy directory.
|
||||
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
|
||||
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
|
||||
|
||||
@@ -3277,7 +3281,7 @@
|
||||
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
|
||||
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
|
||||
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
|
||||
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
|
||||
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
|
||||
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
|
||||
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
|
||||
-DPREFIX=\"$(prefix)/\" \
|
||||
diff -ru gcc-4.3.1-orig/libgomp/configure gcc-4.3.1/libgomp/configure
|
||||
--- gcc-4.3.1-orig/libgomp/configure 2008-01-24 17:23:13.000000000 +0100
|
||||
+++ gcc-4.3.1/libgomp/configure 2008-06-26 11:23:49.000000000 +0200
|
||||
@@ -21493,6 +21493,11 @@
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
Only in gcc-4.3.1/libgomp: configure~
|
||||
diff -ru gcc-4.3.1-orig/libmudflap/configure gcc-4.3.1/libmudflap/configure
|
||||
--- gcc-4.3.1-orig/libmudflap/configure 2008-01-24 17:30:08.000000000 +0100
|
||||
+++ gcc-4.3.1/libmudflap/configure 2008-06-26 11:23:11.000000000 +0200
|
||||
@@ -14229,6 +14229,11 @@
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
Only in gcc-4.3.1/libmudflap: configure~
|
||||
diff -ru gcc-4.3.1-orig/libssp/configure gcc-4.3.1/libssp/configure
|
||||
--- gcc-4.3.1-orig/libssp/configure 2008-01-24 17:33:29.000000000 +0100
|
||||
+++ gcc-4.3.1/libssp/configure 2008-06-26 11:23:25.000000000 +0200
|
||||
@@ -12142,6 +12142,11 @@
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
Only in gcc-4.3.1/libssp: configure~
|
||||
diff -ru gcc-4.3.1-orig/Makefile.in gcc-4.3.1/Makefile.in
|
||||
--- gcc-4.3.1-orig/Makefile.in 2007-12-13 10:30:49.000000000 +0100
|
||||
+++ gcc-4.3.1/Makefile.in 2008-06-25 17:48:23.000000000 +0200
|
||||
@@ -405,6 +405,14 @@
|
||||
@host_makefile_frag@
|
||||
###
|
||||
|
||||
+CFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS_TARGET)
|
||||
+CXXFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+LDFLAGS += $(NIX_EXTRA_LDFLAGS)
|
||||
+LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS_TARGET)
|
||||
+BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
|
||||
+BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
|
||||
+
|
||||
# This is the list of directories that may be needed in RPATH_ENVVAR
|
||||
# so that prorgams built for the target machine work.
|
||||
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)
|
||||
@@ -1,21 +0,0 @@
|
||||
diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
|
||||
*** gcc-orig/Makefile.in Wed Jun 21 13:40:23 2006
|
||||
--- gcc-4.1.1/Makefile.in Wed Jun 21 14:19:44 2006
|
||||
***************
|
||||
*** 213,219 ****
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
--- 213,220 ----
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
|
||||
! CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
@@ -1,174 +0,0 @@
|
||||
https://bugs.gentoo.org/424970
|
||||
|
||||
fix from upstream for building with newer glibc versions
|
||||
|
||||
From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
|
||||
From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Fri, 20 Apr 2012 08:14:00 +0000
|
||||
Subject: [PATCH] struct siginfo vs. siginfo_t
|
||||
|
||||
Backport from trunk (but apply to gcc/):
|
||||
|
||||
2012-04-20 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
gcc/
|
||||
* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
|
||||
siginfo_t instead of struct siginfo.
|
||||
* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
|
||||
* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
|
||||
* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
|
||||
(ia64_handle_unwabi): Likewise.
|
||||
* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
|
||||
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
|
||||
* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
|
||||
(sh_fallback_frame_state): Likewise.
|
||||
* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/ChangeLog | 20 ++++++++++++++++++++
|
||||
gcc/config/alpha/linux-unwind.h | 4 ++--
|
||||
gcc/config/bfin/linux-unwind.h | 6 +++---
|
||||
gcc/config/i386/linux-unwind.h | 6 +++---
|
||||
gcc/config/ia64/linux-unwind.h | 6 +++---
|
||||
gcc/config/mips/linux-unwind.h | 5 +++--
|
||||
gcc/config/pa/linux-unwind.h | 4 ++--
|
||||
gcc/config/sh/linux-unwind.h | 9 +++++----
|
||||
gcc/config/xtensa/linux-unwind.h | 4 ++--
|
||||
9 files changed, 43 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
|
||||
index 4c811dc..8c04b3b 100644
|
||||
--- a/gcc/config/alpha/linux-unwind.h
|
||||
+++ b/gcc/config/alpha/linux-unwind.h
|
||||
@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
|
||||
else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
sc = &rt_->uc.uc_mcontext;
|
||||
diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
|
||||
index 88c8285..15bb2f1 100644
|
||||
--- a/gcc/config/bfin/linux-unwind.h
|
||||
+++ b/gcc/config/bfin/linux-unwind.h
|
||||
@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
|
||||
{
|
||||
struct rt_sigframe {
|
||||
int sig;
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
char retcode[8];
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
|
||||
diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
|
||||
index 36ee370..fe0ea3e 100644
|
||||
--- a/gcc/config/i386/linux-unwind.h
|
||||
+++ b/gcc/config/i386/linux-unwind.h
|
||||
@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
|
||||
{
|
||||
struct rt_sigframe {
|
||||
int sig;
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
|
||||
index 93f762d..da31259 100644
|
||||
--- a/gcc/config/ia64/linux-unwind.h
|
||||
+++ b/gcc/config/ia64/linux-unwind.h
|
||||
@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct sigframe {
|
||||
char scratch[16];
|
||||
unsigned long sig_number;
|
||||
- struct siginfo *info;
|
||||
+ siginfo_t *info;
|
||||
struct sigcontext *sc;
|
||||
} *frame_ = (struct sigframe *)context->psp;
|
||||
struct sigcontext *sc = frame_->sc;
|
||||
@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
||||
struct sigframe {
|
||||
char scratch[16];
|
||||
unsigned long sig_number;
|
||||
- struct siginfo *info;
|
||||
+ siginfo_t *info;
|
||||
struct sigcontext *sc;
|
||||
} *frame = (struct sigframe *)context->psp;
|
||||
struct sigcontext *sc = frame->sc;
|
||||
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
|
||||
index 02f7cd5..094ff58 100644
|
||||
--- a/gcc/config/mips/linux-unwind.h
|
||||
+++ b/gcc/config/mips/linux-unwind.h
|
||||
@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct rt_sigframe {
|
||||
u_int32_t ass[4]; /* Argument save space for o32. */
|
||||
u_int32_t trampoline[2];
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
_sig_ucontext_t uc;
|
||||
} *rt_ = context->cfa;
|
||||
sc = &rt_->uc.uc_mcontext;
|
||||
diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
|
||||
index a0560e9..38b4eda 100644
|
||||
--- a/gcc/config/pa/linux-unwind.h
|
||||
+++ b/gcc/config/pa/linux-unwind.h
|
||||
@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
|
||||
int i;
|
||||
struct sigcontext *sc;
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *frame;
|
||||
|
||||
diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
|
||||
index 94ed95d..5a78e31 100644
|
||||
--- a/gcc/config/sh/linux-unwind.h
|
||||
+++ b/gcc/config/sh/linux-unwind.h
|
||||
@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
|
||||
&& (*(unsigned long *) (pc+11) == 0x6ff0fff0))
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
|
||||
&& (*(unsigned short *) (pc+14) == 0x00ad))))
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
|
||||
index 32e9349..2456497 100644
|
||||
--- a/gcc/config/xtensa/linux-unwind.h
|
||||
+++ b/gcc/config/xtensa/linux-unwind.h
|
||||
@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct sigcontext *sc;
|
||||
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_;
|
||||
|
||||
--
|
||||
1.7.9.7
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
|
||||
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
|
||||
mkdir $NIX_FIXINC_DUMMY
|
||||
|
||||
|
||||
# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
|
||||
# Thing.
|
||||
export CPP="gcc -E"
|
||||
|
||||
if test "$staticCompiler" = "1"; then
|
||||
EXTRA_LDFLAGS="-static"
|
||||
else
|
||||
EXTRA_LDFLAGS=""
|
||||
fi
|
||||
|
||||
if test "$noSysDirs" = "1"; then
|
||||
|
||||
if test -e $NIX_CC/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.
|
||||
extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/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_CC/nix-support/orig-libc)/include
|
||||
|
||||
# The path to the Glibc binaries such as `crti.o'.
|
||||
glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib"
|
||||
|
||||
else
|
||||
# Hack: support impure environments.
|
||||
extraFlags="-isystem /usr/include"
|
||||
extraLDFlags="-L/usr/lib64 -L/usr/lib"
|
||||
glibc_libdir="/usr/lib"
|
||||
export NIX_FIXINC_DUMMY=/usr/include
|
||||
fi
|
||||
|
||||
extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags"
|
||||
extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
|
||||
|
||||
EXTRA_FLAGS="$extraFlags"
|
||||
for i in $extraLDFlags; do
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
|
||||
done
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
# Cross-compiling, we need gcc not to read ./specs in order to build
|
||||
# the g++ compiler (after the specs for the cross-gcc are created).
|
||||
# Having LIBRARY_PATH= makes gcc read the specs from ., and the build
|
||||
# breaks. Having this variable comes from the default.nix code to bring
|
||||
# gcj in.
|
||||
unset LIBRARY_PATH
|
||||
unset CPATH
|
||||
if test -z "$crossStageStatic"; then
|
||||
EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
|
||||
EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
|
||||
fi
|
||||
else
|
||||
if test -z "$NIX_CC_CROSS"; then
|
||||
EXTRA_FLAGS_TARGET="$EXTRA_FLAGS"
|
||||
EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS"
|
||||
else
|
||||
# This the case of cross-building the gcc.
|
||||
# We need special flags for the target, different than those of the build
|
||||
# Assertion:
|
||||
test -e $NIX_CC_CROSS/nix-support/orig-libc
|
||||
|
||||
# Figure out what extra flags to pass to the gcc compilers
|
||||
# being generated to make sure that they use our glibc.
|
||||
extraFlags="$(cat $NIX_CC_CROSS/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_CC_CROSS/nix-support/libc-ldflags) $(cat $NIX_CC_CROSS/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).
|
||||
NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_CC_CROSS/nix-support/orig-libc)/include
|
||||
|
||||
# The path to the Glibc binaries such as `crti.o'.
|
||||
glibc_libdir="$(cat $NIX_CC_CROSS/nix-support/orig-libc)/lib"
|
||||
|
||||
extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
|
||||
extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
|
||||
|
||||
EXTRA_FLAGS_TARGET="$extraFlags"
|
||||
for i in $extraLDFlags; do
|
||||
EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS_TARGET -Wl,$i"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
|
||||
# the startfiles.
|
||||
# FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
|
||||
# for the startfiles.
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
FLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
)
|
||||
|
||||
if test -z "$targetConfig"; then
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
BOOT_LDFLAGS="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
)
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
|
||||
# We don't want the gcc build to assume there will be a libc providing
|
||||
# limits.h in this stagae
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
LIMITS_H_TEST=false \
|
||||
)
|
||||
else
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
LIMITS_H_TEST=true \
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
# The host strip will destroy some important details of the objects
|
||||
dontStrip=1
|
||||
fi
|
||||
|
||||
preConfigure() {
|
||||
if test -n "$newlibSrc"; then
|
||||
tar xvf "$newlibSrc" -C ..
|
||||
ln -s ../newlib-*/newlib newlib
|
||||
# Patch to get armvt5el working:
|
||||
sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
|
||||
fi
|
||||
# Bug - they packaged zlib
|
||||
if test -d "zlib"; then
|
||||
# This breaks the build without-headers, which should build only
|
||||
# the target libgcc as target libraries.
|
||||
# See 'configure:5370'
|
||||
rm -Rf zlib
|
||||
fi
|
||||
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
configureScript=../$sourceRoot/configure
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
rm -rf $out/lib/gcc/*/*/install-tools
|
||||
|
||||
# Get rid of some "fixed" header files
|
||||
rm -rf $out/lib/gcc/*/*/include/root
|
||||
|
||||
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
|
||||
for i in $out/bin/*-gcc*; do
|
||||
if cmp -s $out/bin/gcc $i; then
|
||||
ln -sfn gcc $i
|
||||
fi
|
||||
done
|
||||
|
||||
for i in $out/bin/*-c++* $out/bin/*-g++*; do
|
||||
if cmp -s $out/bin/g++ $i; then
|
||||
ln -sfn g++ $i
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$postInstallGhdl"
|
||||
}
|
||||
|
||||
|
||||
if test -z "$targetConfig" && test -z "$crossConfig"; then
|
||||
if test -z "$profiledCompiler"; then
|
||||
buildFlags="bootstrap $buildFlags"
|
||||
else
|
||||
buildFlags="profiledbootstrap $buildFlags"
|
||||
fi
|
||||
fi
|
||||
|
||||
genericBuild
|
||||
@@ -1,312 +0,0 @@
|
||||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langJava ? false
|
||||
, langAda ? false
|
||||
, langVhdl ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, texinfo ? null
|
||||
, gmp, mpfr, gettext, which
|
||||
, ppl ? null, cloogppl ? null # used by the Graphite optimization framework
|
||||
, zlib ? null, boehmgc ? null
|
||||
, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
|
||||
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
|
||||
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
|
||||
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
|
||||
, gnatboot ? null
|
||||
, enableMultilib ? false
|
||||
, name ? "gcc"
|
||||
, cross ? null
|
||||
, binutilsCross ? null
|
||||
, libcCross ? null
|
||||
, crossStageStatic ? true
|
||||
, gnat ? null
|
||||
}:
|
||||
|
||||
assert langJava -> zip != null && unzip != null
|
||||
&& zlib != null && boehmgc != null;
|
||||
assert langAda -> gnatboot != null;
|
||||
assert langVhdl -> gnat != null;
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let version = "4.4.7";
|
||||
javaEcj = fetchurl {
|
||||
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
|
||||
# `configure' time.
|
||||
|
||||
# XXX: Eventually we might want to take it from upstream.
|
||||
url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
|
||||
sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
|
||||
};
|
||||
|
||||
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
|
||||
# binary distribution here to allow the whole chain to be bootstrapped.
|
||||
javaAntlr = fetchurl {
|
||||
url = http://www.antlr.org/download/antlr-3.1.3.jar;
|
||||
sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
|
||||
};
|
||||
|
||||
xlibs = [
|
||||
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
|
||||
xproto renderproto xextproto inputproto randrproto
|
||||
];
|
||||
|
||||
javaAwtGtk = langJava && gtk != null;
|
||||
|
||||
/* Cross-gcc settings */
|
||||
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
|
||||
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
|
||||
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
|
||||
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
|
||||
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
|
||||
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
|
||||
|
||||
crossConfigureFlags =
|
||||
"--target=${cross.config}" +
|
||||
withArch +
|
||||
withCpu +
|
||||
withAbi +
|
||||
(if crossStageStatic then
|
||||
" --disable-libssp --disable-nls" +
|
||||
" --without-headers" +
|
||||
" --disable-threads " +
|
||||
" --disable-libmudflap " +
|
||||
" --disable-libgomp " +
|
||||
" --disable-shared" +
|
||||
" --disable-decimal-float" # libdecnumber requires libc
|
||||
else
|
||||
" --with-headers=${libcCross}/include" +
|
||||
" --enable-__cxa_atexit" +
|
||||
" --enable-long-long" +
|
||||
" --enable-threads=posix" +
|
||||
" --enable-nls" +
|
||||
" --disable-decimal-float" # No final libdecnumber (it may work only in 386)
|
||||
);
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else
|
||||
"-stage-final";
|
||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||
|
||||
in
|
||||
|
||||
# We need all these X libraries when building AWT with GTK+.
|
||||
assert gtk != null -> (filter (x: x == null) xlibs) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}-${version}" + crossNameAddon;
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = (import ./sources.nix) {
|
||||
inherit fetchurl optional version;
|
||||
inherit langC langCC langFortran langJava langAda;
|
||||
};
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
patches =
|
||||
[ ./pass-cxxcpp.patch
|
||||
|
||||
# libmudflap and libstdc++ receive the build CPP,
|
||||
# and not the target.
|
||||
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279
|
||||
./target-cpp.patch
|
||||
|
||||
# Bad mixture of build/target flags
|
||||
./libstdc++-target.patch
|
||||
|
||||
# Compatibility with newer Glibc.
|
||||
./siginfo_t_fix.patch
|
||||
]
|
||||
++ optional noSysDirs ./no-sys-dirs.patch
|
||||
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
|
||||
# target libraries and tools.
|
||||
++ optional langAda ./gnat-cflags.patch
|
||||
++ optional langVhdl ./ghdl-ortho-cflags.patch
|
||||
++ optional (cross != null && cross.arch == "sparc64") ./pr41818.patch;
|
||||
|
||||
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
|
||||
libcCross;
|
||||
|
||||
nativeBuildInputs = [ texinfo which ];
|
||||
|
||||
buildInputs = [ gmp mpfr gettext ]
|
||||
++ (optional (ppl != null) ppl)
|
||||
++ (optional (cloogppl != null) cloogppl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optional (boehmgc != null) boehmgc)
|
||||
++ (optionals langJava [zip unzip])
|
||||
++ (optionals javaAwtGtk ([gtk pkgconfig libart_lgpl] ++ xlibs))
|
||||
++ (optionals (cross != null) [binutilsCross])
|
||||
++ (optionals langAda [gnatboot])
|
||||
++ (optionals langVhdl [gnat])
|
||||
;
|
||||
|
||||
configureFlags = "
|
||||
${if enableMultilib then "" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if ppl != null then "--with-ppl=${ppl}" else ""}
|
||||
${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
|
||||
${if langJava then "--with-ecj-jar=${javaEcj}" else ""}
|
||||
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
|
||||
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
|
||||
--with-gmp=${gmp}
|
||||
--with-mpfr=${mpfr}
|
||||
--disable-libstdcxx-pch
|
||||
--without-included-gettext
|
||||
--with-system-zlib
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langAda "ada"
|
||||
++ optional langVhdl "vhdl"
|
||||
)
|
||||
)
|
||||
}
|
||||
${if langAda then " --enable-libada" else ""}
|
||||
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
|
||||
${if cross != null then crossConfigureFlags else ""}
|
||||
";
|
||||
|
||||
targetConfig = if cross != null then cross.config else null;
|
||||
|
||||
# Needed for the cross compilation to work
|
||||
AR = "ar";
|
||||
LD = "ld";
|
||||
CC = "gcc";
|
||||
|
||||
crossAttrs = {
|
||||
AR = "${stdenv.cross.config}-ar";
|
||||
LD = "${stdenv.cross.config}-ld";
|
||||
CC = "${stdenv.cross.config}-gcc";
|
||||
CXX = "${stdenv.cross.config}-gcc";
|
||||
AR_FOR_TARGET = "${stdenv.cross.config}-ar";
|
||||
LD_FOR_TARGET = "${stdenv.cross.config}-ld";
|
||||
CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
|
||||
NM_FOR_TARGET = "${stdenv.cross.config}-nm";
|
||||
CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
|
||||
# If we are making a cross compiler, cross != null
|
||||
NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
|
||||
configureFlags = "
|
||||
${if enableMultilib then "" else "--disable-multilib"}
|
||||
${if enableShared then "" else "--disable-shared"}
|
||||
${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
|
||||
${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
|
||||
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
|
||||
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
|
||||
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
|
||||
--with-gmp=${gmp.crossDrv}
|
||||
--with-mpfr=${mpfr.crossDrv}
|
||||
--disable-libstdcxx-pch
|
||||
--without-included-gettext
|
||||
--with-system-zlib
|
||||
--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langAda "ada"
|
||||
++ optional langVhdl "vhdl"
|
||||
)
|
||||
)
|
||||
}
|
||||
${if langAda then " --enable-libada" else ""}
|
||||
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
|
||||
${if cross != null then crossConfigureFlags else ""}
|
||||
--target=${stdenv.cross.config}
|
||||
";
|
||||
};
|
||||
|
||||
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
|
||||
# the library headers and binaries, regarless of the language being
|
||||
# compiled.
|
||||
|
||||
# Note: When building the Java AWT GTK+ peer, the build system doesn't
|
||||
# honor `--with-gmp' et al., e.g., when building
|
||||
# `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
|
||||
# add them to $CPATH and $LIBRARY_PATH in this case.
|
||||
|
||||
CPATH = concatStrings
|
||||
(intersperse ":" (map (x: x + "/include")
|
||||
(optionals langJava [ boehmgc zlib ]
|
||||
++ optionals javaAwtGtk xlibs
|
||||
++ optionals javaAwtGtk [ gmp mpfr ])));
|
||||
|
||||
LIBRARY_PATH = concatStrings
|
||||
(intersperse ":" (map (x: x + "/lib")
|
||||
(optionals langJava [ boehmgc zlib ]
|
||||
++ optionals javaAwtGtk xlibs
|
||||
++ optionals javaAwtGtk [ gmp mpfr ])));
|
||||
|
||||
|
||||
passthru = { inherit langC langCC langAda langFortran langVhdl
|
||||
enableMultilib version; isGNU = true; };
|
||||
|
||||
# ghdl does not build fine with parallel building
|
||||
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46173
|
||||
#enableParallelBuilding = !langVhdl && !langAda;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}";
|
||||
|
||||
longDescription = ''
|
||||
The GNU Compiler Collection includes compiler front ends for C, C++,
|
||||
Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
|
||||
as libraries for these languages (libstdc++, libgcj, libgomp,...).
|
||||
|
||||
GCC development is a part of the GNU Project, aiming to improve the
|
||||
compiler used in the GNU system including the GNU/Linux variant.
|
||||
'';
|
||||
|
||||
maintainers = [
|
||||
# Add your name here!
|
||||
stdenv.lib.maintainers.viric
|
||||
];
|
||||
|
||||
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
|
||||
# gnatboot is not available out of linux platforms, so we disable the darwin build
|
||||
# for the gnat (ada compiler).
|
||||
platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
|
||||
};
|
||||
}
|
||||
// (if langVhdl then rec {
|
||||
name = "ghdl-0.29";
|
||||
|
||||
ghdlSrc = fetchurl {
|
||||
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
|
||||
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
|
||||
};
|
||||
|
||||
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
|
||||
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
|
||||
# content of that .cf to that value. This way ghdl does not complain on
|
||||
# the installed object files from the basic libraries (ieee, ...)
|
||||
postInstallGhdl = ''
|
||||
pushd $out
|
||||
find . -name "*.cf" -exec \
|
||||
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
|
||||
popd
|
||||
'';
|
||||
|
||||
postUnpack = ''
|
||||
tar xvf ${ghdlSrc}
|
||||
mv ghdl-*/vhdl gcc*/gcc
|
||||
rm -Rf ghdl-*
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://ghdl.free.fr/";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
|
||||
} else {}))
|
||||
@@ -1,111 +0,0 @@
|
||||
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
|
||||
index 8f481df..681ac59 100644
|
||||
--- a/gcc/vhdl/Make-lang.in
|
||||
+++ b/gcc/vhdl/Make-lang.in
|
||||
@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
|
||||
AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
|
||||
-I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
|
||||
-I$(AGCC_GCCSRC_DIR)/libcpp/include
|
||||
-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
|
||||
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES)
|
||||
|
||||
AGCC_LOCAL_OBJS=ortho-lang.o
|
||||
|
||||
@@ -140,7 +140,7 @@ ghdl$(exeext): force
|
||||
|
||||
# Ghdl libraries.
|
||||
ghdllib: ghdl$(exeext) $(GCC_PASSES) force
|
||||
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
|
||||
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
|
||||
|
||||
# Build hooks:
|
||||
|
||||
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
|
||||
index d754c6c..07abc4a 100644
|
||||
--- a/gcc/vhdl/Makefile.in
|
||||
+++ b/gcc/vhdl/Makefile.in
|
||||
@@ -80,7 +80,8 @@ T_CPPFLAGS =
|
||||
X_ADAFLAGS =
|
||||
T_ADAFLAGS =
|
||||
|
||||
-ADAC = $(CC)
|
||||
+# Never use the bootstrapped compiler, as it may not be built for ada
|
||||
+ADAC = gcc
|
||||
|
||||
ECHO = echo
|
||||
CHMOD = chmod
|
||||
diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c
|
||||
index 84aeb92..8eddd42 100644
|
||||
--- a/gcc/vhdl/ortho-lang.c
|
||||
+++ b/gcc/vhdl/ortho-lang.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "options.h"
|
||||
#include "real.h"
|
||||
-#include "tree-gimple.h"
|
||||
+#include "gimple.h"
|
||||
+#include "tree.h"
|
||||
#include "function.h"
|
||||
#include "cgraph.h"
|
||||
#include "target.h"
|
||||
@@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp)
|
||||
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
||||
-/* Tree code classes. */
|
||||
-
|
||||
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
|
||||
-
|
||||
-const enum tree_code_class tree_code_type[] = {
|
||||
-#include "tree.def"
|
||||
- 'x'
|
||||
-};
|
||||
-#undef DEFTREECODE
|
||||
-
|
||||
-/* Table indexed by tree code giving number of expression
|
||||
- operands beyond the fixed part of the node structure.
|
||||
- Not used for types or decls. */
|
||||
-
|
||||
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
|
||||
-
|
||||
-const unsigned char tree_code_length[] = {
|
||||
-#include "tree.def"
|
||||
- 0
|
||||
-};
|
||||
-#undef DEFTREECODE
|
||||
-
|
||||
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME,
|
||||
-const char * const tree_code_name[] = {
|
||||
-#include "tree.def"
|
||||
- "@@dummy"
|
||||
-};
|
||||
-#undef DEFTREECODE
|
||||
|
||||
union lang_tree_node
|
||||
GTY((desc ("0"),
|
||||
- chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)")))
|
||||
+ chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
|
||||
{
|
||||
union tree_node GTY ((tag ("0"))) generic;
|
||||
};
|
||||
@@ -1162,7 +1135,7 @@ new_access_type (tree dtype)
|
||||
res = make_node (POINTER_TYPE);
|
||||
TREE_TYPE (res) = NULL_TREE;
|
||||
/* Seems necessary. */
|
||||
- TYPE_MODE (res) = Pmode;
|
||||
+ SET_TYPE_MODE (res, Pmode);
|
||||
layout_type (res);
|
||||
return res;
|
||||
}
|
||||
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
|
||||
index e201f64..f36fb97 100644
|
||||
--- a/gcc/vhdl/Make-lang.in
|
||||
+++ b/gcc/vhdl/Make-lang.in
|
||||
@@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force
|
||||
-cargs $(CFLAGS) $(GHDL_ADAFLAGS)
|
||||
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
|
||||
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
|
||||
- -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS)
|
||||
+ -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS)
|
||||
|
||||
# The driver for ghdl.
|
||||
ghdl$(exeext): force
|
||||
@@ -1,33 +0,0 @@
|
||||
diff --git a/libada/Makefile.in b/libada/Makefile.in
|
||||
index f5057a0..337e0c6 100644
|
||||
--- a/libada/Makefile.in
|
||||
+++ b/libada/Makefile.in
|
||||
@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
|
||||
WARN_CFLAGS = @warn_cflags@
|
||||
|
||||
TARGET_LIBGCC2_CFLAGS=
|
||||
-GNATLIBCFLAGS= -g -O2
|
||||
+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
|
||||
GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
|
||||
-DIN_RTS @have_getipinfo@
|
||||
|
||||
--- a/gcc/ada/gcc-interface/Makefile.in
|
||||
+++ b/gcc/ada/gcc-interface/Makefile.in
|
||||
@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
|
||||
SOME_ADAFLAGS =-gnata
|
||||
FORCE_DEBUG_ADAFLAGS = -g
|
||||
GNATLIBFLAGS = -gnatpg -nostdinc
|
||||
-GNATLIBCFLAGS = -g -O2
|
||||
+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
|
||||
# Pretend that _Unwind_GetIPInfo is available for the target by default. This
|
||||
# should be autodetected during the configuration of libada and passed down to
|
||||
# here, but we need something for --disable-libada and hope for the best.
|
||||
@@ -1838,7 +1838,7 @@ ADA_INCLUDE_SRCS =\
|
||||
|
||||
LIBGNAT=../$(RTSDIR)/libgnat.a
|
||||
|
||||
-GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
|
||||
+GCC_LINK=$(CC) -static-libgcc $(CFLAGS_FOR_TARGET) $(ADA_INCLUDES)
|
||||
|
||||
# when compiling the tools, the runtime has to be first on the path so that
|
||||
# it hides the runtime files lying with the rest of the sources
|
||||
@@ -1,15 +0,0 @@
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 245c770..8545b60 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -250,8 +250,8 @@ BASE_TARGET_EXPORTS = \
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
- CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
|
||||
- CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
|
||||
+ CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET)"; export CXX; \
|
||||
+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E"; export CXXCPP;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
@@ -1,66 +0,0 @@
|
||||
diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
|
||||
--- gcc-4.3.1-orig/gcc/cppdefault.c 2007-07-26 10:37:01.000000000 +0200
|
||||
+++ gcc-4.3.1/gcc/cppdefault.c 2008-06-25 17:48:23.000000000 +0200
|
||||
@@ -41,6 +41,10 @@
|
||||
# undef CROSS_INCLUDE_DIR
|
||||
#endif
|
||||
|
||||
+#undef LOCAL_INCLUDE_DIR
|
||||
+#undef SYSTEM_INCLUDE_DIR
|
||||
+#undef STANDARD_INCLUDE_DIR
|
||||
+
|
||||
const struct default_include cpp_include_defaults[]
|
||||
#ifdef INCLUDE_DEFAULTS
|
||||
= INCLUDE_DEFAULTS;
|
||||
diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
|
||||
--- gcc-4.3.1-orig/gcc/gcc.c 2008-03-02 23:55:19.000000000 +0100
|
||||
+++ gcc-4.3.1/gcc/gcc.c 2008-06-25 17:52:53.000000000 +0200
|
||||
@@ -1478,10 +1478,10 @@
|
||||
/* Default prefixes to attach to command names. */
|
||||
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_1
|
||||
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_1 ""
|
||||
#endif
|
||||
#ifndef STANDARD_STARTFILE_PREFIX_2
|
||||
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
|
||||
+#define STANDARD_STARTFILE_PREFIX_2 ""
|
||||
#endif
|
||||
|
||||
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
|
||||
@@ -1515,8 +1515,8 @@
|
||||
/* For native compilers, these are well-known paths containing
|
||||
components that may be provided by the system. For cross
|
||||
compilers, these paths are not used. */
|
||||
-static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
|
||||
-static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
|
||||
+static const char *const standard_exec_prefix_1 = "/no-such-path/";
|
||||
+static const char *const standard_exec_prefix_2 = "/no-such-path/";
|
||||
static const char *md_exec_prefix = MD_EXEC_PREFIX;
|
||||
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
|
||||
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
|
||||
diff -ru gcc-4.3.1-orig/gcc/Makefile.in gcc-4.3.1/gcc/Makefile.in
|
||||
--- gcc-4.3.1-orig/gcc/Makefile.in 2008-05-11 20:54:15.000000000 +0200
|
||||
+++ gcc-4.3.1/gcc/Makefile.in 2008-06-25 17:48:23.000000000 +0200
|
||||
@@ -378,7 +378,11 @@
|
||||
MD5_H = $(srcdir)/../include/md5.h
|
||||
|
||||
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
|
||||
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
|
||||
+# `fixinc' from fixing header files in /usr/include. However,
|
||||
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
|
||||
+# it to some dummy directory.
|
||||
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
|
||||
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
|
||||
|
||||
@@ -3277,7 +3281,7 @@
|
||||
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
|
||||
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
|
||||
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
|
||||
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
|
||||
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
|
||||
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
|
||||
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
|
||||
-DPREFIX=\"$(prefix)/\" \
|
||||
@@ -1,21 +0,0 @@
|
||||
diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
|
||||
*** gcc-orig/Makefile.in Wed Jun 21 13:40:23 2006
|
||||
--- gcc-4.1.1/Makefile.in Wed Jun 21 14:19:44 2006
|
||||
***************
|
||||
*** 213,219 ****
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
--- 213,220 ----
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
|
||||
! CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
|
||||
! CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
|
||||
|
||||
NORMAL_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
@@ -1,26 +0,0 @@
|
||||
From <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41818>. This fixes compilation
|
||||
of the sparc64-linux-gnu cross-compiler with shared libraries.
|
||||
|
||||
--- trunk/Makefile.in 2010/01/07 19:21:46 155705
|
||||
+++ trunk/Makefile.in 2010/01/07 19:53:50 155706
|
||||
@@ -259,7 +259,7 @@
|
||||
# directories built for the target.
|
||||
TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
|
||||
# This is the list of variables to export in the environment when
|
||||
-# configuring subdirectories for the host system.
|
||||
+# configuring subdirectories for the target system.
|
||||
BASE_TARGET_EXPORTS = \
|
||||
$(BASE_EXPORTS) \
|
||||
AR="$(AR_FOR_TARGET)"; export AR; \
|
||||
@@ -281,7 +281,10 @@
|
||||
STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
|
||||
WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
|
||||
WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
|
||||
- $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
|
||||
+@if gcc-bootstrap
|
||||
+ $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
|
||||
+@endif gcc-bootstrap
|
||||
+ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
|
||||
|
||||
RAW_CXX_TARGET_EXPORTS = \
|
||||
$(BASE_TARGET_EXPORTS) \
|
||||
@@ -1,174 +0,0 @@
|
||||
https://bugs.gentoo.org/424970
|
||||
|
||||
fix from upstream for building with newer glibc versions
|
||||
|
||||
From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
|
||||
From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Fri, 20 Apr 2012 08:14:00 +0000
|
||||
Subject: [PATCH] struct siginfo vs. siginfo_t
|
||||
|
||||
Backport from trunk (but apply to gcc/):
|
||||
|
||||
2012-04-20 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
gcc/
|
||||
* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
|
||||
siginfo_t instead of struct siginfo.
|
||||
* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
|
||||
* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
|
||||
* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
|
||||
(ia64_handle_unwabi): Likewise.
|
||||
* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
|
||||
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
|
||||
* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
|
||||
(sh_fallback_frame_state): Likewise.
|
||||
* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
gcc/ChangeLog | 20 ++++++++++++++++++++
|
||||
gcc/config/alpha/linux-unwind.h | 4 ++--
|
||||
gcc/config/bfin/linux-unwind.h | 6 +++---
|
||||
gcc/config/i386/linux-unwind.h | 6 +++---
|
||||
gcc/config/ia64/linux-unwind.h | 6 +++---
|
||||
gcc/config/mips/linux-unwind.h | 5 +++--
|
||||
gcc/config/pa/linux-unwind.h | 4 ++--
|
||||
gcc/config/sh/linux-unwind.h | 9 +++++----
|
||||
gcc/config/xtensa/linux-unwind.h | 4 ++--
|
||||
9 files changed, 43 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
|
||||
index 4c811dc..8c04b3b 100644
|
||||
--- a/gcc/config/alpha/linux-unwind.h
|
||||
+++ b/gcc/config/alpha/linux-unwind.h
|
||||
@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
|
||||
else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
sc = &rt_->uc.uc_mcontext;
|
||||
diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
|
||||
index 88c8285..15bb2f1 100644
|
||||
--- a/gcc/config/bfin/linux-unwind.h
|
||||
+++ b/gcc/config/bfin/linux-unwind.h
|
||||
@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
|
||||
{
|
||||
struct rt_sigframe {
|
||||
int sig;
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
char retcode[8];
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
|
||||
diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
|
||||
index 36ee370..fe0ea3e 100644
|
||||
--- a/gcc/config/i386/linux-unwind.h
|
||||
+++ b/gcc/config/i386/linux-unwind.h
|
||||
@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
|
||||
{
|
||||
struct rt_sigframe {
|
||||
int sig;
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
|
||||
index 93f762d..da31259 100644
|
||||
--- a/gcc/config/ia64/linux-unwind.h
|
||||
+++ b/gcc/config/ia64/linux-unwind.h
|
||||
@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct sigframe {
|
||||
char scratch[16];
|
||||
unsigned long sig_number;
|
||||
- struct siginfo *info;
|
||||
+ siginfo_t *info;
|
||||
struct sigcontext *sc;
|
||||
} *frame_ = (struct sigframe *)context->psp;
|
||||
struct sigcontext *sc = frame_->sc;
|
||||
@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
|
||||
struct sigframe {
|
||||
char scratch[16];
|
||||
unsigned long sig_number;
|
||||
- struct siginfo *info;
|
||||
+ siginfo_t *info;
|
||||
struct sigcontext *sc;
|
||||
} *frame = (struct sigframe *)context->psp;
|
||||
struct sigcontext *sc = frame->sc;
|
||||
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
|
||||
index 02f7cd5..094ff58 100644
|
||||
--- a/gcc/config/mips/linux-unwind.h
|
||||
+++ b/gcc/config/mips/linux-unwind.h
|
||||
@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct rt_sigframe {
|
||||
u_int32_t ass[4]; /* Argument save space for o32. */
|
||||
u_int32_t trampoline[2];
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
_sig_ucontext_t uc;
|
||||
} *rt_ = context->cfa;
|
||||
sc = &rt_->uc.uc_mcontext;
|
||||
diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
|
||||
index a0560e9..38b4eda 100644
|
||||
--- a/gcc/config/pa/linux-unwind.h
|
||||
+++ b/gcc/config/pa/linux-unwind.h
|
||||
@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
|
||||
int i;
|
||||
struct sigcontext *sc;
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *frame;
|
||||
|
||||
diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
|
||||
index 94ed95d..5a78e31 100644
|
||||
--- a/gcc/config/sh/linux-unwind.h
|
||||
+++ b/gcc/config/sh/linux-unwind.h
|
||||
@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
|
||||
&& (*(unsigned long *) (pc+11) == 0x6ff0fff0))
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo *pinfo;
|
||||
+ siginfo_t *pinfo;
|
||||
void *puc;
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
|
||||
&& (*(unsigned short *) (pc+14) == 0x00ad))))
|
||||
{
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_ = context->cfa;
|
||||
/* The void * cast is necessary to avoid an aliasing warning.
|
||||
diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
|
||||
index 32e9349..2456497 100644
|
||||
--- a/gcc/config/xtensa/linux-unwind.h
|
||||
+++ b/gcc/config/xtensa/linux-unwind.h
|
||||
@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
|
||||
struct sigcontext *sc;
|
||||
|
||||
struct rt_sigframe {
|
||||
- struct siginfo info;
|
||||
+ siginfo_t info;
|
||||
struct ucontext uc;
|
||||
} *rt_;
|
||||
|
||||
--
|
||||
1.7.9.7
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/* Automatically generated by `update-gcc.sh', do not edit.
|
||||
For GCC 4.4.7. */
|
||||
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
|
||||
|
||||
assert version == "4.4.7";
|
||||
optional /* langC */ true (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
|
||||
sha256 = "c4663b7023909a4a075d3c2b2e17f6e082a9625aebfd0ce7f1d7817e44bf5542";
|
||||
}) ++
|
||||
optional langCC (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
||||
sha256 = "1882ff29be51eeb3fb349cbcda9df200a5c3cd20c97dd1d593101e0998b3c469";
|
||||
}) ++
|
||||
optional langFortran (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
||||
sha256 = "545a1e8e97d9364de4408c6a91830f9051ce24b4fbfbfdc56e72c7b4be17ebdd";
|
||||
}) ++
|
||||
optional langJava (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
|
||||
sha256 = "3c31ddd80f945b797d8d4ed7761426c26343781c361ec1b33bcea9874cc4c6c0";
|
||||
}) ++
|
||||
optional langAda (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
|
||||
sha256 = "fb9f30b85d48838390554b948d137487f0db09ad5f8ba73ca4d7ca35765c6ed8";
|
||||
}) ++
|
||||
[]
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 8545b60..1fab64d 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -231,6 +231,7 @@ BASE_TARGET_EXPORTS = \
|
||||
CC="$(CC_FOR_TARGET)"; export CC; \
|
||||
CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
|
||||
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
|
||||
+ CPP="$(CC_FOR_TARGET) -E"; export CPP; \
|
||||
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
|
||||
CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
|
||||
GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
|
||||
@@ -1,64 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "Usage: $(basename $0) VERSION"
|
||||
echo
|
||||
echo "Download and GPG-check component tarballs for GCC VERSION."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
|
||||
set -e
|
||||
|
||||
out="sources.nix"
|
||||
|
||||
declare -A options
|
||||
|
||||
options["core"]="/* langC */ true"
|
||||
options["g++"]="langCC"
|
||||
options["fortran"]="langFortran"
|
||||
options["java"]="langJava"
|
||||
options["ada"]="langAda"
|
||||
#options["go"]="langGo"
|
||||
|
||||
cat > "$out"<<EOF
|
||||
/* Automatically generated by \`$(basename $0)', do not edit.
|
||||
For GCC ${version}. */
|
||||
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda,
|
||||
langGo }:
|
||||
|
||||
assert version == "${version}";
|
||||
EOF
|
||||
|
||||
for component in core g++ fortran java ada #go
|
||||
do
|
||||
dir="ftp.gnu.org/gnu/gcc/gcc-${version}"
|
||||
file="gcc-${component}-${version}.tar.bz2"
|
||||
url="${dir}/${file}"
|
||||
|
||||
rm -f "${file}"
|
||||
|
||||
wget "$url"
|
||||
hash="$(nix-hash --flat --type sha256 "$file")"
|
||||
path="$(nix-store --add-fixed sha256 "$file")"
|
||||
|
||||
rm -f "${file}" "${file}.sig"
|
||||
wget "${url}.sig"
|
||||
gpg --verify "${file}.sig" "${path}" || gpg2 --verify "${file}.sig" "${path}"
|
||||
rm "${file}.sig"
|
||||
|
||||
cat >> "$out" <<EOF
|
||||
optional ${options[$component]} (fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-\${version}/gcc-${component}-\${version}.tar.bz2";
|
||||
sha256 = "${hash}";
|
||||
}) ++
|
||||
EOF
|
||||
done
|
||||
|
||||
cat >> "$out" <<EOF
|
||||
[]
|
||||
EOF
|
||||
|
||||
echo "result stored in \`$out'"
|
||||
@@ -497,6 +497,8 @@ stdenv.mkDerivation ({
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
setupHook = ./use-old-abi.sh;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
|
||||
1
pkgs/development/compilers/gcc/5/use-old-abi.sh
Normal file
1
pkgs/development/compilers/gcc/5/use-old-abi.sh
Normal file
@@ -0,0 +1 @@
|
||||
NIX_CFLAGS_COMPILE+=" -D_GLIBCXX_USE_CXX11_ABI=0"
|
||||
@@ -16,6 +16,11 @@ stdenv.mkDerivation rec {
|
||||
url = "http://gnu.spinellicreations.com/gcl/${name}.tar.gz";
|
||||
};
|
||||
|
||||
patches = [(fetchurl {
|
||||
url = https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-lisp/gcl/files/gcl-2.6.12-gcc5.patch;
|
||||
sha256 = "00jbsn0qp8ki2w7dx8caha7g2hr9076xa6bg48j3qqqncff93zdh";
|
||||
})];
|
||||
|
||||
buildInputs = [
|
||||
mpfr m4 binutils emacs gmp
|
||||
libX11 xproto inputproto libXi
|
||||
@@ -29,6 +34,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningDisable = [ "pic" ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fgnu89-inline";
|
||||
|
||||
meta = {
|
||||
description = "GNU Common Lisp compiler working via GCC";
|
||||
maintainers = [ stdenv.lib.maintainers.raskin ];
|
||||
|
||||
@@ -89,6 +89,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
patches = [
|
||||
./remove-tools-1.4.patch
|
||||
./new-binutils.patch
|
||||
];
|
||||
|
||||
GOOS = if stdenv.isDarwin then "darwin" else "linux";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ stdenv, lib, fetchurl, tzdata, iana_etc, go_1_4, runCommand
|
||||
, perl, which, pkgconfig, patch
|
||||
, perl, which, pkgconfig, patch, fetchpatch
|
||||
, pcre
|
||||
, Security, Foundation }:
|
||||
|
||||
@@ -48,6 +48,11 @@ stdenv.mkDerivation rec {
|
||||
cd go
|
||||
patchShebangs ./ # replace /bin/bash
|
||||
|
||||
# This script produces another script at run time,
|
||||
# and thus it is not corrected by patchShebangs.
|
||||
substituteInPlace misc/cgo/testcarchive/test.bash \
|
||||
--replace '#!/usr/bin/env bash' '#!${stdenv.shell}'
|
||||
|
||||
# Disabling the 'os/http/net' tests (they want files not available in
|
||||
# chroot builds)
|
||||
rm src/net/{listen,parse}_test.go
|
||||
@@ -93,6 +98,12 @@ stdenv.mkDerivation rec {
|
||||
|
||||
patches = [
|
||||
./remove-tools-1.5.patch
|
||||
# Fix bug when using musl (see https://github.com/golang/go/issues/14476)
|
||||
# Should be fixed by go 1.6.1
|
||||
(fetchpatch {
|
||||
url = "https://github.com/golang/go/commit/1439158120742e5f41825de90a76b680da64bf76.patch";
|
||||
sha256 = "0yixpbx056ns5wgd3f4absgiyc2ymmqk8mkhhz5ja90dvilzxcwd";
|
||||
})
|
||||
]
|
||||
# -ldflags=-s is required to compile on Darwin, see
|
||||
# https://github.com/golang/go/issues/11994
|
||||
|
||||
194
pkgs/development/compilers/go/new-binutils.patch
Normal file
194
pkgs/development/compilers/go/new-binutils.patch
Normal file
@@ -0,0 +1,194 @@
|
||||
https://github.com/golang/go/issues/13114
|
||||
https://gnats.netbsd.org/50777
|
||||
|
||||
--- a/src/cmd/6l/asm.c 2015-09-23 06:20:05.000000000 +0200
|
||||
+++ b/src/cmd/6l/asm.c 2016-03-10 21:00:29.032083210 +0100
|
||||
@@ -118,6 +118,8 @@
|
||||
return;
|
||||
|
||||
case 256 + R_X86_64_GOTPCREL:
|
||||
+ case 256 + R_X86_64_GOTPCRELX:
|
||||
+ case 256 + R_X86_64_REX_GOTPCRELX:
|
||||
if(targ->type != SDYNIMPORT) {
|
||||
// have symbol
|
||||
if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
|
||||
--- a/src/cmd/8l/asm.c 2015-09-23 06:20:05.000000000 +0200
|
||||
+++ b/src/cmd/8l/asm.c 2016-03-10 21:02:16.702064080 +0100
|
||||
@@ -115,6 +115,7 @@
|
||||
return;
|
||||
|
||||
case 256 + R_386_GOT32:
|
||||
+ case 256 + R_386_GOT32X:
|
||||
if(targ->type != SDYNIMPORT) {
|
||||
// have symbol
|
||||
if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
|
||||
--- a/src/cmd/ld/elf.h 2015-09-23 06:20:05.000000000 +0200
|
||||
+++ b/src/cmd/ld/elf.h 2016-03-10 21:00:29.033083211 +0100
|
||||
@@ -478,32 +478,47 @@
|
||||
* Relocation types.
|
||||
*/
|
||||
|
||||
-#define R_X86_64_NONE 0 /* No relocation. */
|
||||
-#define R_X86_64_64 1 /* Add 64 bit symbol value. */
|
||||
-#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */
|
||||
-#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */
|
||||
-#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */
|
||||
-#define R_X86_64_COPY 5 /* Copy data from shared object. */
|
||||
-#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */
|
||||
-#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */
|
||||
-#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */
|
||||
-#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */
|
||||
-#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */
|
||||
-#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */
|
||||
-#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */
|
||||
-#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */
|
||||
-#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */
|
||||
-#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */
|
||||
-#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
|
||||
-#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */
|
||||
-#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */
|
||||
-#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */
|
||||
-#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */
|
||||
-#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
|
||||
-#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */
|
||||
-#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */
|
||||
-
|
||||
-#define R_X86_64_COUNT 24 /* Count of defined relocation types. */
|
||||
+#define R_X86_64_NONE 0
|
||||
+#define R_X86_64_64 1
|
||||
+#define R_X86_64_PC32 2
|
||||
+#define R_X86_64_GOT32 3
|
||||
+#define R_X86_64_PLT32 4
|
||||
+#define R_X86_64_COPY 5
|
||||
+#define R_X86_64_GLOB_DAT 6
|
||||
+#define R_X86_64_JMP_SLOT 7
|
||||
+#define R_X86_64_RELATIVE 8
|
||||
+#define R_X86_64_GOTPCREL 9
|
||||
+#define R_X86_64_32 10
|
||||
+#define R_X86_64_32S 11
|
||||
+#define R_X86_64_16 12
|
||||
+#define R_X86_64_PC16 13
|
||||
+#define R_X86_64_8 14
|
||||
+#define R_X86_64_PC8 15
|
||||
+#define R_X86_64_DTPMOD64 16
|
||||
+#define R_X86_64_DTPOFF64 17
|
||||
+#define R_X86_64_TPOFF64 18
|
||||
+#define R_X86_64_TLSGD 19
|
||||
+#define R_X86_64_TLSLD 20
|
||||
+#define R_X86_64_DTPOFF32 21
|
||||
+#define R_X86_64_GOTTPOFF 22
|
||||
+#define R_X86_64_TPOFF32 23
|
||||
+#define R_X86_64_PC64 24
|
||||
+#define R_X86_64_GOTOFF64 25
|
||||
+#define R_X86_64_GOTPC32 26
|
||||
+#define R_X86_64_GOT64 27
|
||||
+#define R_X86_64_GOTPCREL64 28
|
||||
+#define R_X86_64_GOTPC64 29
|
||||
+#define R_X86_64_GOTPLT64 30
|
||||
+#define R_X86_64_PLTOFF64 31
|
||||
+#define R_X86_64_SIZE32 32
|
||||
+#define R_X86_64_SIZE64 33
|
||||
+#define R_X86_64_GOTPC32_TLSDEC 34
|
||||
+#define R_X86_64_TLSDESC_CALL 35
|
||||
+#define R_X86_64_TLSDESC 36
|
||||
+#define R_X86_64_IRELATIVE 37
|
||||
+#define R_X86_64_PC32_BND 40
|
||||
+#define R_X86_64_GOTPCRELX 41
|
||||
+#define R_X86_64_REX_GOTPCRELX 42
|
||||
|
||||
|
||||
#define R_ALPHA_NONE 0 /* No reloc */
|
||||
@@ -581,39 +596,42 @@
|
||||
#define R_ARM_COUNT 38 /* Count of defined relocation types. */
|
||||
|
||||
|
||||
-#define R_386_NONE 0 /* No relocation. */
|
||||
-#define R_386_32 1 /* Add symbol value. */
|
||||
-#define R_386_PC32 2 /* Add PC-relative symbol value. */
|
||||
-#define R_386_GOT32 3 /* Add PC-relative GOT offset. */
|
||||
-#define R_386_PLT32 4 /* Add PC-relative PLT offset. */
|
||||
-#define R_386_COPY 5 /* Copy data from shared object. */
|
||||
-#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */
|
||||
-#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */
|
||||
-#define R_386_RELATIVE 8 /* Add load address of shared object. */
|
||||
-#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */
|
||||
-#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */
|
||||
-#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */
|
||||
-#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */
|
||||
-#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */
|
||||
-#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */
|
||||
-#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */
|
||||
-#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */
|
||||
-#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */
|
||||
-#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */
|
||||
-#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */
|
||||
-#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */
|
||||
-#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */
|
||||
-#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */
|
||||
-#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */
|
||||
-#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */
|
||||
-#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */
|
||||
-#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */
|
||||
-#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */
|
||||
-#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
|
||||
-#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
|
||||
-#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
|
||||
-
|
||||
-#define R_386_COUNT 38 /* Count of defined relocation types. */
|
||||
+#define R_386_NONE 0
|
||||
+#define R_386_32 1
|
||||
+#define R_386_PC32 2
|
||||
+#define R_386_GOT32 3
|
||||
+#define R_386_PLT32 4
|
||||
+#define R_386_COPY 5
|
||||
+#define R_386_GLOB_DAT 6
|
||||
+#define R_386_JMP_SLOT 7
|
||||
+#define R_386_RELATIVE 8
|
||||
+#define R_386_GOTOFF 9
|
||||
+#define R_386_GOTPC 10
|
||||
+#define R_386_TLS_TPOFF 14
|
||||
+#define R_386_TLS_IE 15
|
||||
+#define R_386_TLS_GOTIE 16
|
||||
+#define R_386_TLS_LE 17
|
||||
+#define R_386_TLS_GD 18
|
||||
+#define R_386_TLS_LDM 19
|
||||
+#define R_386_TLS_GD_32 24
|
||||
+#define R_386_TLS_GD_PUSH 25
|
||||
+#define R_386_TLS_GD_CALL 26
|
||||
+#define R_386_TLS_GD_POP 27
|
||||
+#define R_386_TLS_LDM_32 28
|
||||
+#define R_386_TLS_LDM_PUSH 29
|
||||
+#define R_386_TLS_LDM_CALL 30
|
||||
+#define R_386_TLS_LDM_POP 31
|
||||
+#define R_386_TLS_LDO_32 32
|
||||
+#define R_386_TLS_IE_32 33
|
||||
+#define R_386_TLS_LE_32 34
|
||||
+#define R_386_TLS_DTPMOD32 35
|
||||
+#define R_386_TLS_DTPOFF32 36
|
||||
+#define R_386_TLS_TPOFF32 37
|
||||
+#define R_386_TLS_GOTDESC 39
|
||||
+#define R_386_TLS_DESC_CALL 40
|
||||
+#define R_386_TLS_DESC 41
|
||||
+#define R_386_IRELATIVE 42
|
||||
+#define R_386_GOT32X 43
|
||||
|
||||
#define R_PPC_NONE 0 /* No relocation. */
|
||||
#define R_PPC_ADDR32 1
|
||||
--- a/src/cmd/ld/ldelf.c 2015-09-23 06:20:05.000000000 +0200
|
||||
+++ b/src/cmd/ld/ldelf.c 2016-03-10 21:00:29.033083211 +0100
|
||||
@@ -888,12 +888,15 @@
|
||||
case R('6', R_X86_64_PC32):
|
||||
case R('6', R_X86_64_PLT32):
|
||||
case R('6', R_X86_64_GOTPCREL):
|
||||
+ case R('6', R_X86_64_GOTPCRELX):
|
||||
+ case R('6', R_X86_64_REX_GOTPCRELX):
|
||||
case R('8', R_386_32):
|
||||
case R('8', R_386_PC32):
|
||||
case R('8', R_386_GOT32):
|
||||
case R('8', R_386_PLT32):
|
||||
case R('8', R_386_GOTOFF):
|
||||
case R('8', R_386_GOTPC):
|
||||
+ case R('8', R_386_GOT32X):
|
||||
*siz = 4;
|
||||
break;
|
||||
case R('6', R_X86_64_64):
|
||||
@@ -3,18 +3,18 @@
|
||||
, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
|
||||
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
|
||||
, libxslt, ocaml, freetype, gdb, git, perl, mariadb, gmp, libyaml, libedit
|
||||
, libvpx, imagemagick, fribidi
|
||||
, libvpx, imagemagick, fribidi, gperf
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "hhvm-${version}";
|
||||
version = "3.6.0";
|
||||
version = "3.12.1";
|
||||
|
||||
# use git version since we need submodules
|
||||
src = fetchgit {
|
||||
url = "https://github.com/facebook/hhvm.git";
|
||||
rev = "6ef13f20da20993dc8bab9eb103f73568618d3e8";
|
||||
sha256 = "29a2d4b56cfd348b199d8f90b4e4b07de85dfb2ef1538479cd1e84f5bc1fbf96";
|
||||
rev = "f516f1bb9046218f89885a220354c19dda6d8f4d";
|
||||
sha256 = "1jdw6j394z7ksg4wdcnm7lkcs7iam5myx6k18w8hr595s1dfk3sj";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
@@ -23,10 +23,10 @@ stdenv.mkDerivation rec {
|
||||
libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
|
||||
oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
|
||||
libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml libkrb5
|
||||
gmp libyaml libedit libvpx imagemagick fribidi
|
||||
gmp libyaml libedit libvpx imagemagick fribidi gperf
|
||||
];
|
||||
|
||||
enableParallelBuilding = false;
|
||||
enableParallelBuilding = true;
|
||||
dontUseCmakeBuildDir = true;
|
||||
NIX_LDFLAGS = "-lpam -L${pam}/lib";
|
||||
MYSQL_INCLUDE_DIR="${mariadb}/include/mysql";
|
||||
@@ -40,8 +40,12 @@ stdenv.mkDerivation rec {
|
||||
--replace /bin/bash ${stdenv.shell}
|
||||
substituteInPlace ./configure \
|
||||
--replace "/usr/bin/env bash" ${stdenv.shell}
|
||||
sed '1i#include <vector>' \
|
||||
-i ./third-party/mcrouter/mcrouter/lib/fibers/TimeoutController.h
|
||||
perl -pi -e 's/([ \t(])(isnan|isinf)\(/$1std::$2(/g' \
|
||||
hphp/runtime/base/*.cpp \
|
||||
hphp/runtime/ext/std/*.cpp \
|
||||
hphp/runtime/ext_zend_compat/php-src/main/*.cpp \
|
||||
hphp/runtime/ext_zend_compat/php-src/main/*.h
|
||||
patchShebangs .
|
||||
'';
|
||||
|
||||
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
|
||||
|
||||
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "15qi22qvmlx3jrhrf3rwl0y77v66prpan6qb66a55dw3pw2d4jvn";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
enableParallelBuilding = false;
|
||||
|
||||
doCheck = true;
|
||||
|
||||
@@ -29,7 +29,10 @@ stdenv.mkDerivation rec {
|
||||
clang
|
||||
];
|
||||
|
||||
patchPhase = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
|
||||
# https://github.com/ispc/ispc/pull/1190
|
||||
patches = [ ./gcc5.patch ];
|
||||
|
||||
postPatch = "sed -i -e 's/\\/bin\\///g' -e 's/-lcurses/-lncurses/g' Makefile";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
22
pkgs/development/compilers/ispc/gcc5.patch
Normal file
22
pkgs/development/compilers/ispc/gcc5.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git a/cbackend.cpp b/cbackend.cpp
|
||||
index 3552205..9c05824 100644
|
||||
--- a/cbackend.cpp
|
||||
+++ b/cbackend.cpp
|
||||
@@ -1641,7 +1641,7 @@ void CWriter::printConstant(llvm::Constant *CPV, bool Static) {
|
||||
V = Tmp.convertToDouble();
|
||||
}
|
||||
|
||||
- if (isnan(V)) {
|
||||
+ if (std::isnan(V)) {
|
||||
// The value is NaN
|
||||
|
||||
// FIXME the actual NaN bits should be emitted.
|
||||
@@ -1665,7 +1665,7 @@ void CWriter::printConstant(llvm::Constant *CPV, bool Static) {
|
||||
else
|
||||
Out << "LLVM_NAN" << (Val == QuietNaN ? "" : "S") << "(\""
|
||||
<< Buffer << "\") /*nan*/ ";
|
||||
- } else if (isinf(V)) {
|
||||
+ } else if (std::isinf(V)) {
|
||||
// The value is Inf
|
||||
if (V < 0) Out << '-';
|
||||
Out << "LLVM_INF" <<
|
||||
@@ -1,6 +1,6 @@
|
||||
{ stdenv, lib, fetchFromGitHub, emscripten }:
|
||||
|
||||
let version = "0.8.6"; in
|
||||
let version = "0.8.7"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "jsonnet-${version}";
|
||||
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
|
||||
rev = "v${version}";
|
||||
owner = "google";
|
||||
repo = "jsonnet";
|
||||
sha256 = "1dkvm81gi1j02zs00mqshn9i71bcnqbxsm5hh3wwa2y0sffvgkwh";
|
||||
sha256 = "0adg7ijz10mc4xs5lfrby5g9sx96icf6cg39hvkh4wqjl85c6i9g";
|
||||
};
|
||||
|
||||
buildInputs = [ emscripten ];
|
||||
|
||||
@@ -86,7 +86,7 @@ stdenv.mkDerivation rec {
|
||||
makeFlags =
|
||||
let
|
||||
arch = head (splitString "-" stdenv.system);
|
||||
march = { "x86_64" = "x86-64"; "i686" = "i686"; }."${arch}"
|
||||
march = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}"
|
||||
or (throw "unsupported architecture: ${arch}");
|
||||
# Julia requires Pentium 4 (SSE2) or better
|
||||
cpuTarget = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}"
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip, which }:
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.0.0";
|
||||
version = "1.0.1";
|
||||
name = "kotlin-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/build-${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "0dp5mab35sv3nsgj488ibyn6x6xw2rka76s7kygbhqhjc429kpgy";
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "1hwdisjgy4q5y25gqnxk8ycd04j7hxb7xd0y6ixi12qfj7259a41";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
buildInputs = [ makeWrapper unzip which ] ;
|
||||
buildInputs = [ makeWrapper unzip ] ;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
||||
@@ -50,5 +50,6 @@ in stdenv.mkDerivation {
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
||||
55
pkgs/development/compilers/llvm/3.8/clang/default.nix
Normal file
55
pkgs/development/compilers/llvm/3.8/clang/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src, python }:
|
||||
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
in stdenv.mkDerivation {
|
||||
name = "clang-${version}";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile ${fetch "cfe" "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"}
|
||||
mv cfe-${version}.src clang
|
||||
sourceRoot=$PWD/clang
|
||||
unpackFile ${clang-tools-extra_src}
|
||||
mv clang-tools-extra-* $sourceRoot/tools/extra
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake libedit libxml2 llvm python ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
] ++
|
||||
# Maybe with compiler-rt this won't be needed?
|
||||
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
|
||||
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
|
||||
|
||||
patches = [ ./purity.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
|
||||
'';
|
||||
|
||||
# Clang expects to find LLVMgold in its own prefix
|
||||
# Clang expects to find sanitizer libraries in its own prefix
|
||||
postInstall = ''
|
||||
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
|
||||
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
|
||||
ln -sv $out/bin/clang $out/bin/cpp
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
} // stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
inherit gcc;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
17
pkgs/development/compilers/llvm/3.8/clang/purity.patch
Normal file
17
pkgs/development/compilers/llvm/3.8/clang/purity.patch
Normal file
@@ -0,0 +1,17 @@
|
||||
--- a/lib/Driver/Tools.cpp 2016-02-12 15:51:41.000000000 -0700
|
||||
+++ b/lib/Driver/Tools.cpp 2016-03-08 15:39:06.790111122 -0700
|
||||
@@ -8833,15 +8833,6 @@
|
||||
CmdArgs.push_back("-shared");
|
||||
}
|
||||
|
||||
- if (Arch == llvm::Triple::arm || Arch == llvm::Triple::armeb ||
|
||||
- Arch == llvm::Triple::thumb || Arch == llvm::Triple::thumbeb ||
|
||||
- (!Args.hasArg(options::OPT_static) &&
|
||||
- !Args.hasArg(options::OPT_shared))) {
|
||||
- CmdArgs.push_back("-dynamic-linker");
|
||||
- CmdArgs.push_back(Args.MakeArgString(
|
||||
- D.DyldPrefix + getLinuxDynamicLinker(Args, ToolChain)));
|
||||
- }
|
||||
-
|
||||
CmdArgs.push_back("-o");
|
||||
CmdArgs.push_back(Output.getFilename());
|
||||
35
pkgs/development/compilers/llvm/3.8/default.nix
Normal file
35
pkgs/development/compilers/llvm/3.8/default.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC }:
|
||||
let
|
||||
callPackage = newScope (self // { inherit stdenv isl version fetch; });
|
||||
|
||||
version = "3.8.0";
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "http://llvm.org/releases/${ver}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
compiler-rt_src = fetch "compiler-rt" "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8";
|
||||
clang-tools-extra_src = fetch "clang-tools-extra" "1i0yrgj8qrzjjswraz0i55lg92ljpqhvjr619d268vka208aigdg";
|
||||
|
||||
self = {
|
||||
llvm = callPackage ./llvm.nix {
|
||||
inherit compiler-rt_src stdenv;
|
||||
};
|
||||
|
||||
clang-unwrapped = callPackage ./clang {
|
||||
inherit clang-tools-extra_src stdenv;
|
||||
};
|
||||
|
||||
clang = wrapCC self.clang-unwrapped;
|
||||
|
||||
stdenv = overrideCC stdenv self.clang;
|
||||
|
||||
lldb = callPackage ./lldb.nix {};
|
||||
|
||||
libcxx = callPackage ./libc++ {};
|
||||
|
||||
libcxxabi = callPackage ./libc++abi.nix {};
|
||||
};
|
||||
in self
|
||||
30
pkgs/development/compilers/llvm/3.8/libc++/darwin.patch
Normal file
30
pkgs/development/compilers/llvm/3.8/libc++/darwin.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
|
||||
--- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100
|
||||
+++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200
|
||||
@@ -56,7 +56,7 @@
|
||||
"-compatibility_version 1"
|
||||
"-current_version ${LIBCXX_VERSION}"
|
||||
"-install_name /usr/lib/libc++.1.dylib"
|
||||
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
|
||||
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
||||
"/usr/lib/libSystem.B.dylib")
|
||||
else()
|
||||
@@ -64,14 +64,14 @@
|
||||
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
|
||||
if (OSX_HAS_ARMV7)
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
|
||||
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
|
||||
else()
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
|
||||
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
|
||||
endif()
|
||||
else()
|
||||
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
+ set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
endif()
|
||||
|
||||
list(APPEND link_flags
|
||||
40
pkgs/development/compilers/llvm/3.8/libc++/default.nix
Normal file
40
pkgs/development/compilers/llvm/3.8/libc++/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ lib, stdenv, fetch, cmake, libcxxabi, fixDarwinDylibNames, version }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libc++-${version}";
|
||||
|
||||
src = fetch "libcxx" "0i7iyzk024krda5spfpfi8jksh83yp3bxqkal0xp76ffi11bszrm";
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxxabi.src}
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
|
||||
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
|
||||
'';
|
||||
|
||||
patches = [ ./darwin.patch ];
|
||||
|
||||
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags =
|
||||
[ "-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
linkCxxAbi = stdenv.isLinux;
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
license = "BSD";
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
3
pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh
Normal file
3
pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
linkCxxAbi="@linkCxxAbi@"
|
||||
export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
|
||||
export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
|
||||
47
pkgs/development/compilers/llvm/3.8/libc++abi.nix
Normal file
47
pkgs/development/compilers/llvm/3.8/libc++abi.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "libc++abi-${version}";
|
||||
|
||||
src = fetch "libcxxabi" "0ambfcmr2nh88hx000xb7yjm9lsqjjz49w5mlf6dlxzmj3nslzx4";
|
||||
|
||||
buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
export NIX_CFLAGS_COMPILE+=" -I$PWD/include"
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'';
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*.dylib; do
|
||||
# this should be done in CMake, but having trouble figuring out
|
||||
# the magic combination of necessary CMake variables
|
||||
# if you fancy a try, take a look at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
install_name_tool -id $out/$file $file
|
||||
done
|
||||
make install
|
||||
install -d 755 $out/include
|
||||
install -m 644 ../include/*.h $out/include
|
||||
''
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxxabi.llvm.org/;
|
||||
description = "A new implementation of low level support for a standard C++ library";
|
||||
license = "BSD";
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
49
pkgs/development/compilers/llvm/3.8/lldb.nix
Normal file
49
pkgs/development/compilers/llvm/3.8/lldb.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, zlib
|
||||
, ncurses
|
||||
, swig
|
||||
, which
|
||||
, libedit
|
||||
, llvm
|
||||
, clang-unwrapped
|
||||
, python
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "lldb-${version}";
|
||||
|
||||
src = fetch "lldb" "008fdbyza13ym3v0xpans4z4azw4y16hcbgrrnc4rx2mxwaw62ws";
|
||||
|
||||
patchPhase = ''
|
||||
sed -i 's|/usr/bin/env||' \
|
||||
scripts/Python/finish-swig-Python-LLDB.sh \
|
||||
scripts/Python/build-swig-Python.sh
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake python which swig ncurses zlib libedit ];
|
||||
|
||||
preConfigure = ''
|
||||
export CXXFLAGS="-pthread"
|
||||
export LDFLAGS="-ldl"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DLLDB_PATH_TO_LLVM_BUILD=${llvm}"
|
||||
"-DLLDB_PATH_TO_CLANG_BUILD=${clang-unwrapped}"
|
||||
"-DPYTHON_VERSION_MAJOR=2"
|
||||
"-DPYTHON_VERSION_MINOR=7"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "A next-generation high-performance debugger";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
80
pkgs/development/compilers/llvm/3.8/llvm.nix
Normal file
80
pkgs/development/compilers/llvm/3.8/llvm.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, perl
|
||||
, groff
|
||||
, cmake
|
||||
, python
|
||||
, libffi
|
||||
, binutils
|
||||
, libxml2
|
||||
, valgrind
|
||||
, ncurses
|
||||
, version
|
||||
, zlib
|
||||
, compiler-rt_src
|
||||
, libcxxabi
|
||||
, debugVersion ? false
|
||||
, enableSharedLibraries ? !stdenv.isDarwin
|
||||
}:
|
||||
|
||||
let
|
||||
src = fetch "llvm" "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm";
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "llvm-${version}";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile ${src}
|
||||
mv llvm-${version}.src llvm
|
||||
sourceRoot=$PWD/llvm
|
||||
unpackFile ${compiler-rt_src}
|
||||
mv compiler-rt-* $sourceRoot/projects/compiler-rt
|
||||
'';
|
||||
|
||||
buildInputs = [ perl groff cmake libxml2 python libffi ]
|
||||
++ stdenv.lib.optional stdenv.isDarwin libcxxabi;
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
|
||||
# hacky fix: created binaries need to be run before installation
|
||||
preBuild = ''
|
||||
mkdir -p $out/
|
||||
ln -sv $PWD/lib $out
|
||||
'';
|
||||
|
||||
cmakeFlags = with stdenv; [
|
||||
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
|
||||
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
|
||||
"-DLLVM_BUILD_TESTS=ON"
|
||||
"-DLLVM_ENABLE_FFI=ON"
|
||||
"-DLLVM_ENABLE_RTTI=ON"
|
||||
] ++ stdenv.lib.optional enableSharedLibraries [
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||
] ++ stdenv.lib.optional (!isDarwin)
|
||||
"-DLLVM_BINUTILS_INCDIR=${binutils}/include"
|
||||
++ stdenv.lib.optionals ( isDarwin) [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
rm -fR $out
|
||||
|
||||
paxmark m bin/{lli,llvm-rtdyld}
|
||||
|
||||
paxmark m unittests/ExecutionEngine/JIT/JITTests
|
||||
paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests
|
||||
paxmark m unittests/Support/SupportTests
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.src = src;
|
||||
|
||||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
{ stdenv, callPackage }:
|
||||
|
||||
callPackage ./generic.nix {
|
||||
shortVersion = "2016-02-22";
|
||||
shortVersion = "2016-03-22";
|
||||
isRelease = false;
|
||||
forceBundledLLVM = true;
|
||||
srcRev = "d1f422ec280b881b8236c5d173103bc799e1590e";
|
||||
srcSha = "b0753045ae438c0869d37f429fe84451dcacc4b2ab9413d34bf29fde94fde462";
|
||||
srcRev = "6cc502c986d42da407e26a49d4f09f21d3072fcb";
|
||||
srcSha = "096lsc8irh9a7w494yaji28kzy9frs2myqrfyj0fzbxkvs3yfhzz";
|
||||
|
||||
/* Rust is bootstrapped from an earlier built version. We need
|
||||
to fetch these earlier versions, which vary per platform.
|
||||
@@ -15,14 +15,13 @@ callPackage ./generic.nix {
|
||||
with the set you want at the top.
|
||||
*/
|
||||
|
||||
snapshotHashLinux686 = "a09c4a4036151d0cb28e265101669731600e01f2";
|
||||
snapshotHashLinux64 = "97e2a5eb8904962df8596e95d6e5d9b574d73bf4";
|
||||
snapshotHashDarwin686 = "ca52d2d3ba6497ed007705ee3401cf7efc136ca1";
|
||||
snapshotHashDarwin64 = "3c44ffa18f89567c2b81f8d695e711c86d81ffc7";
|
||||
snapshotDate = "2015-12-18";
|
||||
snapshotRev = "3391630";
|
||||
snapshotHashLinux686 = "0e0e4448b80d0a12b75485795244bb3857a0a7ef";
|
||||
snapshotHashLinux64 = "1273b6b6aed421c9e40c59f366d0df6092ec0397";
|
||||
snapshotHashDarwin686 = "9f9c0b4a2db09acbce54b792fb8839a735585565";
|
||||
snapshotHashDarwin64 = "52570f6fd915b0210a9be98cfc933148e16a75f8";
|
||||
snapshotDate = "2016-03-18";
|
||||
snapshotRev = "235d774";
|
||||
|
||||
patches = [ ./patches/remove-uneeded-git.patch ]
|
||||
++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ stdenv, fetchurl, sbclBootstrap, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit" }:
|
||||
{ stdenv, fetchurl, writeText, sbclBootstrap
|
||||
, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
|
||||
# Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
|
||||
# Note that the created binaries still need `patchelf --set-interpreter ...`
|
||||
# to get rid of ${glibc} dependency.
|
||||
, purgeNixReferences ? false
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "sbcl-${version}";
|
||||
@@ -37,9 +43,6 @@ stdenv.mkDerivation rec {
|
||||
sed -i src/code/target-load.lisp -e \
|
||||
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
|
||||
|
||||
# Fix software version retrieval
|
||||
sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp
|
||||
|
||||
# Fix the tests
|
||||
sed -e '/deftest pwent/inil' -i contrib/sb-posix/posix-tests.lisp
|
||||
sed -e '/deftest grent/inil' -i contrib/sb-posix/posix-tests.lisp
|
||||
@@ -54,7 +57,21 @@ stdenv.mkDerivation rec {
|
||||
|
||||
substituteInPlace src/runtime/Config.x86-64-darwin \
|
||||
--replace mmacosx-version-min=10.4 mmacosx-version-min=10.5
|
||||
'';
|
||||
''
|
||||
+ (if purgeNixReferences
|
||||
then
|
||||
# This is the default location to look for the core; by default in $out/lib/sbcl
|
||||
''
|
||||
sed 's@^\(#define SBCL_HOME\) .*$@\1 "/no-such-path"@' \
|
||||
-i src/runtime/runtime.c
|
||||
''
|
||||
else
|
||||
# Fix software version retrieval
|
||||
''
|
||||
sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp
|
||||
''
|
||||
);
|
||||
|
||||
|
||||
preBuild = ''
|
||||
export INSTALL_ROOT=$out
|
||||
@@ -70,6 +87,14 @@ stdenv.mkDerivation rec {
|
||||
INSTALL_ROOT=$out sh install.sh
|
||||
'';
|
||||
|
||||
# Specifying $SBCL_HOME is only truly needed with `purgeNixReferences = true`.
|
||||
setupHook = writeText "setupHook.sh" ''
|
||||
envHooks+=(_setSbclHome)
|
||||
_setSbclHome() {
|
||||
export SBCL_HOME='@out@/lib/sbcl/'
|
||||
}
|
||||
'';
|
||||
|
||||
meta = sbclBootstrap.meta // {
|
||||
inherit version;
|
||||
updateWalker = true;
|
||||
|
||||
Reference in New Issue
Block a user