diff --git a/Makefile.docker b/Makefile.docker index 3b426b86..c5ab3aa1 100644 --- a/Makefile.docker +++ b/Makefile.docker @@ -17,8 +17,8 @@ test-%: docker-% docker run --rm --platform linux/amd64 $(DOCKER_MOUNTS) $(IMAGE_NAME):$* test-host docker run --rm --platform linux/i386 $(DOCKER_MOUNTS) $(IMAGE_NAME):$* test-host -run: docker-latest - docker run --rm -it -v $(CURDIR):/src $(IMAGE_NAME):latest +run-%: docker-latest + docker run --rm --platform linux/$* -it -v $(CURDIR):/src $(IMAGE_NAME):latest bootsh.amd64.%: docker-% ID=`docker create --platform linux/amd64 $(IMAGE_NAME):$*` && docker cp $$ID:/bin/sh $@ && docker rm $$ID diff --git a/Makefile.packages b/Makefile.packages index 6329dc04..07622578 100644 --- a/Makefile.packages +++ b/Makefile.packages @@ -19,7 +19,7 @@ gawk-5.3.0: /src/tarballs/gawk-5.3.0.tar.xz /usr/local/bin/gawk: gawk-5.3.0 @echo "Bootstrapping gawk -> /src/logs/boot_gawk.log" - (cd $< && ./configure --disable-shared LD=cc && $(MAKE) && $(MAKE) install) > /src/logs/boot_gawk.log 2>&1 + (cd $< && ./configure --disable-shared && $(MAKE) && $(MAKE) install) > /src/logs/boot_gawk.log 2>&1 ln -sf /usr/local/bin/gawk /usr/local/bin/awk gawk: /usr/local/bin/gawk @@ -73,7 +73,7 @@ bash-5.2.21: /src/tarballs/bash-5.2.21.tar.gz /bin/bash: bash-5.2.21 @echo "Bootstrapping bash -> /src/logs/boot_bash.log" - (cd $< && ./configure --prefix=/ --without-bash-malloc LD=cc && $(MAKE) && $(MAKE) install) > /src/logs/boot_bash.log 2>&1 + (cd $< && ./configure --prefix=/ --without-bash-malloc && $(MAKE) && $(MAKE) install) > /src/logs/boot_bash.log 2>&1 bash: /bin/bash @@ -117,7 +117,7 @@ curl-8.0.1: /src/tarballs/curl-8.0.1.tar.xz /usr/local/bin/curl: curl-8.0.1 /usr/local/lib/libbearssl.a @echo "Bootstrapping curl -> /src/logs/boot_curl.log" - (cd $< && ./configure --disable-docs --disable-manual --disable-shared --with-bearssl LD=cc && \ + (cd $< && ./configure --disable-docs --disable-manual --disable-shared --with-bearssl && \ $(MAKE) && $(MAKE) install) > /src/logs/boot_curl.log 2>&1 curl: /usr/local/bin/curl diff --git a/src/exec.c b/src/exec.c index e4722b77..6f4ee256 100644 --- a/src/exec.c +++ b/src/exec.c @@ -128,7 +128,7 @@ shellexec(char **argv, const char *path, int idx) toy_exec(argv); } - if (!strcmp(argv[0], "cc") || !strcmp(argv[0], "c99")) { + if (!strcmp(argv[0], "cc") || !strcmp(argv[0], "c99") || !strcmp(argv[0], "ld")) { exit(tcc_main(argc, argv)); } @@ -517,7 +517,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) goto success; } - if (toy_find(name) || !strcmp(name, "cc") || !strcmp(name, "c99") || !strcmp(name, "ar")) { + if (toy_find(name) || !strcmp(name, "cc") || !strcmp(name, "c99") || !strcmp(name, "ld") || !strcmp(name, "ar")) { entry->u.index = -1; entry->cmdtype = CMDNORMAL; return; diff --git a/src/main.c b/src/main.c index 4523f6cc..1d81aa51 100644 --- a/src/main.c +++ b/src/main.c @@ -112,6 +112,7 @@ main(int argc, char **argv) puts("ar"); puts("cc"); puts("c99"); + puts("ld"); for (int i = 0; i < NUMBUILTINS; i++) { if (builtincmd[i].flags == 0 || builtincmd[i].flags == BUILTIN_REGULAR) { puts(builtincmd[i].name); diff --git a/src/tcc.c b/src/tcc.c index b03adc17..dcd832dc 100644 --- a/src/tcc.c +++ b/src/tcc.c @@ -225,7 +225,7 @@ int tcc_main(int argc0, char **argv0) tcc_run = s->output_type == TCC_OUTPUT_MEMORY; if (n == 0) { - if (opt == OPT_V || opt == OPT_PRINT_DIRS) { + if (opt == OPT_V || opt == OPT_PRINT_DIRS || opt == OPT_HELP) { /* initialize search dirs */ set_environment(s); tcc_set_output_type(s, TCC_OUTPUT_MEMORY);