Patchwork [1/4] Fix RPM compilation

login
register
mail settings
Submitter Alexandre Lissy
Date March 7, 2011, 11:35 a.m.
Message ID <1299497724-3972-2-git-send-email-alissy@mandriva.com>
Download mbox | patch
Permalink /patch/85729/
State New
Headers show

Comments

Alexandre Lissy - March 7, 2011, 11:35 a.m.
The GCC's options -pipe and -Wp,-D_FORTIFY_SOURCE=2 are passed by
default by Mandriva's GCC RPM spec file, and end up in some parts of
MELT CFLAGS. But they should not end up there.
---
 gcc/Makefile.in |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3f1ffa0..f841776 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -5341,6 +5341,7 @@  MELT_RAW_CFLAGS= \
 ## since the generated routines are no more huge (since the
 ## initialization code is split in several chunks).. Likewise, avoid
 ## passing -gtoggle and -g
+## Also remove -pipe and -Wp,-D_FORTIFY_SOURCE=2
 MELTHERE_CFLAGS= $(filter-out -g, $(filter-out -gtoggle, $(MELT_RAW_CFLAGS)))
 export MELTHERE_CFLAGS
 
@@ -5430,7 +5431,10 @@  melt_make_source_dir=$(srcdir)/melt
 melt_make_module_dir=$(objdir)
 melt_make_move=$(SHELL) $(srcdir)/../move-if-change
 ## Don't use := definitions here!
-melt_make_cc1flags= -I. $(MELTHERE_CFLAGS) -I $(melt_build_include_dir)
+## CC1 forbids -pipe and -Wp,-D_FORTIFY_SOURCE=2
+comma= ,
+MELTHERE_CC1_CFLAGS=$(filter-out -pipe -Wp$(comma)-D_FORTIFY_SOURCE=2, $(MELTHERE_CFLAGS))
+melt_make_cc1flags= -I. $(MELTHERE_CC1_CFLAGS) -I $(melt_build_include_dir)
 melt_cflags=  -I. $(MELTHERE_CFLAGS) -I $(melt_build_include_dir)
 export melt_cflags
 ## extra cflags are for compiling applicative MELT files, e.g. xtramelt*.c