[1/3] Fix RPM compilation

Message ID 1298979829-3027-2-git-send-email-alissy@mandriva.com
State New
Headers show

Commit Message

Alexandre Lissy March 1, 2011, 11:43 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(-)


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)))
@@ -5430,7 +5431,10 @@  melt_make_source_dir=$(srcdir)/melt
 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