Skip to content

Commit

Permalink
kbuild: change ld_flags to contain LDFLAGS_$(@f)
Browse files Browse the repository at this point in the history
Put $(LDFLAGS_$(@f)) into ld_flags so that $(LDFLAGS_pcap.o) and
$(LDFLAGS_vde.o) in arch/um/drivers/Makefile are absorbed.

Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
  • Loading branch information
masahir0y committed Jul 18, 2018
1 parent f60b992 commit 2fb9279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/um/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a)
targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o

$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
$(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
$(LD) -r -dp -o $@ $^ $(ld_flags)

$(obj)/vde.o: $(obj)/vde_kern.o $(obj)/vde_user.o
$(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_vde.o)
$(LD) -r -dp -o $@ $^ $(ld_flags)

#XXX: The call below does not work because the flags are added before the
# object name, so nothing from the library gets linked.
Expand Down
4 changes: 2 additions & 2 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
$(__cpp_flags)

ld_flags = $(LDFLAGS) $(ldflags-y)
ld_flags = $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))

DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes

Expand Down Expand Up @@ -225,7 +225,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------

quiet_cmd_ld = LD $@
cmd_ld = $(LD) $(ld_flags) $(LDFLAGS_$(@F)) $(filter-out FORCE,$^) -o $@
cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@

# Objcopy
# ---------------------------------------------------------------------------
Expand Down

0 comments on commit 2fb9279

Please sign in to comment.