[libc] Add new libc

This new libc is mostly from scratch, with *printf() functions provided
by Marco Paland and Eyal Rozenberg's tiny printf library, and malloc and
friends provided by dlmalloc.
This commit is contained in:
Justin C. Miller
2022-02-06 21:39:04 -08:00
parent 5ddac353a0
commit 346c172b32
90 changed files with 9848 additions and 25 deletions

View File

@@ -15,28 +15,23 @@ def glob(ext):
return list(map(resolve, glob(f"{module_root}/**/*.{ext}", recursive=True)))
sources = []
for ext in ("c", "cpp", "s"):
for ext in ("c", "cpp", "s", "inc"):
sources += glob(ext) + glob(ext + ".cog")
headers = []
for ext in ("h", "inc"):
for ext in ("h",):
headers += glob(ext) + glob(ext + ".cog")
libc = module("libc",
kind = "lib",
deps = [ "j6" ],
output = "libc.a",
sources = sources,
public_headers = headers,
)
libc.variables["ccflags"] = [
"${ccflags}",
"-DDISABLE_SSE",
"-DLACKS_UNISTD_H",
"-DLACKS_FCNTL_H",
"-DLACKS_SYS_PARAM_H",
"-DLACKS_SYS_MMAN_H",
"-DLACKS_SCHED_H",
"-DLACKS_STRINGS_H",
"-DHAVE_MMAP=0",
"${ccflags}",
"-DPRINTF_SUPPORT_DECIMAL_SPECIFIERS=0",
"-DPRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS=0",
]