Workaround for sbuf initialization sequence issue upsetting GCC

This commit is contained in:
Henrik Nordstrom 2015-03-16 09:07:24 +01:00
parent 74e32a93f5
commit 552b3cdd99
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,47 @@
diff -up squid-3.5.2/src/SBufStatsAction.cc.sbufstats squid-3.5.2/src/SBufStatsAction.cc
--- squid-3.5.2/src/SBufStatsAction.cc.sbufstats 2015-03-15 13:48:36.479197186 +0100
+++ squid-3.5.2/src/SBufStatsAction.cc 2015-03-15 13:49:19.559676380 +0100
@@ -82,7 +82,8 @@ SBufStatsAction::unpack(const Ipc::Typed
msg.getPod(mbdata);
}
-static const bool Registered = (Mgr::RegisterAction("sbuf",
- "String-Buffer statistics", &SBufStatsAction::Create, 0 , 1),
- true);
-
+void
+SBufStatsAction::RegisterWithCacheManager()
+{
+ Mgr::RegisterAction("sbuf", "String-Buffer statistics", &SBufStatsAction::Create, 0 , 1);
+}
diff -up squid-3.5.2/src/SBufStatsAction.h.sbufstats squid-3.5.2/src/SBufStatsAction.h
--- squid-3.5.2/src/SBufStatsAction.h.sbufstats 2015-02-18 13:17:02.000000000 +0100
+++ squid-3.5.2/src/SBufStatsAction.h 2015-03-15 13:48:36.479197186 +0100
@@ -21,6 +21,7 @@ class SBufStatsAction: public Mgr::Actio
public:
/// Mgr::ClassActionCreationHandler for Mgr::RegisterAction()
static Pointer Create(const Mgr::CommandPointer &cmd);
+ static void RegisterWithCacheManager(void);
protected:
explicit SBufStatsAction(const Mgr::CommandPointer &cmd);
diff -up squid-3.5.2/src/main.cc.sbufstats squid-3.5.2/src/main.cc
--- squid-3.5.2/src/main.cc.sbufstats 2015-02-18 13:17:02.000000000 +0100
+++ squid-3.5.2/src/main.cc 2015-03-15 13:48:36.479197186 +0100
@@ -59,6 +59,7 @@
#include "profiler/Profiler.h"
#include "redirect.h"
#include "refresh.h"
+#include "SBufStatsAction.h"
#include "send-announce.h"
#include "SquidConfig.h"
#include "SquidDns.h"
@@ -1089,6 +1090,8 @@ mainInitialize(void)
/* register the modules in the cache manager menus */
cbdataRegisterWithCacheManager();
+ SBufStatsAction::RegisterWithCacheManager();
+
/* These use separate calls so that the comm loops can eventually
* coexist.
*/

View File

@ -33,6 +33,7 @@ Patch203: squid-3.0.STABLE1-perlpath.patch
Patch204: squid-3.2.0.9-fpic.patch
Patch205: squid-3.1.9-ltdl.patch
Patch206: active-ftp.patch
Patch207: squid-3.5.2-sbufstats.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: bash >= 2.0
@ -96,6 +97,7 @@ lookup program (dnsserver), a program for retrieving FTP data
#%patch205 -p1 -b .ltdl
# Fails on 3.5.1
#%patch206 -p1 -b .active-ftp
%patch207 -p1 -b .sbufstats
%build
%ifarch sparcv9 sparc64 s390 s390x
@ -216,7 +218,8 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING COPYRIGHT README ChangeLog QUICKSTART src/squid.conf.documented
%license COPYING
%doc CONTRIBUTORS README ChangeLog QUICKSTART src/squid.conf.documented
%doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl
%{_unitdir}/squid.service