[icecat] Added -Wformat-security flags.

Antonio Trande sagitter at fedoraproject.org
Thu Oct 23 16:27:00 UTC 2014


commit 0ede272de575000a22de7cfb6200cffa2ef1ab98
Author: sagitter <anto.trande at gmail.com>
Date:   Thu Oct 23 18:26:53 2014 +0200

    Added -Wformat-security flags.

 icecat-mozconfig-common             |    1 -
 icecat-no-fexception-excluded.patch |   16 +++++++++++++
 icecat.spec                         |   43 ++++++++++++++++++++++------------
 3 files changed, 44 insertions(+), 16 deletions(-)
---
diff --git a/icecat-mozconfig-common b/icecat-mozconfig-common
index fce6a8c..c3cf56f 100644
--- a/icecat-mozconfig-common
+++ b/icecat-mozconfig-common
@@ -26,7 +26,6 @@ ac_add_options --disable-ipdl-tests
 ac_add_options --disable-accessibility
 ac_add_options --disable-crashreporter
 ac_add_options --disable-debug
-ac_add_options --enable-elf-hack
 ac_add_options --disable-official-branding
 ac_add_options --enable-system-cairo 
 ac_add_options --disable-tests
diff --git a/icecat-no-fexception-excluded.patch b/icecat-no-fexception-excluded.patch
new file mode 100644
index 0000000..40c15e8
--- /dev/null
+++ b/icecat-no-fexception-excluded.patch
@@ -0,0 +1,16 @@
+--- config/gcc-stl-wrapper.template.orig.h	2014-10-21 13:49:22.000000000 +0200
++++ config/gcc-stl-wrapper.template.h	2014-10-23 14:51:46.078309814 +0200
+@@ -10,9 +10,9 @@
+ 
+ // For some reason, Apple's GCC refuses to honor -fno-exceptions when
+ // compiling ObjC.
+-#if __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
+-#  error "STL code can only be used with -fno-exceptions"
+-#endif
++//#if __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
++//#  error "STL code can only be used with -fno-exceptions"
++//#endif
+ 
+ // Silence "warning: #include_next is a GCC extension"
+ #pragma GCC system_header
+
diff --git a/icecat.spec b/icecat.spec
index 10969ff..4040634 100644
--- a/icecat.spec
+++ b/icecat.spec
@@ -11,7 +11,7 @@
 
 Name:    icecat
 Version: 31.2.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: GNU version of Firefox browser
 Group:   Applications/Internet
 
@@ -47,6 +47,8 @@ Patch2: %{name}-noHTTP-RP.patch
 ##Bug https://bugzilla.mozilla.org/show_bug.cgi?id=999496
 Patch4: %{name}-AudioQueueMemoryFunctor_for_GCC49.patch
 
+Patch5: %{name}-no-fexception-excluded.patch
+
 BuildRequires:  alsa-lib-devel
 BuildRequires:  bzip2-devel
 BuildRequires:  cairo-devel
@@ -171,6 +173,8 @@ tar -xf %{SOURCE5}
 %patch4 -p0
 %endif
 
+%patch5 -p0
+
 ##Remove default configuration and copy the customized one
 cp -p %{SOURCE3} mozconfig-common
 
@@ -207,22 +211,27 @@ echo "ac_add_options --disable-tracejit" >> mozconfig-common
 echo "ac_add_options --enable-png-arm-neon-support=check" >> mozconfig-common
 %endif
 
-
 %build
 ##
-MOZ_OPT_CXXFLAGS=$(echo "$RPM_OPT_FLAGS" | sed -e 's/-Wall//')
-MOZ_OPT_CFLAGS="$RPM_OPT_FLAGS"
-
-#rhbz#1037063
-# -Werror=format-security causes build failures when -Wno-format is explicitly given
-# for some sources
-
-%ifarch %{arm} aarch64
-MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
+# Mozilla builds with -Wall with exception of a few warnings which show up
+# everywhere in the code; so, don't override that.
+#
+# Disable C++ exceptions since Mozilla code is not exception-safe
+#
+%ifnarch %{arm}
+MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | sed -e 's/-Wall//')
+
+##https://bugzilla.redhat.com/show_bug.cgi?id=1037063
+MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
+
+export CFLAGS=$MOZ_OPT_FLAGS
+export CXXFLAGS=$MOZ_OPT_FLAGS
 %endif
-export CFLAGS="$MOZ_OPT_CFLAGS -Wformat-security -Wformat -Werror=format-security"
-export CXXFLAGS="$MOZ_OPT_CXXFLAGS -Wformat-security -Wformat -Werror=format-security"
-export LDFLAGS=$MOZ_LINK_FLAGS
+
+#%ifarch s390 %{arm} ppc aarch64
+#MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
+#export LDFLAGS=$MOZ_LINK_FLAGS
+#%endif
 
 mkdir -p %{name}-objdir && cd %{name}-objdir
 ../configure --prefix=%{_prefix} \
@@ -230,7 +239,7 @@ mkdir -p %{name}-objdir && cd %{name}-objdir
  --includedir=%{_includedir} \
  --datadir=%{_datadir} \
  --mandir=%{_mandir} \
- --enable-optimize="-fPIC"\
+ --enable-optimize="$MOZ_OPT_FLAGS -fPIC"\
  --with-system-nspr \
  --with-system-nss \
  --with-system-nspr-prefix=%{_bindir} \
@@ -355,6 +364,10 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/%{icecat_ver}.desk
 %{_includedir}/%{icecat_ver}/
 
 %changelog
+* Wed Oct 22 2014 Antonio Trande <sagitterATfedoraproject.org> - 31.2.0-3
+- Added -Wformat-security flags
+- Added special link flags for ARM
+
 * Wed Oct 22 2014 Antonio Trande <sagitterATfedoraproject.org> - 31.2.0-2
 - Fixed compiler flags
 


More information about the scm-commits mailing list