[pypy-commit] pypy default: Don't put the "-g" option in the "gcc" invocation if we invoke it on a

arigo noreply at buildbot.pypy.org
Wed Jun 10 12:06:46 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r78010:61996ba39135
Date: 2015-06-10 12:06 +0200
http://bitbucket.org/pypy/pypy/changeset/61996ba39135/

Log:	Don't put the "-g" option in the "gcc" invocation if we invoke it on
	a ".s" file. It seems that gcc propagates it to "as" in this case,
	but not in case were it is originally called on a ".c" file.

diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -443,6 +443,12 @@
             mk.definition('OBJECTS1', '$(subst .asmgcc.s,.o,$(subst .c,.o,$(SOURCES)))')
             mk.definition('OBJECTS', '$(OBJECTS1) gcmaptable.s')
 
+            # the CFLAGS passed to gcc when invoked to assembler the .s file
+            # must not contain -g.  This confuses gcc 5.1.  (arigo) I failed
+            # to get any debugging symbols with gcc 5.1 and an older gdb
+            # 7.4.1-debian; I don't understand why at all because it works
+            # fine in manual examples.
+            mk.definition('CFLAGS_AS', '$(patsubst -g,,$(CFLAGS))')
 
             # the rule that transforms %.c into %.o, by compiling it to
             # %.s, then applying trackgcroot to get %.lbl.s and %.gcmap, and
@@ -452,7 +458,7 @@
                     '-o $*.s -S $< $(INCLUDEDIRS)',
                 '$(PYTHON) $(RPYDIR)/translator/c/gcc/trackgcroot.py '
                     '-t $*.s > $*.gctmp',
-                '$(CC) $(CFLAGS) -o $*.o -c $*.lbl.s',
+                '$(CC) $(CFLAGS_AS) -o $*.o -c $*.lbl.s',
                 'mv $*.gctmp $*.gcmap',
                 'rm $*.s $*.lbl.s'])
 


More information about the pypy-commit mailing list