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.
This commit is contained in:
Shiz 2015-08-01 00:09:40 +02:00 committed by sin
parent 625f421f5a
commit 8d1ae98163

View File

@ -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 $<