From c4c64a4eb50f8b07d33c30b68d4d4114774c3808 Mon Sep 17 00:00:00 2001 From: huntedbytheirs Date: Sat, 5 Sep 2026 23:41:06 -0400 Subject: [PATCH] build: wire W8 sources and tests --- Makefile.am | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 82d0d7a..34dadb5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -125,6 +125,18 @@ VLIBC_CORE_SRCS = \ src/unistd/rw.c \ src/unistd/sync.c \ src/unistd/truncate.c \ + src/unistd/chdir.c \ + src/unistd/getcwd.c \ + src/unistd/getlogin.c \ + src/unistd/isatty.c \ + src/unistd/link.c \ + src/unistd/readlink.c \ + src/unistd/renameat.c \ + src/unistd/rmdir.c \ + src/unistd/symlink.c \ + src/unistd/ttyname.c \ + src/unistd/unlink.c \ + src/unistd/getopt.c \ src/process/atfork.c \ src/process/execl.c \ src/process/execle.c \ @@ -169,7 +181,10 @@ VLIBC_CORE_SRCS = \ src/time/mktime.c \ src/time/ctime.c \ src/time/tzset.c \ - src/time/strftime.c + src/time/strftime.c \ + src/mman/mmap.c \ + src/passwd/passwd.c \ + src/group/group.c # Profile-gated sources, EXISTING gates preserved (strlcpy/strlcat stay L2 # BSD, strcasestr stays L3 GNU — NOT promoted). Task 8/9 additions: stpcpy.c @@ -202,7 +217,11 @@ VLIBC_LEVEL2_SRCS = src/string/strlcpy.c src/string/strlcat.c \ src/select/ppoll.c \ src/time/strptime.c src/time/timer.c \ src/time/gettimeofday.c src/time/settimeofday.c \ - src/time/getitimer.c src/time/setitimer.c src/time/utimes.c + src/time/getitimer.c src/time/setitimer.c src/time/utimes.c \ + src/stat/statvfs.c src/sys/times.c src/misc/syslog.c \ + src/unistd/basename.c src/unistd/dirname.c src/unistd/realpath.c \ + src/unistd/chroot.c src/unistd/swab.c src/unistd/confstr.c \ + src/unistd/getwd.c VLIBC_LEVEL3_SRCS = src/string/strcasestr.c vlibc_lib_LTLIBRARIES = libvlibc.la @@ -253,11 +272,24 @@ vlibc_include_HEADERS = \ include/stdio.h \ include/time.h \ include/unistd.h \ + include/syslog.h \ + include/pwd.h \ + include/grp.h \ + include/libgen.h + +# sys/* headers use their own primary so the sys/ subpath survives install: +# automake's flat _HEADERS install strips directory components, which would +# both drop the sys/ prefix for consumers AND collide on shared +# basenames (time.h vs sys/time.h, GNU install refuses the second copy). +vlibc_include_sys_HEADERS = \ include/sys/select.h \ include/sys/stat.h \ include/sys/time.h \ include/sys/types.h \ - include/sys/wait.h + include/sys/wait.h \ + include/sys/mman.h \ + include/sys/statvfs.h \ + include/sys/times.h # Install location depends on the install method (see configure.ac). if INSTALL_OVERWRITE @@ -268,6 +300,11 @@ vlibc_includedir = $(prefix)/lib/vlibc/include vlibc_libdir = $(prefix)/lib/vlibc/lib endif +# sys/* headers live under $(vlibc_includedir)/sys (see the sys primary +# above; must follow the INSTALL_OVERWRITE conditional to inherit the +# resolved vlibc_includedir). +vlibc_include_sysdir = $(vlibc_includedir)/sys + # Generated per-profile feature header (see configure.ac); installed under # $(vlibc_includedir)/vlibc/. A dedicated primary is used because # nodist_nobase_vlibc_include_HEADERS is rejected by automake (the "nobase" @@ -389,7 +426,9 @@ check_PROGRAMS = test_syscall test_strerror test_setjmp test_headers \ test_strtol test_qsort test_inttypes test_env \ test_process test_fcntl test_stat test_wait test_dirent \ test_poll test_time test_scanf test_getline \ - test_systime test_printf test_stdio test_unistd_file + test_systime test_printf test_stdio test_unistd_file \ + test_mman test_statvfs test_times test_syslog test_pwdgrp \ + test_unistd_misc test_syscall_SOURCES = tests/syscall_test.c test_syscall_CFLAGS = $(VLIBC_TEST_CFLAGS) @@ -547,6 +586,42 @@ test_unistd_file_DEPENDENCIES = crt1.o libvlibc-check.a test_unistd_file_LINK = $(VLIBC_TEST_LINK) test_unistd_file_LDADD = $(VLIBC_TEST_LDADD) +test_mman_SOURCES = tests/test_mman.c +test_mman_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_mman_DEPENDENCIES = crt1.o libvlibc-check.a +test_mman_LINK = $(VLIBC_TEST_LINK) +test_mman_LDADD = $(VLIBC_TEST_LDADD) + +test_statvfs_SOURCES = tests/test_statvfs.c +test_statvfs_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_statvfs_DEPENDENCIES = crt1.o libvlibc-check.a +test_statvfs_LINK = $(VLIBC_TEST_LINK) +test_statvfs_LDADD = $(VLIBC_TEST_LDADD) + +test_times_SOURCES = tests/test_times.c +test_times_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_times_DEPENDENCIES = crt1.o libvlibc-check.a +test_times_LINK = $(VLIBC_TEST_LINK) +test_times_LDADD = $(VLIBC_TEST_LDADD) + +test_syslog_SOURCES = tests/test_syslog.c +test_syslog_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_syslog_DEPENDENCIES = crt1.o libvlibc-check.a +test_syslog_LINK = $(VLIBC_TEST_LINK) +test_syslog_LDADD = $(VLIBC_TEST_LDADD) + +test_pwdgrp_SOURCES = tests/test_pwdgrp.c +test_pwdgrp_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_pwdgrp_DEPENDENCIES = crt1.o libvlibc-check.a +test_pwdgrp_LINK = $(VLIBC_TEST_LINK) +test_pwdgrp_LDADD = $(VLIBC_TEST_LDADD) + +test_unistd_misc_SOURCES = tests/test_unistd_misc.c +test_unistd_misc_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_unistd_misc_DEPENDENCIES = crt1.o libvlibc-check.a +test_unistd_misc_LINK = $(VLIBC_TEST_LINK) +test_unistd_misc_LDADD = $(VLIBC_TEST_LDADD) + # test_startup's default mode exits 42 by design, so it is NOT a bare TESTS # entry; tests/startup_modes.sh runs its full mode matrix and the -f failure # scenarios of the other binaries. test_malloc/test_string/test_ctype/ @@ -561,6 +636,8 @@ TESTS = test_syscall test_strerror test_setjmp test_headers \ test_process test_fcntl test_stat test_wait test_dirent \ test_poll test_time test_scanf test_getline \ test_systime test_printf test_stdio test_unistd_file \ + test_mman test_statvfs test_times test_syslog test_pwdgrp \ + test_unistd_misc \ tests/startup_modes.sh CLEANFILES = crt1.o libvlibc-check.a $(VLIBC_CHECK_OBJECTS)