From 51ce75b5b02a7617bfee5272d9236835be48d02d Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 13 Oct 2007 14:50:43 +0000 Subject: - use the compiler-driver instead of the linker - adjust setting flags accordingly to use (hardcoded, see below) -Wl, Potential improvements: *) --warn-unresolved-symbols should perhaps be used for all libs *) eventually rename LDFLAGS to CC_LDFLAGS *) probe for compiler driver's notion of flag to use for passing in linker flags (i.e. don't hardcode "-Wl,") --- Makerules | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index b4df69bb6..aec7238a0 100644 --- a/Makerules +++ b/Makerules @@ -126,9 +126,9 @@ define link.so $(Q)$(INSTALL) -d $(dir $@) $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1) @$(disp_ld) - $(Q)$(LD) $(LDFLAGS-$(notdir $@)) -soname=$(notdir $@).$(2) \ - -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ - --whole-archive $(firstword $^) --no-whole-archive \ + $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \ + -nostdlib -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ + -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@)) $(Q)$(LN) -sf $(1) $@.$(2) $(Q)$(LN) -sf $(1) $@ @@ -150,10 +150,10 @@ define link-flat.so $(Q)$(INSTALL) -d $(dir $@) $(Q)$(RM) $(1) $@ @$(disp_ld) - $(Q)$(LD) $(LDFLAGS-$(notdir $@)) -o $(1) \ - -elf2flt -shared-lib-id $(2) $(top_builddir)lib/Scrt1.o \ - $(top_builddir)/lib/crti.o --whole-archive $(firstword $^) \ - --no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \ + $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -nostdlib -o $(1) \ + -Wl,-elf2flt -Wl,-shared-lib-id $(2) $(top_builddir)lib/Scrt1.o \ + $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \ + -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \ $(top_builddir)/lib/crtn.o endef @@ -161,8 +161,8 @@ define linkm.so $(Q)$(INSTALL) -d $(dir $@) $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1) @$(disp_ld) - $(Q)$(LD) $(LDFLAGS-$(notdir $@)) -soname=$(notdir $@).$(2) \ - -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) $^ \ + $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \ + -nostdlib -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) $^ \ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@)) $(Q)$(LN) -sf $(1) $@.$(2) $(Q)$(LN) -sf $(1) $@ -- cgit v1.2.3