Realise that the libc core can safely call other libc core functions, even if
they're not defined in the core: so putw() can call stdio stuff, for example. So the earlier concept of pureness isn't necessary. Rename accordingly.
This commit is contained in:
parent
62025c92bd
commit
d1cdb07719
|
@ -2,12 +2,12 @@ include("plat/build.lua")
|
||||||
|
|
||||||
tabgen {
|
tabgen {
|
||||||
name = "ctype_tab",
|
name = "ctype_tab",
|
||||||
srcs = { "./pure/ctype/char.tab" }
|
srcs = { "./core/ctype/char.tab" }
|
||||||
}
|
}
|
||||||
|
|
||||||
normalrule {
|
normalrule {
|
||||||
name = "ctype_files",
|
name = "ctype_files",
|
||||||
ins = { "./pure/ctype/genfiles" },
|
ins = { "./core/ctype/genfiles" },
|
||||||
outleaves = {
|
outleaves = {
|
||||||
"isalnum.c",
|
"isalnum.c",
|
||||||
"isalpha.c",
|
"isalpha.c",
|
||||||
|
@ -33,14 +33,14 @@ for _, plat in ipairs(vars.plats) do
|
||||||
srcs = {
|
srcs = {
|
||||||
"+ctype_files",
|
"+ctype_files",
|
||||||
"+ctype_tab",
|
"+ctype_tab",
|
||||||
"./pure/string/*.c",
|
"./core/string/*.c",
|
||||||
"./pure/stdlib/*.c",
|
"./core/stdlib/*.c",
|
||||||
"./pure/locale/*.c",
|
"./core/locale/*.c",
|
||||||
"./pure/setjmp/*.c",
|
"./core/setjmp/*.c",
|
||||||
"./pure/setjmp/*.e",
|
"./core/setjmp/*.e",
|
||||||
"./pure/math/*.c", -- hypot.c
|
"./core/math/*.c", -- hypot.c
|
||||||
"./pure/math/*.e",
|
"./core/math/*.e",
|
||||||
"./pure/ctype/*.c",
|
"./core/ctype/*.c",
|
||||||
"./errno/*.c",
|
"./errno/*.c",
|
||||||
"./malloc/*.c",
|
"./malloc/*.c",
|
||||||
"./misc/environ.c", -- don't build everything here as it's all obsolete
|
"./misc/environ.c", -- don't build everything here as it's all obsolete
|
||||||
|
@ -56,7 +56,7 @@ for _, plat in ipairs(vars.plats) do
|
||||||
"lang/cem/libcc.ansi/headers+pkg",
|
"lang/cem/libcc.ansi/headers+pkg",
|
||||||
"plat/"..plat.."/include+pkg",
|
"plat/"..plat.."/include+pkg",
|
||||||
"./malloc/malloc.h",
|
"./malloc/malloc.h",
|
||||||
"./pure/math/localmath.h",
|
"./core/math/localmath.h",
|
||||||
"./stdio/loc_incl.h",
|
"./stdio/loc_incl.h",
|
||||||
"./stdlib/ext_fmt.h",
|
"./stdlib/ext_fmt.h",
|
||||||
"./time/loc_time.h",
|
"./time/loc_time.h",
|
||||||
|
|
19
lang/cem/libcc.ansi/core/README.md
Normal file
19
lang/cem/libcc.ansi/core/README.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
This directory contains the libc core: functions here may depend on other
|
||||||
|
libc functions _only_ (so, no `unistd.h` stuff). Plats don't get to configure
|
||||||
|
this, so nothing here should add any overhead if the function isn't linked.
|
||||||
|
|
||||||
|
Examples of what goes here:
|
||||||
|
|
||||||
|
- `strcmp()` --- because it's pure code.
|
||||||
|
- `setjmp()` --- in EM, it's portable.
|
||||||
|
- `assert()` --- because it only calls other core functions (`fputs()`
|
||||||
|
and `abort()`).
|
||||||
|
|
||||||
|
Examples of what doesn't go here:
|
||||||
|
|
||||||
|
- `malloc()` --- because it calls the `unistd.h` function `sbrk()` (and so a
|
||||||
|
plat might want to swap it out).
|
||||||
|
- stdio --- because it calls the `unistd.h` functions `read()`, `write()`
|
||||||
|
etc.
|
||||||
|
- `signal()` --- because it can't be implemented portably and needs to go
|
||||||
|
in the plat.
|
|
@ -1,3 +0,0 @@
|
||||||
This directory contains _only_ pure-code libc functions with no dependencies
|
|
||||||
on anything other than other pure functions (for example: strcmp, div). There
|
|
||||||
should be no reason why any platform won't want these in its libc.
|
|
Loading…
Reference in a new issue