Backport #8009

`make MAINLIBS=-ltcmalloc` does not work with new versions of gcc

Added by Aman Gupta about 2 years ago. Updated almost 2 years ago.

[ruby-core:53121]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

Description

With newer versions of gcc, linker arguments must appear after object files.

diff --git a/Makefile.in b/Makefile.in
index 45eb7c6..a93a1e6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -194,12 +194,12 @@ all:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@

$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
$(Q) $(POSTLINK)

# We must `rm' the library each time this rule is invoked because "updating" a

Associated revisions

Revision 39578
Added by Nobuyoshi Nakada about 2 years ago

Makefile.in: move MAINLIBC after objects

  • Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments must appear after object files with newer versions of gcc. patch by tmm1 (Aman Gupta) in [Bug #8009]

Revision 40098
Added by Usaku NAKAMURA almost 2 years ago

merge revision(s) 39578: [Backport #8009]

* Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
  must appear after object files with newer versions of gcc.  patch by
  tmm1 (Aman Gupta) in  [Bug #8009]

History

#1 Updated by Nobuyoshi Nakada about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39578.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


Makefile.in: move MAINLIBC after objects

  • Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments must appear after object files with newer versions of gcc. patch by tmm1 (Aman Gupta) in [Bug #8009]

#2 Updated by Nobuyoshi Nakada about 2 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Category deleted (build)
  • Status changed from Closed to Assigned
  • Assignee changed from Nobuyoshi Nakada to Tomoyuki Chikanaga

#3 Updated by Tomoyuki Chikanaga about 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39911.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39578: [Backport #8009]

* Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
  must appear after object files with newer versions of gcc.  patch by
  tmm1 (Aman Gupta) in  [Bug #8009]

#4 Updated by Aman Gupta about 2 years ago

Thanks. Could you backport this to 1.9.3 as well?

#5 Updated by Usaku NAKAMURA almost 2 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to Usaku NAKAMURA

#6 Updated by Usaku NAKAMURA almost 2 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40098.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39578: [Backport #8009]

* Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
  must appear after object files with newer versions of gcc.  patch by
  tmm1 (Aman Gupta) in  [Bug #8009]

Also available in: Atom PDF