minimal-bootstrap.gcc46: build with tinycc-musl
This commit is contained in:
parent
a680950c88
commit
29b98b0f89
|
@ -73,8 +73,12 @@ lib.makeScope
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc46 = callPackage ./gcc/4.6.nix {
|
gcc46 = callPackage ./gcc/4.6.nix {
|
||||||
gcc = gcc2;
|
coreutils = coreutils-musl;
|
||||||
glibc = glibc22;
|
tinycc = tinycc-musl;
|
||||||
|
gnumake = gnumake-musl;
|
||||||
|
gnutar = gnutar-musl;
|
||||||
|
# FIXME: not sure why new gawk doesn't work
|
||||||
|
gawk = gawk-mes;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (callPackage ./glibc {
|
inherit (callPackage ./glibc {
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
, hostPlatform
|
, hostPlatform
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, bash
|
, bash
|
||||||
, gcc
|
, coreutils
|
||||||
, glibc
|
, tinycc
|
||||||
, linux-headers
|
|
||||||
, binutils
|
, binutils
|
||||||
, gnumake
|
, gnumake
|
||||||
, gnupatch
|
, gnupatch
|
||||||
|
@ -32,23 +31,10 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# This patch enables building gcc-4.6.4 using gcc-2.95.3 and glibc-2.2.5
|
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
|
||||||
# * Tweak Makefile to allow overriding NATIVE_SYSTEM_HEADER_DIR using #:makeflags
|
./no-system-headers.patch
|
||||||
# * Add missing limits.h include.
|
|
||||||
# * Add SSIZE_MAX define. The SSIZE_MAX define has been added to Mes
|
|
||||||
# upstream and can be removed with the next Mes release.
|
|
||||||
# * Remove -fbuilding-libgcc flag, it assumes features being present from a
|
|
||||||
# newer gcc or glibc.
|
|
||||||
# * [MES_BOOTSTRAP_GCC]: Disable threads harder.
|
|
||||||
(fetchurl {
|
|
||||||
url = "https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/patches/gcc-boot-4.6.4.patch?id=50249cab3a98839ade2433456fe618acc6f804a5";
|
|
||||||
sha256 = "1zzd8gnihw6znrgb6c6pfsmm0vix89xw3giv1nnsykm57j0v3z0d";
|
|
||||||
})
|
|
||||||
./libstdc++-target.patch
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# To reduce the set of pre-built bootstrap inputs, build
|
|
||||||
# GMP & co. from GCC.
|
|
||||||
gmpVersion = "4.3.2";
|
gmpVersion = "4.3.2";
|
||||||
gmp = fetchurl {
|
gmp = fetchurl {
|
||||||
url = "mirror://gnu/gmp/gmp-${gmpVersion}.tar.gz";
|
url = "mirror://gnu/gmp/gmp-${gmpVersion}.tar.gz";
|
||||||
|
@ -71,7 +57,8 @@ bash.runCommand "${pname}-${version}" {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
gcc
|
coreutils
|
||||||
|
tinycc.compiler
|
||||||
binutils
|
binutils
|
||||||
gnumake
|
gnumake
|
||||||
gnupatch
|
gnupatch
|
||||||
|
@ -84,10 +71,6 @@ bash.runCommand "${pname}-${version}" {
|
||||||
gzip
|
gzip
|
||||||
];
|
];
|
||||||
|
|
||||||
# condition in ./libcpp/configure requires `env` which is not available in this coreutils
|
|
||||||
am_cv_CXX_dependencies_compiler_type = "gcc";
|
|
||||||
am_cv_CC_dependencies_compiler_type = "gcc";
|
|
||||||
|
|
||||||
passthru.tests.get-version = result:
|
passthru.tests.get-version = result:
|
||||||
bash.runCommand "${pname}-get-version-${version}" {} ''
|
bash.runCommand "${pname}-get-version-${version}" {} ''
|
||||||
${result}/bin/gcc --version
|
${result}/bin/gcc --version
|
||||||
|
@ -118,18 +101,21 @@ bash.runCommand "${pname}-${version}" {
|
||||||
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
|
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
|
||||||
|
|
||||||
# Configure
|
# Configure
|
||||||
export C_INCLUDE_PATH="${gcc}/lib/gcc-lib/${hostPlatform.config}/${gcc.version}/include:${linux-headers}/include:${glibc}/include:$(pwd)/mpfr/src"
|
export CC="tcc -B ${tinycc.libs}/lib"
|
||||||
|
export C_INCLUDE_PATH="${tinycc.libs}/include:$(pwd)/mpfr/src"
|
||||||
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
|
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
|
||||||
export LDFLAGS="-B${glibc}/lib -Wl,-dynamic-linker -Wl,${glibc}"
|
|
||||||
export LDFLAGS_FOR_TARGET=$LDFLAGS
|
# Avoid "Link tests are not allowed after GCC_NO_EXECUTABLES"
|
||||||
export LIBRARY_PATH="${glibc}/lib:${gcc}/lib"
|
export lt_cv_shlibpath_overrides_runpath=yes
|
||||||
export LIBS="-lc -lnss_files -lnss_dns -lresolv"
|
export ac_cv_func_memcpy=yes
|
||||||
|
export ac_cv_func_strerror=yes
|
||||||
|
|
||||||
bash ./configure \
|
bash ./configure \
|
||||||
--prefix=$out \
|
--prefix=$out \
|
||||||
--build=${buildPlatform.config} \
|
--build=${buildPlatform.config} \
|
||||||
--host=${hostPlatform.config} \
|
--host=${hostPlatform.config} \
|
||||||
--with-native-system-header-dir=${glibc}/include \
|
--with-native-system-header-dir=${tinycc.libs}/include \
|
||||||
--with-build-sysroot=${glibc}/include \
|
--with-build-sysroot=${tinycc.libs}/include \
|
||||||
--disable-bootstrap \
|
--disable-bootstrap \
|
||||||
--disable-decimal-float \
|
--disable-decimal-float \
|
||||||
--disable-libatomic \
|
--disable-libatomic \
|
||||||
|
@ -146,7 +132,7 @@ bash.runCommand "${pname}-${version}" {
|
||||||
--disable-multilib \
|
--disable-multilib \
|
||||||
--disable-plugin \
|
--disable-plugin \
|
||||||
--disable-threads \
|
--disable-threads \
|
||||||
--enable-languages=c,c++ \
|
--enable-languages=c \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--enable-threads=single \
|
--enable-threads=single \
|
||||||
|
@ -154,8 +140,8 @@ bash.runCommand "${pname}-${version}" {
|
||||||
--disable-build-with-cxx
|
--disable-build-with-cxx
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
make
|
make -j $NIX_BUILD_CORES
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
make install
|
make -j $NIX_BUILD_CORES install
|
||||||
''
|
''
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- a/gcc/Makefile.in
|
||||||
|
+++ b/gcc/Makefile.in
|
||||||
|
@@ -440,7 +440,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
|
||||||
|
LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
|
||||||
|
|
||||||
|
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||||
|
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
|
||||||
|
+# NATIVE_SYSTEM_HEADER_DIR = /usr/include
|
||||||
|
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
|
||||||
|
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
|
||||||
|
|
Loading…
Reference in a new issue