|
@@ -0,0 +1,478 @@
|
|
|
+load('//sys/src/FLAGS', "KLIB_COMPILER_FLAGS", "LIB_COMPILER_FLAGS")
|
|
|
+
|
|
|
+LIBC_SRCS = [
|
|
|
+ "9sys/access.c",
|
|
|
+ "9sys/announce.c",
|
|
|
+ "9sys/convD2M.c",
|
|
|
+ "9sys/convM2D.c",
|
|
|
+ "9sys/convM2S.c",
|
|
|
+ "9sys/convS2M.c",
|
|
|
+ "9sys/cputime.c",
|
|
|
+ "9sys/ctime.c",
|
|
|
+ "9sys/dial.c",
|
|
|
+ "9sys/dirfstat.c",
|
|
|
+ "9sys/dirfwstat.c",
|
|
|
+ "9sys/dirmodefmt.c",
|
|
|
+ "9sys/dirread.c",
|
|
|
+ "9sys/dirstat.c",
|
|
|
+ "9sys/dirwstat.c",
|
|
|
+ "9sys/fcallfmt.c",
|
|
|
+ "9sys/fork.c",
|
|
|
+ "9sys/getnetconninfo.c",
|
|
|
+ "9sys/getenv.c",
|
|
|
+ "9sys/getpid.c",
|
|
|
+ "9sys/getppid.c",
|
|
|
+ "9sys/getwd.c",
|
|
|
+ "9sys/iounit.c",
|
|
|
+ "9sys/nulldir.c",
|
|
|
+ "9sys/postnote.c",
|
|
|
+ "9sys/privalloc.c",
|
|
|
+ "9sys/pushssl.c",
|
|
|
+ "9sys/pushtls.c",
|
|
|
+ "9sys/putenv.c",
|
|
|
+ "9sys/qlock.c",
|
|
|
+ "9sys/read9pmsg.c",
|
|
|
+ "9sys/read.c",
|
|
|
+ "9sys/readv.c",
|
|
|
+ "9sys/rerrstr.c",
|
|
|
+ "9sys/sbrk.c",
|
|
|
+ "9sys/setnetmtpt.c",
|
|
|
+ "9sys/sysfatal.c",
|
|
|
+ "9sys/syslog.c",
|
|
|
+ "9sys/sysname.c",
|
|
|
+ "9sys/time.c",
|
|
|
+ "9sys/times.c",
|
|
|
+ "9sys/tm2sec.c",
|
|
|
+ "9sys/truerand.c",
|
|
|
+ "9sys/wait.c",
|
|
|
+ "9sys/waitpid.c",
|
|
|
+ "9sys/werrstr.c",
|
|
|
+ "9sys/write.c",
|
|
|
+ "9sys/writev.c",
|
|
|
+ "9syscall/alarm.s",
|
|
|
+ "9syscall/await.s",
|
|
|
+ "9syscall/bind.s",
|
|
|
+ "9syscall/brk_.s",
|
|
|
+ "9syscall/chdir.s",
|
|
|
+ "9syscall/close.s",
|
|
|
+ "9syscall/create.s",
|
|
|
+ "9syscall/dup.s",
|
|
|
+ "9syscall/errstr.s",
|
|
|
+ "9syscall/exec.s",
|
|
|
+ "9syscall/_exits.s",
|
|
|
+ "9syscall/fauth.s",
|
|
|
+ "9syscall/fd2path.s",
|
|
|
+ "9syscall/fstat.s",
|
|
|
+ "9syscall/fversion.s",
|
|
|
+ "9syscall/fwstat.s",
|
|
|
+ "9syscall/mount.s",
|
|
|
+ "9syscall/noted.s",
|
|
|
+ "9syscall/notify.s",
|
|
|
+ "9syscall/nsec.s",
|
|
|
+ "9syscall/open.s",
|
|
|
+ "9syscall/pipe.s",
|
|
|
+ "9syscall/pread.s",
|
|
|
+ "9syscall/pwrite.s",
|
|
|
+ "9syscall/remove.s",
|
|
|
+ "9syscall/rendezvous.s",
|
|
|
+ "9syscall/rfork.s",
|
|
|
+ "9syscall/seek.s",
|
|
|
+ "9syscall/segattach.s",
|
|
|
+ "9syscall/segbrk.s",
|
|
|
+ "9syscall/segdetach.s",
|
|
|
+ "9syscall/segflush.s",
|
|
|
+ "9syscall/segfree.s",
|
|
|
+ "9syscall/semacquire.s",
|
|
|
+ "9syscall/semrelease.s",
|
|
|
+ "9syscall/sleep.s",
|
|
|
+ "9syscall/stat.s",
|
|
|
+ "9syscall/tsemacquire.s",
|
|
|
+ "9syscall/unmount.s",
|
|
|
+ "9syscall/wstat.s",
|
|
|
+ "fmt/dofmt.c",
|
|
|
+ "fmt/dorfmt.c",
|
|
|
+ "fmt/errfmt.c",
|
|
|
+ "fmt/fltfmt.c",
|
|
|
+ "fmt/fmt.c",
|
|
|
+ "fmt/fmtfd.c",
|
|
|
+ "fmt/fmtlock.c",
|
|
|
+ "fmt/fmtprint.c",
|
|
|
+ "fmt/fmtquote.c",
|
|
|
+ "fmt/fmtrune.c",
|
|
|
+ "fmt/fmtstr.c",
|
|
|
+ "fmt/fmtvprint.c",
|
|
|
+ "fmt/fprint.c",
|
|
|
+ "fmt/print.c",
|
|
|
+ "fmt/runefmtstr.c",
|
|
|
+ "fmt/runeseprint.c",
|
|
|
+ "fmt/runesmprint.c",
|
|
|
+ "fmt/runesnprint.c",
|
|
|
+ "fmt/runesprint.c",
|
|
|
+ "fmt/runevseprint.c",
|
|
|
+ "fmt/runevsmprint.c",
|
|
|
+ "fmt/runevsnprint.c",
|
|
|
+ "fmt/seprint.c",
|
|
|
+ "fmt/smprint.c",
|
|
|
+ "fmt/snprint.c",
|
|
|
+ "fmt/sprint.c",
|
|
|
+ "fmt/vfprint.c",
|
|
|
+ "fmt/vseprint.c",
|
|
|
+ "fmt/vsmprint.c",
|
|
|
+ "fmt/vsnprint.c",
|
|
|
+ "port/_assert.c",
|
|
|
+ "port/abs.c",
|
|
|
+ "port/asin.c",
|
|
|
+ "port/atan.c",
|
|
|
+ "port/atan2.c",
|
|
|
+ "port/atexit.c",
|
|
|
+ "port/atnotify.c",
|
|
|
+ "port/atof.c",
|
|
|
+ "port/atol.c",
|
|
|
+ "port/atoll.c",
|
|
|
+ "port/cistrcmp.c",
|
|
|
+ "port/cistrncmp.c",
|
|
|
+ "port/cistrstr.c",
|
|
|
+ "port/charstod.c",
|
|
|
+ "port/cleanname.c",
|
|
|
+ "port/ctype.c",
|
|
|
+ "port/encodefmt.c",
|
|
|
+ "port/execl.c",
|
|
|
+ "port/exp.c",
|
|
|
+ "port/fabs.c",
|
|
|
+ "port/floor.c",
|
|
|
+ "port/fmod.c",
|
|
|
+ "port/frand.c",
|
|
|
+ "port/frexp.c",
|
|
|
+ "port/getcallerpc.c",
|
|
|
+ "port/getfields.c",
|
|
|
+ "port/getuser.c",
|
|
|
+ "port/hangup.c",
|
|
|
+ "port/hypot.c",
|
|
|
+ "port/lnrand.c",
|
|
|
+ "port/lock.c",
|
|
|
+ "port/log.c",
|
|
|
+ "port/lrand.c",
|
|
|
+ "port/malloc.c",
|
|
|
+ "port/memccpy.c",
|
|
|
+ "port/memchr.c",
|
|
|
+ "port/memcmp.c",
|
|
|
+ "port/memmove.c",
|
|
|
+ "port/memset.c",
|
|
|
+ "port/mktemp.c",
|
|
|
+ "port/muldiv.c",
|
|
|
+ "port/nan.c",
|
|
|
+ "port/needsrcquote.c",
|
|
|
+ "port/netmkaddr.c",
|
|
|
+ "port/nrand.c",
|
|
|
+ "port/ntruerand.c",
|
|
|
+ "port/perror.c",
|
|
|
+ "port/pool.c",
|
|
|
+ "port/pow.c",
|
|
|
+ "port/pow10.c",
|
|
|
+ "port/qsort.c",
|
|
|
+ "port/quote.c",
|
|
|
+ "port/rand.c",
|
|
|
+ "port/readn.c",
|
|
|
+ "port/rijndael.c",
|
|
|
+ "port/rune.c",
|
|
|
+ "port/runebase.c",
|
|
|
+ "port/runebsearch.c",
|
|
|
+ "port/runestrcat.c",
|
|
|
+ "port/runestrchr.c",
|
|
|
+ "port/runestrcmp.c",
|
|
|
+ "port/runestrcpy.c",
|
|
|
+ "port/runestrecpy.c",
|
|
|
+ "port/runestrdup.c",
|
|
|
+ "port/runestrncat.c",
|
|
|
+ "port/runestrncmp.c",
|
|
|
+ "port/runestrncpy.c",
|
|
|
+ "port/runestrrchr.c",
|
|
|
+ "port/runestrlen.c",
|
|
|
+ "port/runestrstr.c",
|
|
|
+ "port/runetype.c",
|
|
|
+ "port/sha2.c",
|
|
|
+ "port/sin.c",
|
|
|
+ "port/sinh.c",
|
|
|
+ "port/strcat.c",
|
|
|
+ "port/strchr.c",
|
|
|
+ "port/strcmp.c",
|
|
|
+ "port/strcpy.c",
|
|
|
+ "port/strecpy.c",
|
|
|
+ "port/strcspn.c",
|
|
|
+ "port/strdup.c",
|
|
|
+ "port/strlen.c",
|
|
|
+ "port/strncat.c",
|
|
|
+ "port/strncmp.c",
|
|
|
+ "port/strncpy.c",
|
|
|
+ "port/strpbrk.c",
|
|
|
+ "port/strrchr.c",
|
|
|
+ "port/strspn.c",
|
|
|
+ "port/strstr.c",
|
|
|
+ "port/strtod.c",
|
|
|
+ "port/strtok.c",
|
|
|
+ "port/strtol.c",
|
|
|
+ "port/strtoll.c",
|
|
|
+ "port/strtoul.c",
|
|
|
+ "port/strtoull.c",
|
|
|
+ "port/tan.c",
|
|
|
+ "port/tanh.c",
|
|
|
+ "port/tokenize.c",
|
|
|
+ "port/toupper.c",
|
|
|
+ "port/utfecpy.c",
|
|
|
+ "port/utflen.c",
|
|
|
+ "port/utfnlen.c",
|
|
|
+ "port/utfrune.c",
|
|
|
+ "port/utfrrune.c",
|
|
|
+ "port/utfutf.c",
|
|
|
+ "port/u16.c",
|
|
|
+ "port/u32.c",
|
|
|
+ "port/u64.c",
|
|
|
+ "amd64/notejmp.c",
|
|
|
+ "amd64/cycles.c",
|
|
|
+ "amd64/argv0.c",
|
|
|
+ "amd64/rdpmc.c",
|
|
|
+ "amd64/setjmp.s",
|
|
|
+ "amd64/sqrt.s",
|
|
|
+ "amd64/tas.s",
|
|
|
+ "amd64/atom.S",
|
|
|
+ "amd64/main9.S"
|
|
|
+]
|
|
|
+
|
|
|
+KLIBC_SRCS = [
|
|
|
+ "9sys/access.c",
|
|
|
+ "9sys/announce.c",
|
|
|
+ "9sys/convD2M.c",
|
|
|
+ "9sys/convM2D.c",
|
|
|
+ "9sys/convM2S.c",
|
|
|
+ "9sys/convS2M.c",
|
|
|
+ "9sys/cputime.c",
|
|
|
+ "9sys/ctime.c",
|
|
|
+ "9sys/dial.c",
|
|
|
+ "9sys/dirfstat.c",
|
|
|
+ "9sys/dirfwstat.c",
|
|
|
+ "9sys/dirmodefmt.c",
|
|
|
+ "9sys/dirread.c",
|
|
|
+ "9sys/dirstat.c",
|
|
|
+ "9sys/dirwstat.c",
|
|
|
+ "9sys/fcallfmt.c",
|
|
|
+ "9sys/fork.c",
|
|
|
+ "9sys/getnetconninfo.c",
|
|
|
+ "9sys/getenv.c",
|
|
|
+ "9sys/getpid.c",
|
|
|
+ "9sys/getppid.c",
|
|
|
+ "9sys/getwd.c",
|
|
|
+ "9sys/iounit.c",
|
|
|
+ "9sys/nulldir.c",
|
|
|
+ "9sys/postnote.c",
|
|
|
+ "9sys/privalloc.c",
|
|
|
+ "9sys/pushssl.c",
|
|
|
+ "9sys/pushtls.c",
|
|
|
+ "9sys/putenv.c",
|
|
|
+ "9sys/qlock.c",
|
|
|
+ "9sys/read9pmsg.c",
|
|
|
+ "9sys/read.c",
|
|
|
+ "9sys/readv.c",
|
|
|
+ "9sys/rerrstr.c",
|
|
|
+ "9sys/sbrk.c",
|
|
|
+ "9sys/setnetmtpt.c",
|
|
|
+ "9sys/sysfatal.c",
|
|
|
+ "9sys/syslog.c",
|
|
|
+ "9sys/sysname.c",
|
|
|
+ "9sys/time.c",
|
|
|
+ "9sys/times.c",
|
|
|
+ "9sys/tm2sec.c",
|
|
|
+ "9sys/truerand.c",
|
|
|
+ "9sys/wait.c",
|
|
|
+ "9sys/waitpid.c",
|
|
|
+ "9sys/werrstr.c",
|
|
|
+ "9sys/write.c",
|
|
|
+ "9sys/writev.c",
|
|
|
+ "fmt/dofmt.c",
|
|
|
+ "fmt/dorfmt.c",
|
|
|
+ "fmt/errfmt.c",
|
|
|
+ "fmt/fltfmt.c",
|
|
|
+ "fmt/fmt.c",
|
|
|
+ "fmt/fmtfd.c",
|
|
|
+ "fmt/fmtlock.c",
|
|
|
+ "fmt/fmtprint.c",
|
|
|
+ "fmt/fmtquote.c",
|
|
|
+ "fmt/fmtrune.c",
|
|
|
+ "fmt/fmtstr.c",
|
|
|
+ "fmt/fmtvprint.c",
|
|
|
+ "fmt/fprint.c",
|
|
|
+ "fmt/print.c",
|
|
|
+ "fmt/runefmtstr.c",
|
|
|
+ "fmt/runeseprint.c",
|
|
|
+ "fmt/runesmprint.c",
|
|
|
+ "fmt/runesnprint.c",
|
|
|
+ "fmt/runesprint.c",
|
|
|
+ "fmt/runevseprint.c",
|
|
|
+ "fmt/runevsmprint.c",
|
|
|
+ "fmt/runevsnprint.c",
|
|
|
+ "fmt/seprint.c",
|
|
|
+ "fmt/smprint.c",
|
|
|
+ "fmt/snprint.c",
|
|
|
+ "fmt/sprint.c",
|
|
|
+ "fmt/vfprint.c",
|
|
|
+ "fmt/vseprint.c",
|
|
|
+ "fmt/vsmprint.c",
|
|
|
+ "fmt/vsnprint.c",
|
|
|
+ "port/_assert.c",
|
|
|
+ "port/abs.c",
|
|
|
+ "port/asin.c",
|
|
|
+ "port/atan.c",
|
|
|
+ "port/atan2.c",
|
|
|
+ "port/atexit.c",
|
|
|
+ "port/atnotify.c",
|
|
|
+ "port/atof.c",
|
|
|
+ "port/atol.c",
|
|
|
+ "port/atoll.c",
|
|
|
+ "port/cistrcmp.c",
|
|
|
+ "port/cistrncmp.c",
|
|
|
+ "port/cistrstr.c",
|
|
|
+ "port/charstod.c",
|
|
|
+ "port/cleanname.c",
|
|
|
+ "port/ctype.c",
|
|
|
+ "port/encodefmt.c",
|
|
|
+ "port/execl.c",
|
|
|
+ "port/exp.c",
|
|
|
+ "port/fabs.c",
|
|
|
+ "port/floor.c",
|
|
|
+ "port/fmod.c",
|
|
|
+ "port/frand.c",
|
|
|
+ "port/frexp.c",
|
|
|
+ "port/getcallerpc.c",
|
|
|
+ "port/getfields.c",
|
|
|
+ "port/getuser.c",
|
|
|
+ "port/hangup.c",
|
|
|
+ "port/hypot.c",
|
|
|
+ "port/lnrand.c",
|
|
|
+ "port/lock.c",
|
|
|
+ "port/log.c",
|
|
|
+ "port/lrand.c",
|
|
|
+ "port/malloc.c",
|
|
|
+ "port/memccpy.c",
|
|
|
+ "port/memchr.c",
|
|
|
+ "port/memcmp.c",
|
|
|
+ "port/memmove.c",
|
|
|
+ "port/memset.c",
|
|
|
+ "port/mktemp.c",
|
|
|
+ "port/muldiv.c",
|
|
|
+ "port/nan.c",
|
|
|
+ "port/needsrcquote.c",
|
|
|
+ "port/netmkaddr.c",
|
|
|
+ "port/nrand.c",
|
|
|
+ "port/ntruerand.c",
|
|
|
+ "port/perror.c",
|
|
|
+ "port/pool.c",
|
|
|
+ "port/pow.c",
|
|
|
+ "port/pow10.c",
|
|
|
+ "port/qsort.c",
|
|
|
+ "port/quote.c",
|
|
|
+ "port/rand.c",
|
|
|
+ "port/readn.c",
|
|
|
+ "port/rijndael.c",
|
|
|
+ "port/rune.c",
|
|
|
+ "port/runebase.c",
|
|
|
+ "port/runebsearch.c",
|
|
|
+ "port/runestrcat.c",
|
|
|
+ "port/runestrchr.c",
|
|
|
+ "port/runestrcmp.c",
|
|
|
+ "port/runestrcpy.c",
|
|
|
+ "port/runestrecpy.c",
|
|
|
+ "port/runestrdup.c",
|
|
|
+ "port/runestrncat.c",
|
|
|
+ "port/runestrncmp.c",
|
|
|
+ "port/runestrncpy.c",
|
|
|
+ "port/runestrrchr.c",
|
|
|
+ "port/runestrlen.c",
|
|
|
+ "port/runestrstr.c",
|
|
|
+ "port/runetype.c",
|
|
|
+ "port/sha2.c",
|
|
|
+ "port/sin.c",
|
|
|
+ "port/sinh.c",
|
|
|
+ "port/strcat.c",
|
|
|
+ "port/strchr.c",
|
|
|
+ "port/strcmp.c",
|
|
|
+ "port/strcpy.c",
|
|
|
+ "port/strecpy.c",
|
|
|
+ "port/strcspn.c",
|
|
|
+ "port/strdup.c",
|
|
|
+ "port/strlen.c",
|
|
|
+ "port/strncat.c",
|
|
|
+ "port/strncmp.c",
|
|
|
+ "port/strncpy.c",
|
|
|
+ "port/strpbrk.c",
|
|
|
+ "port/strrchr.c",
|
|
|
+ "port/strspn.c",
|
|
|
+ "port/strstr.c",
|
|
|
+ "port/strtod.c",
|
|
|
+ "port/strtok.c",
|
|
|
+ "port/strtol.c",
|
|
|
+ "port/strtoll.c",
|
|
|
+ "port/strtoul.c",
|
|
|
+ "port/strtoull.c",
|
|
|
+ "port/tan.c",
|
|
|
+ "port/tanh.c",
|
|
|
+ "port/tokenize.c",
|
|
|
+ "port/toupper.c",
|
|
|
+ "port/utfecpy.c",
|
|
|
+ "port/utflen.c",
|
|
|
+ "port/utfnlen.c",
|
|
|
+ "port/utfrune.c",
|
|
|
+ "port/utfrrune.c",
|
|
|
+ "port/utfutf.c",
|
|
|
+ "port/u16.c",
|
|
|
+ "port/u32.c",
|
|
|
+ "port/u64.c",
|
|
|
+ "amd64/notejmp.c",
|
|
|
+ "amd64/cycles.c",
|
|
|
+ "amd64/argv0.c",
|
|
|
+ "amd64/rdpmc.c",
|
|
|
+ "amd64/setjmp.s",
|
|
|
+ "amd64/sqrt.s",
|
|
|
+ "amd64/tas.s",
|
|
|
+ "amd64/atom.S",
|
|
|
+ "amd64/main9.S"
|
|
|
+]
|
|
|
+
|
|
|
+
|
|
|
+cc_library(
|
|
|
+ name="libkc",
|
|
|
+ copts=KLIB_COMPILER_FLAGS,
|
|
|
+ includes=[
|
|
|
+ "//sys/include",
|
|
|
+ "//amd64/include",
|
|
|
+ "//sys/src/libc"
|
|
|
+ ],
|
|
|
+ srcs=KLIBC_SRCS,
|
|
|
+)
|
|
|
+
|
|
|
+cc_library(
|
|
|
+ name="libc",
|
|
|
+ copts=LIB_COMPILER_FLAGS,
|
|
|
+ includes=[
|
|
|
+ "//sys/include",
|
|
|
+ "//amd64/include",
|
|
|
+ "//sys/src/libc"
|
|
|
+ ],
|
|
|
+ srcs=LIBC_SRCS,
|
|
|
+ deps=[
|
|
|
+ ":9syscall",
|
|
|
+ ":syscallheader"
|
|
|
+ ]
|
|
|
+)
|
|
|
+
|
|
|
+mk_sys(
|
|
|
+ name="syscallheader",
|
|
|
+ mode="sys.h",
|
|
|
+ arch="amd64",
|
|
|
+ sysconf="//sys/src/sysconf.json",
|
|
|
+)
|
|
|
+
|
|
|
+mk_sys(
|
|
|
+ name="9syscall",
|
|
|
+ mode="syscallfiles",
|
|
|
+ arch="amd64",
|
|
|
+ sysconf="//sys/src/sysconf.json",
|
|
|
+)
|