cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit abc80f19c55ae45742cf7d2bc54c2c4a4dc8236c
parent 992873f1a51847bd7e80e172e1a46c95c559177d
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 26 Apr 2019 17:57:28 -0700

Remove compilecmd from config.h

We replace it with one derived from the driver path anyway.

Diffstat:
Mconfig.def.h | 1-
Mdriver.c | 7+------
2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -44,7 +44,6 @@ static char *preprocesscmd[] = { "-D", "__signed__=signed", "-D", "__thread=_Thread_local", }; -static char *compilecmd[] = {"cc-qbe"}; static char *codegencmd[] = {"qbe"}; static char *assemblecmd[] = {"as"}; static char *linkcmd[] = {"ld", "--dynamic-linker=" DYNAMICLINKER}; diff --git a/driver.c b/driver.c @@ -320,8 +320,6 @@ compilecommand(char *arg) fatal("target of /proc/self/exe is too large"); } strcpy(self + n, "-qbe"); - if (access(self, X_OK) < 0) - return NULL; cmd = strdup(self); if (!cmd) fatal("strdup:"); @@ -338,13 +336,10 @@ main(int argc, char *argv[]) size_t i; arrayaddbuf(&phases[PREPROCESS].cmd, preprocesscmd, sizeof(preprocesscmd)); - arrayaddbuf(&phases[COMPILE].cmd, compilecmd, sizeof(compilecmd)); + arrayaddptr(&phases[COMPILE].cmd, compilecommand(argv[0])); arrayaddbuf(&phases[CODEGEN].cmd, codegencmd, sizeof(codegencmd)); arrayaddbuf(&phases[ASSEMBLE].cmd, assemblecmd, sizeof(assemblecmd)); arrayaddbuf(&phases[LINK].cmd, linkcmd, sizeof(linkcmd)); - arg = compilecommand(argv[0]); - if (arg) - *(char **)phases[COMPILE].cmd.val = arg; argv0 = progname(argv[0], "cc"); for (;;) {