Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

102 lines
1.8 KiB
Nix
Raw Normal View History

2025-05-29 19:58:36 -07:00
{
lib,
stdenv,
gcc_meta,
release_version,
version,
getVersionFile,
2025-05-29 19:58:36 -07:00
monorepoSrc ? null,
fetchpatch,
autoreconfHook269,
2025-05-29 19:58:36 -07:00
runCommand,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libssp";
inherit version;
src = runCommand "libssp-src-${version}" { src = monorepoSrc; } ''
runPhase unpackPhase
mkdir -p "$out/gcc"
cp gcc/BASE-VER "$out/gcc"
cp gcc/DATESTAMP "$out/gcc"
cp -r libssp "$out"
cp -r config "$out"
cp -r multilib.am "$out"
2025-05-29 19:58:36 -07:00
cp config.guess "$out"
cp config.rpath "$out"
cp config.sub "$out"
cp config-ml.in "$out"
cp ltmain.sh "$out"
cp install-sh "$out"
cp mkinstalldirs "$out"
[[ -f MD5SUMS ]]; cp MD5SUMS "$out"
'';
outputs = [
"out"
"dev"
];
patches = [
(fetchpatch {
name = "regular-libdir-includedir.patch";
url = "https://inbox.sourceware.org/gcc-patches/20250720172933.2404828-1-git@JohnEricson.me/raw";
hash = "sha256-W7dcy1Tm3O2reK7kx83DRv8W97qUfaqDbKLiLXIegRw=";
})
(getVersionFile "libssp/force-regular-dirs.patch")
];
postUnpack = ''
mkdir -p ./build
buildRoot=$(readlink -e "./build")
'';
preAutoreconf = ''
sourceRoot=$(readlink -e "./libssp")
cd $sourceRoot
'';
enableParallelBuilding = true;
nativeBuildInputs = [
autoreconfHook269
];
2025-05-29 19:58:36 -07:00
configurePlatforms = [
"build"
"host"
];
2025-05-29 19:58:36 -07:00
configureFlags = [
"--disable-dependency-tracking"
"cross_compiling=true"
"--disable-multilib"
];
preConfigure = ''
cd "$buildRoot"
configureScript=$sourceRoot/configure
2025-05-29 19:58:36 -07:00
'';
hardeningDisable = [
"fortify"
# Because we are building it!
"stackprotector"
];
doCheck = true;
passthru = {
isGNU = true;
};
meta = gcc_meta // {
homepage = "https://gcc.gnu.org/";
};
})