build: wire stdlib sources and tests
This commit is contained in:
+37
-5
@@ -75,7 +75,14 @@ VLIBC_CORE_SRCS = \
|
||||
src/string/strstr.c \
|
||||
src/string/strtok.c \
|
||||
src/malloc/malloc.c \
|
||||
src/ctype/ctype.c
|
||||
src/ctype/ctype.c \
|
||||
src/stdlib/strtox.c \
|
||||
src/stdlib/strtox_impl.c \
|
||||
src/stdlib/strtod.c \
|
||||
src/stdlib/rand.c \
|
||||
src/stdlib/qsort.c \
|
||||
src/stdlib/div.c \
|
||||
src/stdlib/inttypes.c
|
||||
|
||||
# Profile-gated sources, EXISTING gates preserved (strlcpy/strlcat stay L2
|
||||
# BSD, strcasestr stays L3 GNU — NOT promoted). Task 8/9 additions: stpcpy.c
|
||||
@@ -87,7 +94,9 @@ VLIBC_CORE_SRCS = \
|
||||
# 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.
|
||||
# and self-gate at level 1. Likewise rand.c (its L2 rand_r/drand48 section)
|
||||
# and the strtox/strtod/inttypes/div/qsort C files (their L2 gates live in
|
||||
# include/stdlib.h / include/inttypes.h declarations) stay in VLIBC_CORE_SRCS.
|
||||
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 \
|
||||
@@ -129,6 +138,7 @@ vlibc_include_HEADERS = \
|
||||
include/stdbool.h \
|
||||
include/stdckdint.h \
|
||||
include/stdint.h \
|
||||
include/inttypes.h \
|
||||
include/stdlib.h \
|
||||
include/stdnoreturn.h \
|
||||
include/tar.h \
|
||||
@@ -263,7 +273,8 @@ 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_strings
|
||||
test_startup test_malloc test_string test_ctype test_strings \
|
||||
test_strtol test_qsort test_inttypes
|
||||
|
||||
test_syscall_SOURCES = tests/syscall_test.c
|
||||
test_syscall_CFLAGS = $(VLIBC_TEST_CFLAGS)
|
||||
@@ -319,13 +330,33 @@ test_strings_DEPENDENCIES = crt1.o libvlibc-check.a
|
||||
test_strings_LINK = $(VLIBC_TEST_LINK)
|
||||
test_strings_LDADD = $(VLIBC_TEST_LDADD)
|
||||
|
||||
test_strtol_SOURCES = tests/test_strtol.c
|
||||
test_strtol_CFLAGS = $(VLIBC_TEST_CFLAGS)
|
||||
test_strtol_DEPENDENCIES = crt1.o libvlibc-check.a
|
||||
test_strtol_LINK = $(VLIBC_TEST_LINK)
|
||||
test_strtol_LDADD = $(VLIBC_TEST_LDADD)
|
||||
|
||||
test_qsort_SOURCES = tests/test_qsort.c
|
||||
test_qsort_CFLAGS = $(VLIBC_TEST_CFLAGS)
|
||||
test_qsort_DEPENDENCIES = crt1.o libvlibc-check.a
|
||||
test_qsort_LINK = $(VLIBC_TEST_LINK)
|
||||
test_qsort_LDADD = $(VLIBC_TEST_LDADD)
|
||||
|
||||
test_inttypes_SOURCES = tests/test_inttypes.c
|
||||
test_inttypes_CFLAGS = $(VLIBC_TEST_CFLAGS)
|
||||
test_inttypes_DEPENDENCIES = crt1.o libvlibc-check.a
|
||||
test_inttypes_LINK = $(VLIBC_TEST_LINK)
|
||||
test_inttypes_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/
|
||||
# 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.
|
||||
# test_strings/test_strtol/test_qsort/test_inttypes 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_strings \
|
||||
test_strtol test_qsort test_inttypes \
|
||||
tests/startup_modes.sh
|
||||
|
||||
CLEANFILES = crt1.o libvlibc-check.a $(VLIBC_CHECK_OBJECTS)
|
||||
@@ -342,6 +373,7 @@ EXTRA_DIST = \
|
||||
src/internal/errno.h \
|
||||
src/internal/libc.h \
|
||||
src/internal/malloc.h \
|
||||
src/internal/strtox.h \
|
||||
src/internal/syscall.h \
|
||||
src/internal/types.h \
|
||||
src/start/start.h \
|
||||
|
||||
Reference in New Issue
Block a user