minimal-bootstrap.gcc*: Add GCC wrapper test

This commit is contained in:
Aleksi Hannula
2026-08-07 19:22:46 +03:00
parent 65056060c2
commit 5820092cde
2 changed files with 26 additions and 2 deletions

View File

@@ -462,7 +462,7 @@ lib.makeScope
echo ${gcc46.tests.get-version}
echo ${gcc46-cxx.tests.hello-world}
echo ${gcc10.tests.hello-world}
echo ${gcc-latest-unwrapped.tests.hello-world}
echo ${gcc-latest.tests.hello-world}
''
+ (lib.strings.optionalString (hostPlatform.libc == "glibc") ''
echo ${gcc-glibc.tests.hello-world}

View File

@@ -5,6 +5,7 @@
xz,
bash-build,
gnused,
buildPlatform,
targetPlatform,
libc,
libgcc,
@@ -25,7 +26,30 @@ bash-build.runCommand "${pname}-${gcc-unwrapped.version}"
version = gcc-unwrapped.version;
meta = gcc-unwrapped.meta;
nativeBuildInputs = [ gnused ];
passthru.unwrapped = gcc-unwrapped;
passthru = {
unwrapped = gcc-unwrapped;
tests.hello-world =
result:
bash-build.runCommand "${pname}-simple-program-${gcc-unwrapped.version}"
{
nativeBuildInputs = [
binutils
result
];
}
''
cat <<EOF >> test.c
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}
EOF
${targetPlatform.config}-gcc -o test test.c
${lib.optionalString (buildPlatform.canExecute targetPlatform) "./test"}
mkdir $out
'';
};
}
''
if [[ -z '${dynamicLinkerGlob}' ]]; then