From 8d1ae98163e2e7b30c5d56de1cb8ea4082db1fbe Mon Sep 17 00:00:00 2001 From: Shiz Date: Sat, 1 Aug 2015 00:09:40 +0200 Subject: [PATCH] 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. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aa129a8..7194ade 100644 --- 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 $<