commit 8d1ae98163e2e7b30c5d56de1cb8ea4082db1fbe
parent 625f421f5ac1429991e7d2e028a7a97cbe14237c
Author: Shiz <hi@shiz.me>
Date: Sat, 1 Aug 2015 00:09:40 +0200
Call C compiler for linking
Using $(LD) directly for linking can cause issues with cross-compilers
and various other toolchains, as various libraries such as libc may not
be implicitly linked in, causing symbol resolution errors.
Linking through the C compiler frontend solves this issue.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -168,7 +168,7 @@ $(BIN): $(LIB) $(@:=.o)
$(OBJ): $(HDR) config.mk
.o:
- $(LD) $(LDFLAGS) -o $@ $< $(LIB)
+ $(CC) $(LDFLAGS) -o $@ $< $(LIB)
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<