@@ -157,8 +157,8 @@ pub fn build(b: *std.Build) void {
157157 .optimize = optimize ,
158158 });
159159 b .step ("libc-full-shared" , "" ).dependOn (& installArtifact (b , libc_full_shared ).step );
160- // TODO: create a specs file?
161- // you can add -specs=file to the gcc command line to override values in the spec
160+ // GCC specs generation is not wired into the build yet.
161+ // You can still pass ` -specs=file` manually to override GCC defaults.
162162
163163 const libc_only_std_static = libcbuild .addLibc (b , .{
164164 .variant = .only_std ,
@@ -236,6 +236,14 @@ pub fn build(b: *std.Build) void {
236236 run_step .addCheck (.{ .expect_stdout_exact = "Success!\n " });
237237 test_step .dependOn (& run_step .step );
238238 }
239+ const header_conformance_run = blk : {
240+ const exe = addTest ("header_conformance" , b , target , optimize , libc_only_std_static , zig_start );
241+ addPosix (exe , libc_only_posix );
242+ const run_step = addRunArtifactCompat (b , exe );
243+ run_step .addCheck (.{ .expect_stdout_exact = "Success!\n " });
244+ test_step .dependOn (& run_step .step );
245+ break :blk run_step ;
246+ };
239247 {
240248 const exe = addTest ("signal_extensive" , b , target , optimize , libc_only_std_static , zig_start );
241249 addPosix (exe , libc_only_posix );
@@ -346,15 +354,16 @@ pub fn build(b: *std.Build) void {
346354 }
347355 }
348356
349- {
357+ const parity_run = blk : {
350358 const system_exe = addSystemParityProbe (b , target , optimize );
351359 const zig_exe = addZigParityProbe (b , target , optimize , libc_only_std_static , zig_start , libc_only_posix );
352360 const run_step = addRunArtifactCompat (b , parity_env_exe );
353361 addArtifactArgCompat (run_step , b , system_exe );
354362 addArtifactArgCompat (run_step , b , zig_exe );
355363 run_step .addCheck (.{ .expect_stdout_exact = "Success!\n " });
356364 test_step .dependOn (& run_step .step );
357- }
365+ break :blk run_step ;
366+ };
358367
359368 if (supportsSetjmp (target .result )) {
360369 const exe = addTest ("jmp" , b , target , optimize , libc_only_std_static , zig_start );
@@ -406,6 +415,8 @@ pub fn build(b: *std.Build) void {
406415 conformance_step .dependOn (posix_test_suite_step );
407416 conformance_step .dependOn (austin_group_tests_step );
408417 }
418+ conformance_step .dependOn (& header_conformance_run .step );
419+ conformance_step .dependOn (& parity_run .step );
409420 _ = addLua (b , target , optimize , libc_only_std_static , libc_only_posix , zig_start );
410421 _ = addCmph (b , target , optimize , libc_only_std_static , zig_start , libc_only_posix );
411422 _ = addYacc (b , target , optimize , libc_only_std_static , zig_start , libc_only_posix );
@@ -474,7 +485,7 @@ fn addTest(
474485 exe .addIncludePath (lazyPath (b , "inc" ++ std .fs .path .sep_str ++ "posix" ));
475486 exe .linkLibrary (libc_only_std_static );
476487 exe .linkLibrary (zig_start );
477- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
488+ // These static artifacts do not currently propagate system- library dependencies.
478489 if (target .result .os .tag == .windows ) {
479490 exe .linkSystemLibrary ("ntdll" );
480491 exe .linkSystemLibrary ("kernel32" );
@@ -486,13 +497,19 @@ const ParityFeatures = struct {
486497 sigaction : bool ,
487498 setitimer : bool ,
488499 select : bool ,
500+ strsignal : bool ,
501+ pselect : bool ,
502+ utimes : bool ,
489503};
490504
491505fn parityFeaturesFor (target : std.Target ) ParityFeatures {
492506 return .{
493507 .sigaction = target .os .tag != .windows and target .os .tag != .wasi ,
494508 .setitimer = target .os .tag == .linux or target .os .tag .isDarwin (),
495509 .select = target .os .tag == .linux or target .os .tag .isDarwin (),
510+ .strsignal = target .os .tag == .linux or target .os .tag .isDarwin (),
511+ .pselect = target .os .tag == .linux or target .os .tag .isDarwin (),
512+ .utimes = target .os .tag == .linux or target .os .tag .isDarwin (),
496513 };
497514}
498515
@@ -512,6 +529,9 @@ fn addParityProbeCommon(
512529 b .fmt ("-DLIBC_PARITY_HAVE_SIGACTION={d}" , .{@intFromBool (parity .sigaction )}),
513530 b .fmt ("-DLIBC_PARITY_HAVE_SETITIMER={d}" , .{@intFromBool (parity .setitimer )}),
514531 b .fmt ("-DLIBC_PARITY_HAVE_SELECT={d}" , .{@intFromBool (parity .select )}),
532+ b .fmt ("-DLIBC_PARITY_HAVE_STRSIGNAL={d}" , .{@intFromBool (parity .strsignal )}),
533+ b .fmt ("-DLIBC_PARITY_HAVE_PSELECT={d}" , .{@intFromBool (parity .pselect )}),
534+ b .fmt ("-DLIBC_PARITY_HAVE_UTIMES={d}" , .{@intFromBool (parity .utimes )}),
515535 };
516536 addCSourceFilesCompat (exe , &.{"test" ++ std .fs .path .sep_str ++ "libc_parity.c" }, flags [0.. ]);
517537 if (target .result .os .tag == .windows ) {
@@ -716,7 +736,7 @@ fn addLibcTest(
716736 exe .linkLibrary (libc_only_std_static );
717737 exe .linkLibrary (zig_start );
718738 exe .linkLibrary (libc_only_posix );
719- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
739+ // These static artifacts do not currently propagate system- library dependencies.
720740 if (target .result .os .tag == .windows ) {
721741 exe .linkSystemLibrary ("ntdll" );
722742 exe .linkSystemLibrary ("kernel32" );
@@ -761,7 +781,7 @@ fn addTinyRegexCTests(
761781 exe .linkLibrary (libc_only_std_static );
762782 exe .linkLibrary (zig_start );
763783 exe .linkLibrary (zig_posix );
764- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
784+ // These static artifacts do not currently propagate system- library dependencies.
765785 if (target .result .os .tag == .windows ) {
766786 exe .linkSystemLibrary ("ntdll" );
767787 exe .linkSystemLibrary ("kernel32" );
@@ -823,7 +843,7 @@ fn addLua(
823843 lua_exe .linkLibrary (libc_only_std_static );
824844 lua_exe .linkLibrary (libc_only_posix );
825845 lua_exe .linkLibrary (zig_start );
826- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
846+ // These static artifacts do not currently propagate system- library dependencies.
827847 if (target .result .os .tag == .windows ) {
828848 lua_exe .addIncludePath (lazyPath (b , "inc/win32" ));
829849 lua_exe .linkSystemLibrary ("ntdll" );
@@ -895,7 +915,7 @@ fn addCmph(
895915 exe .linkLibrary (libc_only_std_static );
896916 exe .linkLibrary (zig_start );
897917 exe .linkLibrary (zig_posix );
898- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
918+ // These static artifacts do not currently propagate system- library dependencies.
899919 if (target .result .os .tag == .windows ) {
900920 exe .linkSystemLibrary ("ntdll" );
901921 exe .linkSystemLibrary ("kernel32" );
@@ -970,7 +990,7 @@ fn addYacc(
970990 exe .linkLibrary (libc_only_std_static );
971991 exe .linkLibrary (zig_start );
972992 exe .linkLibrary (zig_posix );
973- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
993+ // These static artifacts do not currently propagate system- library dependencies.
974994 if (target .result .os .tag == .windows ) {
975995 exe .linkSystemLibrary ("ntdll" );
976996 exe .linkSystemLibrary ("kernel32" );
@@ -1025,7 +1045,7 @@ fn addYabfc(
10251045 exe .linkLibrary (zig_start );
10261046 exe .linkLibrary (zig_posix );
10271047 exe .linkLibrary (zig_gnu );
1028- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
1048+ // These static artifacts do not currently propagate system- library dependencies.
10291049 if (target .result .os .tag == .windows ) {
10301050 exe .linkSystemLibrary ("ntdll" );
10311051 exe .linkSystemLibrary ("kernel32" );
@@ -1080,7 +1100,7 @@ fn addSecretGame(
10801100 exe .linkLibrary (zig_start );
10811101 exe .linkLibrary (zig_posix );
10821102 exe .linkLibrary (zig_gnu );
1083- // TODO: should libc_only_std_static and zig_start be able to add library dependencies?
1103+ // These static artifacts do not currently propagate system- library dependencies.
10841104 if (target .result .os .tag == .windows ) {
10851105 exe .linkSystemLibrary ("ntdll" );
10861106 exe .linkSystemLibrary ("kernel32" );
0 commit comments