build: wire new src dirs, crt objects, and make check into Autotools

This commit is contained in:
2026-09-03 19:36:32 -04:00
parent 558cf8fd12
commit 40a392f454
8 changed files with 1889 additions and 9 deletions
+13 -1
View File
@@ -26,6 +26,9 @@ AM_INIT_AUTOMAKE([foreign subdir-objects])
# (including clang), so it cannot be used to enforce the single-compiler rule.
# Verify the compiler is genuinely GCC, not a compatible one.
AC_PROG_CC
# AM_PROG_AS: library sources include raw x86_64 assembly (the setjmp family
# in src/setjmp/x86_64/*.s), which automake compiles through CCAS/CCASFLAGS.
AM_PROG_AS
AC_MSG_CHECKING([whether the compiler is GCC])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
#if !defined(__GNUC__) || defined(__clang__)
@@ -58,7 +61,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
AC_MSG_ERROR([$CC does not support -std=$vlibc_cstd])])
CFLAGS=$vlibc_save_CFLAGS
AC_SUBST([VLIBC_CFLAGS], ["-std=$vlibc_cstd -Wall -Wextra"])
# -fno-stack-protector: distro GCC builds enable -fstack-protector-strong by
# default, which would make library objects reference __stack_chk_fail — a
# symbol vlibc does not provide yet. Every make-check test binary and every
# -nostdlib -static consumer links against the plain archive, and one
# undefined __stack_chk_fail in it breaks the whole self-hosting link. A
# bootstrap libc must build its own objects without the protector (the stack
# protector runtime lands with the hardening work, after which this flag is
# revisited). Tests compile with the same flag (tests/Makefile.am wiring in
# Makefile.am).
AC_SUBST([VLIBC_CFLAGS], ["-std=$vlibc_cstd -Wall -Wextra -fno-stack-protector"])
# ---- Compatibility profile ----------------------------------------------
# Exactly one of the five profiles is active. They are mutually exclusive;