- 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
This commit is contained in:
Ingvar Hagelund 2008-09-08 22:28:30 +00:00
parent 971f3de43e
commit d728b8b77d
2 changed files with 108 additions and 1 deletions

View File

@ -0,0 +1,85 @@
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);
+}
+

View File

@ -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 @@ Patch0: varnish.lockfile.patch
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 @@ Varnish is a high-performance HTTP accelerator
%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 @@ fi
%postun libs -p /sbin/ldconfig
%changelog
* Tue Sep 09 2008 Ingvar Hagelund <ingvar@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@linpro.no> - 2.0-0.7.beta1
- Added a patch from r3156 and r3157, hiding a legit errno in make check