Skip to content

Commit

Permalink
Add ld alias
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar committed May 24, 2024
1 parent 50dd492 commit b5290c3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Makefile.packages
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/tcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b5290c3

Please sign in to comment.