Makefile.in: Pass libraries after source files in compiler invocation (#3272)

When building with gdc alongside the linker flag -Wl,--as-needed the
build fails with unresolved symbol errors. dmd and ldc2 are not
affected since they internally pass the generated object file before
other linker flags.

This also matches the standard GNU make rules.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
This commit is contained in:
Andrei Horodniceanu 2025-05-12 23:53:52 +03:00 committed by GitHub
commit 71bfab619e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,7 @@ onedrive: $(SOURCES)
else \
echo $(version) > version ; \
fi
$(DC) -J. $(NOTIF_VERSIONS) $(DCFLAGS) $(addprefix $(LINKER_DCFLAG),$(all_libs)) $^ $(OUTPUT_DCFLAG)$@
$(DC) -J. $(NOTIF_VERSIONS) $(DCFLAGS) $^ $(addprefix $(LINKER_DCFLAG),$(all_libs)) $(OUTPUT_DCFLAG)$@
install: all
mkdir -p $(DESTDIR)$(bindir)