X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2FMakefile.lib;h=be679b6241e53f3db234159bd4829d6fb68cbc9f;hb=7dd0ce49531b6340950b4a3eedbef1c958a475d9;hp=e1e0ba481a06f9db817519d902aa2d68980b8259;hpb=f7996f3b700a22797565e9aa57e251e6e3ac1e4d;p=oweals%2Fbusybox.git diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e1e0ba481..be679b624 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -117,7 +117,12 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) -ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) +# Seems to be a wrong thing to do. LDFLAGS contains gcc's flags, +# yet ld_flags is fed to ld. +#ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) +# Remove the -Wl, prefix from linker options normally passed through gcc +ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) + # Finds the multi-part object the current object will be linked into modname-multi = $(sort $(foreach m,$(multi-used),\ @@ -146,6 +151,8 @@ $(obj)/%:: $(src)/%_shipped # Linking # --------------------------------------------------------------------------- +# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's. +# but here we feed them to ld! quiet_cmd_ld = LD $@ cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@