rpms/varnish/devel varnish.endianfix.cs3170-3071.patch, NONE, 1.1 varnish.spec, 1.11, 1.12

Ingvar Hagelund ingvar at fedoraproject.org
Mon Sep 8 22:29:00 UTC 2008


Author: ingvar

Update of /cvs/pkgs/rpms/varnish/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18305

Modified Files:
	varnish.spec 
Added Files:
	varnish.endianfix.cs3170-3071.patch 
Log Message:
- Added a patch from r3171 that fixes an endian bug on ppc and ppc64
- Added a hack that changes the varnishtest ports for 64bits builds,
  so they can run in parallell with 32bits build on same build host



varnish.endianfix.cs3170-3071.patch:

--- NEW FILE varnish.endianfix.cs3170-3071.patch ---
Index: include/vrt.h
===================================================================
--- include/vrt.h	(revisjon 3169)
+++ include/vrt.h	(revisjon 3171)
@@ -154,6 +154,7 @@
 
 /* Simple stuff */
 int VRT_strcmp(const char *s1, const char *s2);
+void VRT_memmove(void *dst, const void *src, unsigned len);
 
 void VRT_ESI(struct sess *sp);
 void VRT_Rollback(struct sess *sp);
Index: lib/libvcl/vcc_fixed_token.c
===================================================================
--- lib/libvcl/vcc_fixed_token.c	(revisjon 3169)
+++ lib/libvcl/vcc_fixed_token.c	(revisjon 3171)
@@ -434,6 +434,7 @@
 	vsb_cat(sb, "\n");
 	vsb_cat(sb, "/* Simple stuff */\n");
 	vsb_cat(sb, "int VRT_strcmp(const char *s1, const char *s2);\n");
+	vsb_cat(sb, "void VRT_memmove(void *dst, const void *src, unsigned len);\n");
 	vsb_cat(sb, "\n");
 	vsb_cat(sb, "void VRT_ESI(struct sess *sp);\n");
 	vsb_cat(sb, "void VRT_Rollback(struct sess *sp);\n");
Index: lib/libvcl/vcc_acl.c
===================================================================
--- lib/libvcl/vcc_acl.c	(revisjon 3169)
+++ lib/libvcl/vcc_acl.c	(revisjon 3171)
@@ -328,23 +328,37 @@
 	int depth, l, m, i;
 	unsigned at[VRT_ACL_MAXADDR + 1];
 	const char *oc;
+	struct sockaddr sa;
 
 	Fh(tl, 0, "\nstatic int\n");
 	Fh(tl, 0, "match_acl_%s_%s(const struct sess *sp, const void *p)\n",
 	    pfx, acln);
 	Fh(tl, 0, "{\n");
-	Fh(tl, 0, "\tunsigned fam;\n");
 	Fh(tl, 0, "\tconst unsigned char *a;\n");
+	assert(sizeof (unsigned char) == 1);
+	assert(sizeof (unsigned short) == 2);
+	assert(sizeof (unsigned int) == 4);
+	if (sizeof sa.sa_family == 1)
+		Fh(tl, 0, "\tunsigned char fam;\n");
+	else if (sizeof sa.sa_family == 2)
+		Fh(tl, 0, "\tunsigned short fam;\n");
+	else if (sizeof sa.sa_family == 4)
+		Fh(tl, 0, "\tunsigned int fam;\n");
+	else
+		assert(0 == __LINE__);
+		
 	Fh(tl, 0, "\n");
 	Fh(tl, 0, "\ta = p;\n");
-	Fh(tl, 0, "\tfam = a[%d];\n", offsetof(struct sockaddr, sa_family));
+	Fh(tl, 0, "\tVRT_memmove(&fam, a + %d, sizeof fam);\n",
+	    offsetof(struct sockaddr, sa_family));
 	Fh(tl, 0, "\tif (fam == %d)\n", PF_INET);
 	Fh(tl, 0, "\t\ta += %d;\n", offsetof(struct sockaddr_in, sin_addr));
 	Fh(tl, 0, "\telse if (fam == %d)\n", PF_INET6);
 	Fh(tl, 0, "\t\ta += %d;\n", offsetof(struct sockaddr_in6, sin6_addr));
-	Fh(tl, 0, "\telse\n");
+	Fh(tl, 0, "\telse {\n");
+	Fh(tl, 0, "\t\tVRT_acl_log(sp, \"NO_FAM %s\");\n", acln);
 	Fh(tl, 0, "\t\treturn(0);\n");
-	Fh(tl, 0, "\n");
+	Fh(tl, 0, "\t}\n\n");
 	depth = -1;
 	oc = 0;
 	at[0] = 256;
Index: bin/varnishd/cache_vrt.c
===================================================================
--- bin/varnishd/cache_vrt.c	(revisjon 3169)
+++ bin/varnishd/cache_vrt.c	(revisjon 3171)
@@ -726,3 +726,10 @@
 	return (strcmp(s1, s2));
 }
 
+void
+VRT_memmove(void *dst, const void *src, unsigned len)
+{
+
+	(void)memmove(dst, src, len);
+}
+


Index: varnish.spec
===================================================================
RCS file: /cvs/pkgs/rpms/varnish/devel/varnish.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- varnish.spec	2 Sep 2008 20:37:08 -0000	1.11
+++ varnish.spec	8 Sep 2008 22:28:30 -0000	1.12
@@ -1,7 +1,7 @@
 Summary: Varnish is a high-performance HTTP accelerator
 Name: varnish
 Version: 2.0
-Release: 0.7.beta1%{?dist}
+Release: 0.8.beta1%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.varnish-cache.org/
@@ -12,6 +12,7 @@
 Patch1: varnish.coresize.patch
 Patch2: varnish.vcl_changes.patch
 Patch3: varnish.cs3157.patch
+Patch4: varnish.endianfix.cs3170-3071.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 # The svn sources needs autoconf, automake and libtool to generate a suitable
 # configure script. Release tarballs would not need this
@@ -73,11 +74,27 @@
 %patch1 -p0
 %patch2 -p0
 %patch3 -p0
+%patch4 -p0
 
 # The svn sources needs to generate a suitable configure script
 # Release tarballs would not need this
 # ./autogen.sh
 
+# Hack to get 32- and 64-bits tests run concurrently on the same build machine
+case `uname -m` in
+	ppc64 | s390x | x86_64 | sparc64 )
+		sed -i ' 
+			s,9001,9011,g;
+			s,9080,9090,g; 
+			s,9081,9091,g; 
+			s,9082,9092,g; 
+			s,9180,9190,g;
+		' bin/varnishtest/*.c bin/varnishtest/tests/*vtc
+		;;
+	*)
+		;;
+esac
+
 mkdir examples
 cp bin/varnishd/default.vcl etc/zope-plone.vcl examples
 
@@ -210,6 +227,11 @@
 %postun libs -p /sbin/ldconfig
 
 %changelog
+* Tue Sep 09 2008 Ingvar Hagelund <ingvar at linpro.no> - 2.0-0.8.beta1
+- Added a patch from r3171 that fixes an endian bug on ppc and ppc64
+- Added a hack that changes the varnishtest ports for 64bits builds,
+  so they can run in parallell with 32bits build on same build host
+
 * Tue Sep 02 2008 Ingvar Hagelund <ingvar at linpro.no> - 2.0-0.7.beta1
 - Added a patch from r3156 and r3157, hiding a legit errno in make check
 




More information about the fedora-extras-commits mailing list