mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Get monorepo fully building on Windows again
The mkdeps tool was failing, because it used a clever mmap() hack that's no longer supported. I've also removed tinymalloc.inc from build tooling because Windows doesn't like the way it uses overcommit memory. Sadly it means our build tool binaries will be larger. It's less of an issue, now that we are no longer putting build tool binaries in the git repository.
This commit is contained in:
parent
acd6c32184
commit
5469202ea8
15 changed files with 40 additions and 93 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include "libc/assert.h"
|
#include "libc/assert.h"
|
||||||
#include "libc/dce.h"
|
#include "libc/dce.h"
|
||||||
#include "libc/errno.h"
|
#include "libc/errno.h"
|
||||||
|
#include "libc/intrin/kprintf.h"
|
||||||
#include "libc/mem/mem.h"
|
#include "libc/mem/mem.h"
|
||||||
#include "libc/stdalign.h"
|
#include "libc/stdalign.h"
|
||||||
#include "libc/stdckdint.h"
|
#include "libc/stdckdint.h"
|
||||||
|
@ -50,6 +51,10 @@ static void tinymalloc_init(void) {
|
||||||
heap.once = 1;
|
heap.once = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__attribute__((__destructor__)) static void destroy(void) {
|
||||||
|
kprintf("used = %'zu\n", heap.used);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int isheap(char *mem) {
|
static inline int isheap(char *mem) {
|
||||||
return heap.memory <= mem && mem < heap.memory + heap.used;
|
return heap.memory <= mem && mem < heap.memory + heap.used;
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,8 +260,6 @@ static Elf64_Xword notesize;
|
||||||
|
|
||||||
static char *r_off32_e_lfanew;
|
static char *r_off32_e_lfanew;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void Die(const char *thing, const char *reason) {
|
static wontreturn void Die(const char *thing, const char *reason) {
|
||||||
tinyprint(2, thing, ": ", reason, "\n", NULL);
|
tinyprint(2, thing, ": ", reason, "\n", NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -67,8 +67,6 @@
|
||||||
#define FORMAT_MACHO 2
|
#define FORMAT_MACHO 2
|
||||||
#define FORMAT_PE 3
|
#define FORMAT_PE 3
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static int g_arch;
|
static int g_arch;
|
||||||
static int g_format;
|
static int g_format;
|
||||||
static bool g_force;
|
static bool g_force;
|
||||||
|
|
|
@ -229,8 +229,6 @@ const char *const kSafeEnv[] = {
|
||||||
"TMPDIR", // needed by compiler
|
"TMPDIR", // needed by compiler
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
void OnAlrm(int sig) {
|
void OnAlrm(int sig) {
|
||||||
++gotalrm;
|
++gotalrm;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,6 @@ char linkbuf[PATH_MAX];
|
||||||
|
|
||||||
void Cp(char *, char *);
|
void Cp(char *, char *);
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
bool IsDirectory(const char *path) {
|
bool IsDirectory(const char *path) {
|
||||||
int e;
|
int e;
|
||||||
bool res;
|
bool res;
|
||||||
|
|
|
@ -159,9 +159,6 @@ static const char *stubpath;
|
||||||
static long FLAG_SizeOfStackCommit = 64 * 1024;
|
static long FLAG_SizeOfStackCommit = 64 * 1024;
|
||||||
static long FLAG_SizeOfStackReserve = 8 * 1024 * 1024;
|
static long FLAG_SizeOfStackReserve = 8 * 1024 * 1024;
|
||||||
|
|
||||||
#define TINYMALLOC_MAX_ALIGN MAX_ALIGN
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void Die(const char *thing, const char *reason) {
|
static wontreturn void Die(const char *thing, const char *reason) {
|
||||||
tinyprint(2, thing, ": ", reason, "\n", NULL);
|
tinyprint(2, thing, ": ", reason, "\n", NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -67,8 +67,6 @@ static Elf64_Ehdr *elf;
|
||||||
static const char *epath;
|
static const char *epath;
|
||||||
static Elf64_Xword symcount;
|
static Elf64_Xword symcount;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void Die(const char *reason) {
|
static wontreturn void Die(const char *reason) {
|
||||||
tinyprint(2, epath, ": ", reason, "\n", NULL);
|
tinyprint(2, epath, ": ", reason, "\n", NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -71,8 +71,6 @@ const char *prog;
|
||||||
char databuf[32768];
|
char databuf[32768];
|
||||||
char pathbuf[PATH_MAX];
|
char pathbuf[PATH_MAX];
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
wontreturn void PrintUsage(int rc, FILE *f) {
|
wontreturn void PrintUsage(int rc, FILE *f) {
|
||||||
fputs("usage: ", f);
|
fputs("usage: ", f);
|
||||||
fputs(prog, f);
|
fputs(prog, f);
|
||||||
|
|
|
@ -51,8 +51,6 @@ static const char *prog;
|
||||||
static char16_t **filters;
|
static char16_t **filters;
|
||||||
static uint32_t pids[10000];
|
static uint32_t pids[10000];
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void PrintUsage(int rc, FILE *f) {
|
static wontreturn void PrintUsage(int rc, FILE *f) {
|
||||||
fprintf(f,
|
fprintf(f,
|
||||||
"Usage: %s [-nshv] NAME...\n"
|
"Usage: %s [-nshv] NAME...\n"
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
#include "libc/fmt/itoa.h"
|
#include "libc/fmt/itoa.h"
|
||||||
#include "libc/fmt/libgen.h"
|
#include "libc/fmt/libgen.h"
|
||||||
#include "libc/fmt/magnumstrs.internal.h"
|
#include "libc/fmt/magnumstrs.internal.h"
|
||||||
#include "libc/intrin/kprintf.h"
|
|
||||||
#include "libc/limits.h"
|
#include "libc/limits.h"
|
||||||
#include "libc/macros.h"
|
#include "libc/macros.h"
|
||||||
#include "libc/mem/alg.h"
|
#include "libc/mem/alg.h"
|
||||||
|
#include "libc/mem/leaks.h"
|
||||||
#include "libc/mem/mem.h"
|
#include "libc/mem/mem.h"
|
||||||
#include "libc/nexgen32e/crc32.h"
|
#include "libc/nexgen32e/crc32.h"
|
||||||
#include "libc/runtime/runtime.h"
|
#include "libc/runtime/runtime.h"
|
||||||
|
@ -146,8 +146,6 @@ static const char *buildroot;
|
||||||
static const char *genroot;
|
static const char *genroot;
|
||||||
static const char *outpath;
|
static const char *outpath;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static inline bool IsBlank(int c) {
|
static inline bool IsBlank(int c) {
|
||||||
return c == ' ' || c == '\t';
|
return c == ' ' || c == '\t';
|
||||||
}
|
}
|
||||||
|
@ -345,9 +343,8 @@ static const char *FindIncludePath(const char *map, size_t mapsize,
|
||||||
|
|
||||||
// scan backwards for hash character
|
// scan backwards for hash character
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (q == map) {
|
if (q == map)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
if (IsBlank(q[-1])) {
|
if (IsBlank(q[-1])) {
|
||||||
--q;
|
--q;
|
||||||
continue;
|
continue;
|
||||||
|
@ -414,17 +411,15 @@ static void LoadRelationships(int argc, char *argv[]) {
|
||||||
static char srcdirbuf[PATH_MAX];
|
static char srcdirbuf[PATH_MAX];
|
||||||
const char *p, *pe, *src, *path, *pathend, *srcdir, *final;
|
const char *p, *pe, *src, *path, *pathend, *srcdir, *final;
|
||||||
getargs_init(&ga, argv + optind);
|
getargs_init(&ga, argv + optind);
|
||||||
while ((src = getargs_next(&ga))) {
|
while ((src = getargs_next(&ga)))
|
||||||
CreateSourceId(src);
|
CreateSourceId(src);
|
||||||
}
|
|
||||||
getargs_destroy(&ga);
|
getargs_destroy(&ga);
|
||||||
getargs_init(&ga, argv + optind);
|
getargs_init(&ga, argv + optind);
|
||||||
while ((src = getargs_next(&ga))) {
|
while ((src = getargs_next(&ga))) {
|
||||||
is_assembly = endswith(src, ".s");
|
is_assembly = endswith(src, ".s");
|
||||||
srcid = GetSourceId(src);
|
srcid = GetSourceId(src);
|
||||||
if (strlcpy(srcdirbuf, src, PATH_MAX) >= PATH_MAX) {
|
if (strlcpy(srcdirbuf, src, PATH_MAX) >= PATH_MAX)
|
||||||
DiePathTooLong(src);
|
DiePathTooLong(src);
|
||||||
}
|
|
||||||
srcdir = dirname(srcdirbuf);
|
srcdir = dirname(srcdirbuf);
|
||||||
if ((fd = open(src, O_RDONLY)) == -1) {
|
if ((fd = open(src, O_RDONLY)) == -1) {
|
||||||
if (errno == ENOENT && ga.path) {
|
if (errno == ENOENT && ga.path) {
|
||||||
|
@ -438,17 +433,14 @@ static void LoadRelationships(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
DieSys(src);
|
DieSys(src);
|
||||||
}
|
}
|
||||||
if ((rc = lseek(fd, 0, SEEK_END)) == -1) {
|
if ((rc = lseek(fd, 0, SEEK_END)) == -1)
|
||||||
DieSys(src);
|
DieSys(src);
|
||||||
}
|
|
||||||
if ((size = rc)) {
|
if ((size = rc)) {
|
||||||
// repeatedly map to same fixed address so in order to weasel out
|
// repeatedly map to same fixed address so in order to weasel out
|
||||||
// of incurring the additional overhead of all these munmap calls
|
// of incurring the additional overhead of all these munmap calls
|
||||||
map = mmap((void *)0x311987030000, size, PROT_READ,
|
map = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||||
MAP_SHARED | MAP_FIXED, fd, 0);
|
if (map == MAP_FAILED)
|
||||||
if (map == MAP_FAILED) {
|
|
||||||
DieSys(src);
|
DieSys(src);
|
||||||
}
|
|
||||||
for (p = map, pe = map + size; p < pe; ++p) {
|
for (p = map, pe = map + size; p < pe; ++p) {
|
||||||
if (!(p = memmem(p, pe - p, "include ", 8)))
|
if (!(p = memmem(p, pe - p, "include ", 8)))
|
||||||
break;
|
break;
|
||||||
|
@ -477,13 +469,11 @@ static void LoadRelationships(int argc, char *argv[]) {
|
||||||
dependency = -1;
|
dependency = -1;
|
||||||
for (long i = 0; i < systempaths.n; ++i) {
|
for (long i = 0; i < systempaths.n; ++i) {
|
||||||
if (!(final =
|
if (!(final =
|
||||||
__join_paths(juf, PATH_MAX, systempaths.p[i], incpath))) {
|
__join_paths(juf, PATH_MAX, systempaths.p[i], incpath)))
|
||||||
DiePathTooLong(incpath);
|
DiePathTooLong(incpath);
|
||||||
}
|
if ((dependency = GetSourceId(final)) != -1)
|
||||||
if ((dependency = GetSourceId(final)) != -1) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (dependency != -1) {
|
if (dependency != -1) {
|
||||||
AppendEdge(&edges, dependency, srcid);
|
AppendEdge(&edges, dependency, srcid);
|
||||||
p = pathend + 1;
|
p = pathend + 1;
|
||||||
|
@ -506,9 +496,8 @@ static void LoadRelationships(int argc, char *argv[]) {
|
||||||
dependency = GetSourceId((final = incpath));
|
dependency = GetSourceId((final = incpath));
|
||||||
// let foo/bar.c say `#include "hdr.h"`
|
// let foo/bar.c say `#include "hdr.h"`
|
||||||
if (dependency == -1 && !strchr(final, '/')) {
|
if (dependency == -1 && !strchr(final, '/')) {
|
||||||
if (!(final = __join_paths(juf, PATH_MAX, srcdir, final))) {
|
if (!(final = __join_paths(juf, PATH_MAX, srcdir, final)))
|
||||||
DiePathTooLong(incpath);
|
DiePathTooLong(incpath);
|
||||||
}
|
|
||||||
dependency = GetSourceId(final);
|
dependency = GetSourceId(final);
|
||||||
}
|
}
|
||||||
if (dependency == -1) {
|
if (dependency == -1) {
|
||||||
|
@ -526,10 +515,11 @@ static void LoadRelationships(int argc, char *argv[]) {
|
||||||
p = pathend + 1;
|
p = pathend + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (munmap(map, size))
|
||||||
if (close(fd)) {
|
|
||||||
DieSys(src);
|
DieSys(src);
|
||||||
}
|
}
|
||||||
|
if (close(fd))
|
||||||
|
DieSys(src);
|
||||||
}
|
}
|
||||||
getargs_destroy(&ga);
|
getargs_destroy(&ga);
|
||||||
}
|
}
|
||||||
|
@ -540,9 +530,8 @@ static wontreturn void ShowUsage(int rc, int fd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddPath(struct Paths *paths, const char *path) {
|
static void AddPath(struct Paths *paths, const char *path) {
|
||||||
if (paths->n == ARRAYLEN(paths->p)) {
|
if (paths->n == ARRAYLEN(paths->p))
|
||||||
Die("too many path arguments");
|
Die("too many path arguments");
|
||||||
}
|
|
||||||
paths->p[paths->n++] = path;
|
paths->p[paths->n++] = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,21 +546,18 @@ static void GetOpts(int argc, char *argv[]) {
|
||||||
AddPath(&systempaths, optarg);
|
AddPath(&systempaths, optarg);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (outpath) {
|
if (outpath)
|
||||||
Die("multiple output paths specified");
|
Die("multiple output paths specified");
|
||||||
}
|
|
||||||
outpath = optarg;
|
outpath = optarg;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
if (buildroot) {
|
if (buildroot)
|
||||||
Die("multiple build roots specified");
|
Die("multiple build roots specified");
|
||||||
}
|
|
||||||
buildroot = optarg;
|
buildroot = optarg;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
if (genroot) {
|
if (genroot)
|
||||||
Die("multiple generated roots specified");
|
Die("multiple generated roots specified");
|
||||||
}
|
|
||||||
genroot = optarg;
|
genroot = optarg;
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
|
@ -582,31 +568,24 @@ static void GetOpts(int argc, char *argv[]) {
|
||||||
ShowUsage(1, 2);
|
ShowUsage(1, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (optind == argc) {
|
if (optind == argc)
|
||||||
Die("missing input argument");
|
Die("missing input argument");
|
||||||
}
|
if (!genroot)
|
||||||
if (!genroot) {
|
|
||||||
genroot = "o/";
|
genroot = "o/";
|
||||||
}
|
if (!endswith(genroot, "/"))
|
||||||
if (!endswith(genroot, "/")) {
|
|
||||||
Die("generated output path must end with slash");
|
Die("generated output path must end with slash");
|
||||||
}
|
if (!buildroot)
|
||||||
if (!buildroot) {
|
|
||||||
Die("need build output path");
|
Die("need build output path");
|
||||||
}
|
if (!endswith(buildroot, "/"))
|
||||||
if (!endswith(buildroot, "/")) {
|
|
||||||
Die("build output path must end with slash");
|
Die("build output path must end with slash");
|
||||||
}
|
if (!startswith(buildroot, genroot))
|
||||||
if (!startswith(buildroot, genroot)) {
|
|
||||||
Die("build output path must start with generated output path");
|
Die("build output path must start with generated output path");
|
||||||
}
|
|
||||||
if (!systempaths.n && hermetic) {
|
if (!systempaths.n && hermetic) {
|
||||||
AddPath(&systempaths, "third_party/libcxx/include/");
|
AddPath(&systempaths, "third_party/libcxx/include/");
|
||||||
AddPath(&systempaths, "libc/isystem/");
|
AddPath(&systempaths, "libc/isystem/");
|
||||||
}
|
}
|
||||||
if (systempaths.n && !hermetic) {
|
if (systempaths.n && !hermetic)
|
||||||
Die("system path can only be specified in hermetic mode");
|
Die("system path can only be specified in hermetic mode");
|
||||||
}
|
|
||||||
long j = 0;
|
long j = 0;
|
||||||
for (long i = 0; i < systempaths.n; ++i) {
|
for (long i = 0; i < systempaths.n; ++i) {
|
||||||
size_t n;
|
size_t n;
|
||||||
|
@ -619,21 +598,18 @@ static void GetOpts(int argc, char *argv[]) {
|
||||||
DieSys(path);
|
DieSys(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((n = strlen(path)) >= PATH_MAX) {
|
if ((n = strlen(path)) >= PATH_MAX)
|
||||||
DiePathTooLong(path);
|
DiePathTooLong(path);
|
||||||
}
|
if (!n || path[n - 1] != '/')
|
||||||
if (!n || path[n - 1] != '/') {
|
|
||||||
Die("system path must end with slash");
|
Die("system path must end with slash");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
systempaths.n = j;
|
systempaths.n = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *StripExt(char pathbuf[hasatleast PATH_MAX], const char *s) {
|
static const char *StripExt(char pathbuf[hasatleast PATH_MAX], const char *s) {
|
||||||
static char *dot;
|
static char *dot;
|
||||||
if (strlcpy(pathbuf, s, PATH_MAX) >= PATH_MAX) {
|
if (strlcpy(pathbuf, s, PATH_MAX) >= PATH_MAX)
|
||||||
DiePathTooLong(s);
|
DiePathTooLong(s);
|
||||||
}
|
|
||||||
dot = strrchr(pathbuf, '.');
|
dot = strrchr(pathbuf, '.');
|
||||||
if (dot)
|
if (dot)
|
||||||
*dot = '\0';
|
*dot = '\0';
|
||||||
|
@ -661,13 +637,10 @@ static uint32_t GetFileExtension(const char *s) {
|
||||||
static bool IsObjectSource(const char *name) {
|
static bool IsObjectSource(const char *name) {
|
||||||
int i;
|
int i;
|
||||||
uint32_t ext;
|
uint32_t ext;
|
||||||
if ((ext = GetFileExtension(name))) {
|
if ((ext = GetFileExtension(name)))
|
||||||
for (i = 0; i < ARRAYLEN(kSourceExts); ++i) {
|
for (i = 0; i < ARRAYLEN(kSourceExts); ++i)
|
||||||
if (ext == kSourceExts[i]) {
|
if (ext == kSourceExts[i])
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,22 +709,18 @@ int main(int argc, char *argv[]) {
|
||||||
LoadRelationships(argc, argv);
|
LoadRelationships(argc, argv);
|
||||||
Crunch();
|
Crunch();
|
||||||
makefile = Explore();
|
makefile = Explore();
|
||||||
if (outpath &&
|
if (outpath && (fd = open(outpath, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
|
||||||
(fd = open(outpath, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) {
|
|
||||||
DieSys(outpath);
|
DieSys(outpath);
|
||||||
}
|
|
||||||
n = appendz(makefile).i;
|
n = appendz(makefile).i;
|
||||||
for (i = 0; i < n; i += (size_t)rc) {
|
for (i = 0; i < n; i += (size_t)rc)
|
||||||
if ((rc = write(fd, makefile + i, n - i)) == -1) {
|
if ((rc = write(fd, makefile + i, n - i)) == -1)
|
||||||
DieSys(outpath);
|
DieSys(outpath);
|
||||||
}
|
if (outpath && close(fd))
|
||||||
}
|
|
||||||
if (outpath && close(fd)) {
|
|
||||||
DieSys(outpath);
|
DieSys(outpath);
|
||||||
}
|
|
||||||
free(makefile);
|
free(makefile);
|
||||||
free(edges.p);
|
free(edges.p);
|
||||||
free(sauces);
|
free(sauces);
|
||||||
free(names);
|
free(names);
|
||||||
|
CheckForMemoryLeaks();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,6 @@ char linkbuf[PATH_MAX];
|
||||||
|
|
||||||
void Mv(char *, char *);
|
void Mv(char *, char *);
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
wontreturn void Die(const char *path, const char *reason) {
|
wontreturn void Die(const char *path, const char *reason) {
|
||||||
tinyprint(2, path, ": ", reason, "\n", NULL);
|
tinyprint(2, path, ": ", reason, "\n", NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -151,8 +151,6 @@ struct Relas {
|
||||||
} *p;
|
} *p;
|
||||||
} prtu;
|
} prtu;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void Die(const char *path, const char *reason) {
|
static wontreturn void Die(const char *path, const char *reason) {
|
||||||
tinyprint(2, path, ": ", reason, "\n", NULL);
|
tinyprint(2, path, ": ", reason, "\n", NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -33,8 +33,6 @@ const char *FLAG_prefix;
|
||||||
const char *FLAG_suffix;
|
const char *FLAG_suffix;
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
wontreturn void PrintUsage(int fd, int exitcode) {
|
wontreturn void PrintUsage(int fd, int exitcode) {
|
||||||
tinyprint(fd, "\n\
|
tinyprint(fd, "\n\
|
||||||
NAME\n\
|
NAME\n\
|
||||||
|
|
|
@ -48,8 +48,6 @@ static bool recursive;
|
||||||
static bool doemptydirs;
|
static bool doemptydirs;
|
||||||
static const char *prog;
|
static const char *prog;
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
static wontreturn void PrintUsage(int rc, int fd) {
|
static wontreturn void PrintUsage(int rc, int fd) {
|
||||||
tinyprint(fd, "USAGE\n\n ", prog, USAGE, NULL);
|
tinyprint(fd, "USAGE\n\n ", prog, USAGE, NULL);
|
||||||
exit(rc);
|
exit(rc);
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
* @fileoverview elf to symbol table file dump tool
|
* @fileoverview elf to symbol table file dump tool
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libc/mem/tinymalloc.inc"
|
|
||||||
|
|
||||||
void PrintUsage(FILE *f) {
|
void PrintUsage(FILE *f) {
|
||||||
fprintf(f, "%s%s%s\n", "usage: ", program_invocation_name,
|
fprintf(f, "%s%s%s\n", "usage: ", program_invocation_name,
|
||||||
" [-?h] -o PATH COMDBG");
|
" [-?h] -o PATH COMDBG");
|
||||||
|
|
Loading…
Reference in a new issue