mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 19:30:11 +00:00
minimal-bootstrap.libbacktrace: init at 16.2.0
This commit is contained in:
@@ -286,6 +286,12 @@ lib.makeScope
|
||||
|
||||
heirloom-devtools = callPackage ./heirloom-devtools { tinycc = tinycc-mes; };
|
||||
|
||||
libbacktrace = callPackage ./gcc/libbacktrace.nix {
|
||||
gcc = gcc10;
|
||||
gnumake = gnumake-musl;
|
||||
gnutar = gnutar-latest;
|
||||
};
|
||||
|
||||
libgmp = callPackage ./gcc/gmp.nix {
|
||||
gcc-buildbuild = gcc10;
|
||||
gcc = gcc10;
|
||||
|
||||
54
pkgs/os-specific/linux/minimal-bootstrap/gcc/common.nix
Normal file
54
pkgs/os-specific/linux/minimal-bootstrap/gcc/common.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
lib,
|
||||
bash,
|
||||
fetchurl,
|
||||
gnupatch,
|
||||
gnutar,
|
||||
xz,
|
||||
}:
|
||||
let
|
||||
version = "16.2.0";
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
|
||||
hash = "sha256-5nOOKVl/czJwcxqpBgDzf/3ARQed/CfsfoGSzIEIXD4=";
|
||||
};
|
||||
patches = [
|
||||
(fetchurl {
|
||||
name = "regular-libdir-includedir.patch";
|
||||
url = "https://inbox.sourceware.org/gcc-patches/20250717174911.1536129-1-git@JohnEricson.me/raw";
|
||||
hash = "sha256-Cn7rvg1FI7H/26GzSe4pv5VW/gvwbwGqivAqEeawkwk=";
|
||||
})
|
||||
./configure-skip-target-libs-hooks.patch
|
||||
];
|
||||
in
|
||||
{
|
||||
inherit src version;
|
||||
monorepoSrc =
|
||||
bash.runCommand "gcc-${version}-src"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
gnutar
|
||||
gnupatch
|
||||
xz
|
||||
];
|
||||
}
|
||||
''
|
||||
# Unpack
|
||||
mkdir $out/
|
||||
tar xf ${src} --directory=$out/ --strip-components=1
|
||||
|
||||
# Patch
|
||||
cd $out/
|
||||
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
|
||||
|
||||
# Ensure gengtype-lex is not rebuilt from .y; we have no yacc at this stage.
|
||||
touch gcc/gengtype-lex.cc
|
||||
'';
|
||||
meta = {
|
||||
description = "GNU Compiler Collection, version ${version}";
|
||||
homepage = "https://gcc.gnu.org";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
teams = [ lib.teams.minimal-bootstrap ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
diff --git a/configure b/configure
|
||||
index 911351626..7ae019dc7 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -2775,8 +2775,12 @@ fi
|
||||
|
||||
# Skipdirs are removed silently.
|
||||
skipdirs=
|
||||
-# Noconfigdirs are removed loudly.
|
||||
-noconfigdirs=""
|
||||
+# Add a hook to permit gcc-ng to avoid invoking configure on target libraries prematurely.
|
||||
+if [ "$gccng_skip_target_lib_config" = "y" ]; then
|
||||
+ noconfigdirs="$noconfigdirs $target_libraries"
|
||||
+else
|
||||
+ noconfigdirs=""
|
||||
+fi
|
||||
|
||||
use_gnu_ld=
|
||||
# Make sure we don't let GNU ld be added if we didn't want it.
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
lib,
|
||||
buildPlatform,
|
||||
hostPlatform,
|
||||
fetchurl,
|
||||
bash,
|
||||
coreutils,
|
||||
gcc,
|
||||
binutils,
|
||||
gnumake,
|
||||
gnupatch,
|
||||
gnused,
|
||||
gnugrep,
|
||||
gawk,
|
||||
diffutils,
|
||||
findutils,
|
||||
gnutar,
|
||||
gzip,
|
||||
bzip2,
|
||||
xz,
|
||||
}:
|
||||
let
|
||||
common = import ./common.nix {
|
||||
inherit
|
||||
lib
|
||||
bash
|
||||
fetchurl
|
||||
gnupatch
|
||||
gnutar
|
||||
xz
|
||||
;
|
||||
};
|
||||
pname = "libbacktrace";
|
||||
in
|
||||
bash.runCommand "${pname}-${common.version}"
|
||||
{
|
||||
inherit (common) meta version;
|
||||
inherit pname;
|
||||
|
||||
nativeBuildInputs = [
|
||||
gcc
|
||||
binutils
|
||||
gnumake
|
||||
gnupatch
|
||||
gnused
|
||||
gnugrep
|
||||
gawk
|
||||
diffutils
|
||||
findutils
|
||||
];
|
||||
}
|
||||
''
|
||||
# Unpack
|
||||
pushd ${common.monorepoSrc}
|
||||
|
||||
mkdir -p "$out/gcc"
|
||||
cp gcc/BASE-VER gcc/DATESTAMP "$out/gcc"
|
||||
cp -r include libbacktrace "$out"
|
||||
cp config.guess config.rpath config.sub config-ml.in \
|
||||
ltmain.sh install-sh move-if-change mkinstalldirs \
|
||||
test-driver "$out"
|
||||
[[ -f MD5SUMS ]]; cp MD5SUMS "$out"
|
||||
|
||||
popd
|
||||
|
||||
${common.monorepoSrc}/libbacktrace/configure --prefix="$out" \
|
||||
--build=${buildPlatform.config} \
|
||||
--host=${hostPlatform.config}
|
||||
|
||||
# Build
|
||||
make -j $NIX_BUILD_CORES
|
||||
|
||||
# Install
|
||||
mkdir -p "$out/lib/"
|
||||
mkdir -p "$out/include/"
|
||||
cp .libs/*.a "$out/lib/"
|
||||
cp libbacktrace*.la "$out/lib"
|
||||
|
||||
chmod +w "$out/include"
|
||||
cp backtrace-supported.h "$out/include/"
|
||||
''
|
||||
Reference in New Issue
Block a user