[trafficserver] Add patch for gcc-4.7 build issues.

Jan-Frode Myklebust janfrode at fedoraproject.org
Wed Apr 11 10:14:06 UTC 2012


commit ee8cc9c8b8da0f8b65667513d75b75de05247e4b
Author: Jan-Frode Myklebust <janfrode at tanso.net>
Date:   Wed Apr 11 12:13:20 2012 +0200

    Add patch for gcc-4.7 build issues.

 trafficserver-gcc47.patch |  208 +++++++++++++++++++++++++++++++++++++++++++++
 trafficserver.spec        |    7 ++-
 2 files changed, 214 insertions(+), 1 deletions(-)
---
diff --git a/trafficserver-gcc47.patch b/trafficserver-gcc47.patch
new file mode 100644
index 0000000..343f1d0
--- /dev/null
+++ b/trafficserver-gcc47.patch
@@ -0,0 +1,208 @@
+diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
+index d57394b..af8f9dd 100644
+--- a/iocore/dns/DNS.cc
++++ b/iocore/dns/DNS.cc
+@@ -749,12 +749,15 @@ inline static DNSEntry *
+ get_dns(DNSHandler *h, uint16_t id)
+ {
+   for (DNSEntry *e = h->entries.head; e; e = (DNSEntry *) e->link.next) {
+-    if (e->once_written_flag)
+-      for (int j = 0; j < MAX_DNS_RETRIES; j++)
+-        if (e->id[j] == id)
++    if (e->once_written_flag) {
++      for (int j = 0; j < MAX_DNS_RETRIES; j++) {
++        if (e->id[j] == id) {
+           return e;
+-        else if (e->id[j] < 0)
++        } else if (e->id[j] < 0) {
+           goto Lnext;
++        }
++      }
++    }
+   Lnext:;
+   }
+   return NULL;
+diff --git a/lib/ts/MMH.h b/lib/ts/MMH.h
+index 130387d..c31ed89 100644
+--- a/lib/ts/MMH.h
++++ b/lib/ts/MMH.h
+@@ -92,7 +92,8 @@ struct MMH
+ 
+     for (i = 0, d = MMH_str, s = (char *) (&(b[0])); i < 8; i++, *d++ = *s++);
+     for (i = 0, s = (char *) (&(b[1])); i < 8; i++, *d++ = *s++);
+-      return (MMH_str);
++
++    return (MMH_str);
+   }
+   void encodeBuffer(unsigned char *buffer, int len)
+   {
+diff --git a/lib/ts/Map.h b/lib/ts/Map.h
+index a305f6a..81732df 100644
+--- a/lib/ts/Map.h
++++ b/lib/ts/Map.h
+@@ -237,7 +237,7 @@ template <class K, class C, class A = DefaultAlloc> class Env {
+ template <class K, class C, class A> inline C 
+ Map<K,C,A>::get(K akey) {
+   MapElem<K,C> e(akey, (C)0);
+-  MapElem<K,C> *x = set_in(e);
++  MapElem<K,C> *x = this->set_in(e);
+   if (x)
+     return x->value;
+   return (C)0;
+@@ -246,7 +246,7 @@ Map<K,C,A>::get(K akey) {
+ template <class K, class C, class A> inline C *
+ Map<K,C,A>::getp(K akey) {
+   MapElem<K,C> e(akey, (C)0);
+-  MapElem<K,C> *x = set_in(e);
++  MapElem<K,C> *x = this->set_in(e);
+   if (x)
+     return &x->value;
+   return 0;
+@@ -255,22 +255,22 @@ Map<K,C,A>::getp(K akey) {
+ template <class K, class C, class A> inline MapElem<K,C> *
+ Map<K,C,A>::put(K akey, C avalue) {
+   MapElem<K,C> e(akey, avalue);
+-  MapElem<K,C> *x = set_in(e);
++  MapElem<K,C> *x = this->set_in(e);
+   if (x) {
+     x->value = avalue;
+     return x;
+   } else
+-    return set_add(e);
++    return this->set_add(e);
+ }
+ 
+ template <class K, class C, class A> inline MapElem<K,C> *
+ Map<K,C,A>::put(K akey) {
+   MapElem<K,C> e(akey, 0);
+-  MapElem<K,C> *x = set_in(e);
++  MapElem<K,C> *x = this->set_in(e);
+   if (x)
+     return x;
+   else
+-    return set_add(e);
++    return this->set_add(e);
+ }
+ 
+ template <class K, class C, class A> inline void
+@@ -463,7 +463,7 @@ ChainHash<C, AHashFns, A>::put(C c) {
+   uintptr_t h = AHashFns::hash(c);
+   List<C,A> *l;
+   MapElem<uintptr_t,List<C,A> > e(h, (C)0);
+-  MapElem<uintptr_t,List<C,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<C,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else {
+@@ -482,7 +482,7 @@ ChainHash<C, AHashFns, A>::get(C c) {
+   uintptr_t h = AHashFns::hash(c);
+   List<C> empty;
+   MapElem<uintptr_t,List<C,A> > e(h, empty);
+-  MapElem<uintptr_t,List<C,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<C,A> > *x = this->set_in(e);
+   if (!x)
+     return 0;
+   List<C> *l = &x->value;
+@@ -497,7 +497,7 @@ ChainHash<C, AHashFns, A>::put_bag(C c) {
+   uintptr_t h = AHashFns::hash(c);
+   List<C, A> *l;
+   MapElem<uintptr_t,List<C,A> > e(h, (C)0);
+-  MapElem<uintptr_t,List<C,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<C,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else {
+@@ -513,7 +513,7 @@ ChainHash<C, AHashFns, A>::get_bag(C c, Vec<C> &v) {
+   uintptr_t h = AHashFns::hash(c);
+   List<C,A> empty;
+   MapElem<uintptr_t,List<C,A> > e(h, empty);
+-  MapElem<uintptr_t,List<C,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<C,A> > *x = this->set_in(e);
+   if (!x)
+     return 0;
+   List<C,A> *l = &x->value;
+@@ -537,7 +537,7 @@ ChainHash<C, AHashFns, A>::del(C c) {
+   uintptr_t h = AHashFns::hash(c);
+   List<C> *l;
+   MapElem<uintptr_t,List<C,A> > e(h, (C)0);
+-  MapElem<uintptr_t,List<C,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<C,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else
+@@ -564,7 +564,7 @@ ChainHashMap<K, AHashFns, C, A>::put(K akey, C avalue) {
+   List<MapElem<K,C>,A> *l;
+   MapElem<K, C> c(akey, avalue);
+   MapElem<uintptr_t,List<MapElem<K,C>,A> > e(h, empty);
+-  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else {
+@@ -585,7 +585,7 @@ ChainHashMap<K, AHashFns, C, A>::get(K akey) {
+   uintptr_t h = AHashFns::hash(akey);
+   List<MapElem<K,C>, A> empty;
+   MapElem<uintptr_t,List<MapElem<K,C>,A> > e(h, empty);
+-  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = this->set_in(e);
+   if (!x)
+     return 0;
+   List<MapElem<K,C>,A> *l = &x->value;
+@@ -603,7 +603,7 @@ ChainHashMap<K, AHashFns, C, A>::put_bag(K akey, C avalue) {
+   List<MapElem<K,C>,A> *l;
+   MapElem<K, C> c(akey, avalue);
+   MapElem<uintptr_t,List<MapElem<K,C>,A> > e(h, empty);
+-  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else {
+@@ -622,7 +622,7 @@ ChainHashMap<K, AHashFns, C, A>::get_bag(K akey, Vec<C> &v) {
+   uintptr_t h = AHashFns::hash(akey);
+   List<MapElem<K,C>,A> empty;
+   MapElem<uintptr_t,List<MapElem<K,C>,A> > e(h, empty);
+-  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = this->set_in(e);
+   if (!x)
+     return 0;
+   List<MapElem<K,C>,A> *l = &x->value;
+@@ -638,7 +638,7 @@ ChainHashMap<K, AHashFns, C, A>::del(K akey) {
+   List<MapElem<K,C>,A> empty;
+   List<MapElem<K,C>,A> *l;
+   MapElem<uintptr_t,List<MapElem<K,C>,A> > e(h, empty);
+-  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = set_in(e);
++  MapElem<uintptr_t,List<MapElem<K,C>,A> > *x = this->set_in(e);
+   if (x)
+     l = &x->value;
+   else
+@@ -687,7 +687,7 @@ StringChainHash<F,A>::canonicalize(cchar *s, cchar *e) {
+   else
+     while (*a) h = h * 27 + (unsigned char)*a++;  
+   MapElem<uintptr_t,List<cchar*, A> > me(h, (char*)0);
+-  MapElem<uintptr_t,List<cchar*, A> > *x = set_in(me);
++  MapElem<uintptr_t,List<cchar*, A> > *x = this->set_in(me);
+   if (x) {
+     List<cchar*, A> *l = &x->value;
+     typedef ConsCell<cchar *, A> TT;
+diff --git a/proxy/CoreUtils.cc b/proxy/CoreUtils.cc
+index e3d21d7..6d34520 100644
+--- a/proxy/CoreUtils.cc
++++ b/proxy/CoreUtils.cc
+@@ -344,7 +344,7 @@ CoreUtils::get_base_frame(intptr_t threadId, core_stack_state * coress)
+   intptr_t off2 = abs(vadd - framep);
+   intptr_t size = arrayMem[index - 1].fsize;
+ 
+-  memset(coress, 0, sizeof(coress));
++  memset(coress, 0, sizeof(*coress));
+ 
+   // seek to the framep offset
+   if (fseek(fp, off + off2, SEEK_SET) != -1) {
+@@ -456,7 +456,7 @@ CoreUtils::get_base_frame(intptr_t framep, core_stack_state *coress)
+   intptr_t size = arrayMem[index - 1].fsize;
+   intptr_t i = 0;
+ 
+-  memset(coress, 0, sizeof(coress));
++  memset(coress, 0, sizeof(*coress));
+   D(printf("stkbase=%p\n", (void*)(vadd + size)));
+   // seek to the framep offset
+   if (fseek(fp, off + off2, SEEK_SET) != -1) {
diff --git a/trafficserver.spec b/trafficserver.spec
index d2b0459..9f58992 100644
--- a/trafficserver.spec
+++ b/trafficserver.spec
@@ -3,7 +3,7 @@
 Summary:	Fast, scalable and extensible HTTP/1.1 compliant caching proxy server
 Name:		trafficserver
 Version:	3.0.4
-Release:	3%{?dist}
+Release:	4%{?dist}
 License:	ASL 2.0
 Group:		System Environment/Daemons
 Source0:	http://www.apache.org/dist/%{name}/%{name}-%{version}.tar.bz2
@@ -31,6 +31,7 @@ Patch2:		trafficserver-init_scripts.patch
 Patch7:		trafficserver_make_install.patch
 # Fixed on v3.1:
 Patch52:	trafficserver-condrestart.patch
+Patch53:	trafficserver-gcc47.patch
 
 
 %description
@@ -43,6 +44,7 @@ caching proxy server.
 %patch2 -p1 -b .patch2
 %patch7 -p1 -b .patch7
 %patch52 -p1 -b .patch52
+%patch53 -p1 -b .patch53
 
 %build
 ./configure --enable-layout=Gentoo --libdir=%{_libdir}/trafficserver --with-tcl=%{_libdir} --with-user=ats --with-group=ats
@@ -189,6 +191,9 @@ header files, and Apache httpd style module build system.
 %attr(0644,root,root) %{_libdir}/trafficserver/*.so
 
 %changelog
+* Wed Apr 11 2012 <janfrode at tanso.net> - 3.0.4-4
+- Add patch for gcc-4.7 build issues.
+
 * Mon Apr 9 2012 Dan HorĂ¡k <dan[at]danny.cz> - 3.0.4-3
 - switch to ExclusiveArch
 


More information about the scm-commits mailing list