From bcb4e259c316a978f73dc170b7464fb133b0a7e5 Mon Sep 17 00:00:00 2001 From: huntedbytheirs Date: Thu, 3 Sep 2026 20:57:18 -0400 Subject: [PATCH] build: wire strings.h sources and tests --- Makefile.am | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4e831ee..43170e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -82,12 +82,16 @@ VLIBC_CORE_SRCS = \ # (stpcpy/stpncpy) and memccpy.c are WHOLE-FILE L2-gated (#if VLIBC_LEVEL_GE(2) # around the entire body), and isascii.c/toascii.c hold only L2 symbols # (the header gates their declarations) — all four must be omitted from a -# level-1 profile, so they join the GE_2 conditional list. Files with L1 +# level-1 profile, so they join the GE_2 conditional list. Task 10's +# strings_impl.c is likewise whole-file L2-gated (strcasecmp/strncasecmp/ffs/ +# ffsl/ffsll/bcmp/bcopy/bzero/index/rindex — nothing is POSIX.1-2008 base), so +# it also joins the GE_2 conditional list. Files with L1 # bodies plus small L2 sections (strcoll.c, strdup.c) stay in VLIBC_CORE_SRCS # and self-gate at level 1. VLIBC_LEVEL2_SRCS = src/string/strlcpy.c src/string/strlcat.c \ src/string/stpcpy.c src/string/memccpy.c \ - src/ctype/isascii.c src/ctype/toascii.c + src/ctype/isascii.c src/ctype/toascii.c \ + src/string/strings_impl.c VLIBC_LEVEL3_SRCS = src/string/strcasestr.c vlibc_lib_LTLIBRARIES = libvlibc.la @@ -109,6 +113,7 @@ vlibc_include_HEADERS = \ include/vlibc.h \ include/stddef.h \ include/string.h \ + include/strings.h \ include/errno.h \ include/setjmp.h \ include/assert.h \ @@ -258,7 +263,7 @@ VLIBC_TEST_CFLAGS = -DVLIBC_LEVEL=$(VLIBC_TEST_LEVEL) -fno-stack-protector \ -fno-pic -fno-pie check_PROGRAMS = test_syscall test_strerror test_setjmp test_headers \ - test_startup test_malloc test_string test_ctype + test_startup test_malloc test_string test_ctype test_strings test_syscall_SOURCES = tests/syscall_test.c test_syscall_CFLAGS = $(VLIBC_TEST_CFLAGS) @@ -308,13 +313,19 @@ test_ctype_DEPENDENCIES = crt1.o libvlibc-check.a test_ctype_LINK = $(VLIBC_TEST_LINK) test_ctype_LDADD = $(VLIBC_TEST_LDADD) +test_strings_SOURCES = tests/test_strings.c +test_strings_CFLAGS = $(VLIBC_TEST_CFLAGS) +test_strings_DEPENDENCIES = crt1.o libvlibc-check.a +test_strings_LINK = $(VLIBC_TEST_LINK) +test_strings_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 default -# to the happy mode (exit 0 on all-pass) and are bare TESTS entries; their -# -f/-p modes stay runnable by hand. +# scenarios of the other binaries. test_malloc/test_string/test_ctype/ +# test_strings default to the happy mode (exit 0 on all-pass) and are bare +# TESTS entries; their -f/-p modes stay runnable by hand. TESTS = test_syscall test_strerror test_setjmp test_headers \ - test_malloc test_string test_ctype \ + test_malloc test_string test_ctype test_strings \ tests/startup_modes.sh CLEANFILES = crt1.o libvlibc-check.a $(VLIBC_CHECK_OBJECTS)