scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit e6433e30e428dbc29ea26915a3a4c8c08b715909
parent 634a0fbd73e12447ac3eca55b3fb8aaf956de255
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun,  6 Oct 2019 14:24:32 +0200

[scc] Add libcrt to the command line

Libcrt contains symbols that are needed by the other objects,
so it must go at the end of the command line.

Diffstat:
Msrc/cmd/cc/posix/scc.c | 11+----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/cmd/cc/posix/scc.c b/src/cmd/cc/posix/scc.c @@ -152,16 +152,6 @@ inittool(int tool) addarg(tool, syscrts[n]); break; } - n = snprintf(NULL, 0, - "%s/lib/scc/%s-%s-%s/crt.o", - prefix, arch, abi, sys); - if (n < 0) - die("scc: wrong crt file name"); - crt = xmalloc(++n); - sprintf(crt, - "%s/lib/scc/%s-%s-%s/crt.o", - prefix, arch, abi, sys); - addarg(tool, crt); break; case AS: addarg(tool, "-o"); @@ -613,6 +603,7 @@ operand: if (link && !failure) { addarg(LD, xstrdup("-lc")); + addarg(LD, xstrdup("-lcrt")); spawn(settool(LD, NULL, LAST_TOOL)); validatetools(); }