Forum: Ruby-core [ruby-trunk - Bug #8009][Open] `make MAINLIBS=-ltcmalloc` does not work with new versions of gcc

Posted by tmm1 (Aman Gupta) (Guest)
on 2013-03-04 05:17
(Received via mailing list)
Issue #8009 has been reported by tmm1 (Aman Gupta).

----------------------------------------
Bug #8009: `make MAINLIBS=-ltcmalloc` does not work with new versions of 
gcc
https://bugs.ruby-lang.org/issues/8009

Author: tmm1 (Aman Gupta)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: build
Target version:
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474)


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
Posted by tmm1 (Aman Gupta) (Guest)
on 2013-03-24 23:50
(Received via mailing list)
Issue #8009 has been updated by tmm1 (Aman Gupta).


Thanks. Could you backport this to 1.9.3 as well?
----------------------------------------
Backport #8009: `make MAINLIBS=-ltcmalloc` does not work with new 
versions of gcc
https://bugs.ruby-lang.org/issues/8009#change-37909

Author: tmm1 (Aman Gupta)
Status: Closed
Priority: Normal
Assignee: nagachika (Tomoyuki Chikanaga)
Category:
Target version:


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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.