Add -pie patch to make compiling on ia64 work.

This commit is contained in:
fenlason 2005-10-19 03:35:45 +00:00
parent 6ce11a1cd9
commit 3ef1d00c11
2 changed files with 161 additions and 10 deletions

154
quagga-0.98.5-pie.patch Normal file
View File

@ -0,0 +1,154 @@
--- quagga-0.98.5/ltmain.sh.pie 2005-10-18 23:03:50.000000000 -0400
+++ quagga-0.98.5/ltmain.sh 2005-10-18 23:04:05.000000000 -0400
@@ -723,7 +723,7 @@
command="$base_compile $srcfile $pic_flag"
else
# Don't build PIC code
- command="$base_compile $srcfile"
+ command="$base_compile $srcfile -fPIC"
fi
if test ! -d "${xdir}$objdir"; then
@@ -803,7 +803,7 @@
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
- command="$base_compile $srcfile"
+ command="$base_compile $srcfile -fPIC"
else
command="$base_compile $srcfile $pic_flag"
fi
--- quagga-0.98.5/makefiles.diff.pie 2005-10-18 23:07:44.000000000 -0400
+++ quagga-0.98.5/makefiles.diff 2005-10-18 23:05:17.000000000 -0400
@@ -0,0 +1,131 @@
+--- quagga-0.98.5/bgpd/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/bgpd/Makefile 2005-10-18 22:43:31.000000000 -0400
+@@ -86,7 +86,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/isisd/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/isisd/Makefile 2005-10-18 22:43:38.000000000 -0400
+@@ -84,7 +84,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/lib/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/lib/Makefile 2005-10-18 22:43:43.000000000 -0400
+@@ -70,7 +70,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/ospf6d/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/ospf6d/Makefile 2005-10-18 22:43:49.000000000 -0400
+@@ -84,7 +84,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/ospfclient/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/ospfclient/Makefile 2005-10-18 22:43:54.000000000 -0400
+@@ -75,7 +75,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/ospfd/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/ospfd/Makefile 2005-10-18 22:43:58.000000000 -0400
+@@ -82,7 +82,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/ripd/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/ripd/Makefile 2005-10-18 22:44:05.000000000 -0400
+@@ -74,7 +74,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/ripngd/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/ripngd/Makefile 2005-10-18 22:44:09.000000000 -0400
+@@ -78,7 +78,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/tests/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/tests/Makefile 2005-10-18 22:44:24.000000000 -0400
+@@ -57,7 +57,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/vtysh/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/vtysh/Makefile 2005-10-18 22:44:31.000000000 -0400
+@@ -65,7 +65,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/watchquagga/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/watchquagga/Makefile 2005-10-18 22:44:36.000000000 -0400
+@@ -59,7 +59,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+--- quagga-0.98.5/zebra/Makefile.pie 2005-10-18 22:43:11.000000000 -0400
++++ quagga-0.98.5/zebra/Makefile 2005-10-18 22:44:40.000000000 -0400
+@@ -71,7 +71,7 @@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIE
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \

View File

@ -42,6 +42,7 @@ Patch1: quagga-0.96.3-netlink.patch
Patch2: quagga-0.96.5-nostart.patch
Patch4: quagga-0.98.2-gcc4.patch
Patch5: quagga-0.98.5-pam.patch
Patch6: quagga-0.98.5-pie.patch
URL: http://www.quagga.net
%if %with_snmp
@ -98,18 +99,15 @@ developing OSPF-API and quagga applications.
%patch2 -p1 -b .nostart
%patch4 -p1 -b .gcc4
%patch5 -p1 -b .pam
# This creates a .diff file that we apply after configuring
%patch6 -p1
%build
%ifarch s390 s390x x86_64
export PIECFLAGS="-fPIE"
%else
export PIECFLAGS="-fpie"
%endif
# FC5+ automatic -fstack-protector-all switch
export RPM_OPT_FLAGS=${RPM_OPT_FLAGS//-fstack-protector/-fstack-protector-all}
#./autogen.sh
export CFLAGS="$RPM_OPT_FLAGS $PIECFLAGS $CPPFLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS $PIECFLAGS $CPPFLAGS"
export CFLAGS="$RPM_OPT_FLAGS $CPPFLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS $CPPFLAGS"
export LDFLAGS="-pie"
%configure \
@ -162,6 +160,7 @@ export LDFLAGS="-pie"
%endif
--enable-netlink
patch -p1 < makefiles.diff
make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
pushd doc
@ -347,9 +346,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Oct 17 2005 Jay Fenlason <fenlason@redhat.com> 0.98.5-3
- Modify the way CFLAGS is set and passed to configure and make, so
we use RPMs default cflags, with -pie/-fpie added. This gets us
-D_FORTIFY_SOURCE, etc, which is good for critical daemons.
- add the -pie patch, to make -fPIE compiling actually work on all platforms.
- Include -pam patch to close
bz#170256 ? pam_stack is deprecated
- Change ucd-snmp to net-snmp to close