2025-05-29 19:58:36 -07:00
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
stdenv,
|
|
|
|
|
gcc_meta,
|
|
|
|
|
release_version,
|
|
|
|
|
version,
|
2025-07-20 14:58:49 -04:00
|
|
|
getVersionFile,
|
2025-05-29 19:58:36 -07:00
|
|
|
monorepoSrc ? null,
|
2025-07-20 14:58:49 -04:00
|
|
|
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"
|
|
|
|
|
|
2025-07-20 14:58:49 -04:00
|
|
|
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"
|
|
|
|
|
'';
|
|
|
|
|
|
2025-07-20 14:58:49 -04:00
|
|
|
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-07-20 14:58:49 -04:00
|
|
|
|
2025-05-29 19:58:36 -07:00
|
|
|
configureFlags = [
|
|
|
|
|
"--disable-dependency-tracking"
|
|
|
|
|
"cross_compiling=true"
|
|
|
|
|
"--disable-multilib"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
preConfigure = ''
|
2025-07-20 14:58:49 -04:00
|
|
|
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/";
|
|
|
|
|
};
|
|
|
|
|
})
|