znc: link to libstdc++ to fix performance issues on channel join
authorJonas Gorski <jogo@openwrt.org>
Fri, 21 Nov 2014 12:19:30 +0000 (13:19 +0100)
committerJonas Gorski <jogo@openwrt.org>
Fri, 21 Nov 2014 12:30:07 +0000 (13:30 +0100)
ZNC uses a map to cache channel memebers on join. Unfortunately uclibc++
uses a naive linked-list implementation with horrible performance, which
can cause joins to take a few minutes on popular channels.

Therefore Switch to libstdc++ which uses a much more performant hashmap.
ZNC by itself is already rather large, so the added footprint of
libstd++ vs uclibc++ does not matter that much anyway.

Should fix #11778.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net/znc/Makefile
net/znc/patches/002-Uclibcpp_build_fix.patch [deleted file]
net/znc/patches/900-remove_cpp11_usage.patch [deleted file]

index 1d73922f4ef820435f866db741c8eb7afdfb576b..9681c47333ee7237a270f3ddcd9d3f6104ab5f28 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
 PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://znc.in/releases \
@@ -33,7 +33,7 @@ endef
 
 define Package/znc
   $(Package/znc/default)
-  DEPENDS:=+libopenssl +libpthread $(CXX_DEPENDS)
+  DEPENDS:=+libopenssl +libpthread +libstdcpp
   MENU:=1
 endef
 
@@ -261,14 +261,13 @@ $(eval $(call webskin,ice))
 
 PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
 
-include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_VARS += \
-       CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
+       CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
        CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
        LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
+       LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
 
 CONFIGURE_ARGS += \
        --disable-c-ares \
diff --git a/net/znc/patches/002-Uclibcpp_build_fix.patch b/net/znc/patches/002-Uclibcpp_build_fix.patch
deleted file mode 100644 (file)
index df27c80..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From fa14938321eda39f16bee6068296e6abc9df7b85 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
-Date: Wed, 6 Apr 2011 04:11:48 +0200
-Subject: [PATCH] Add a uClibc++ build workaround
-
----
- modules/webadmin.cpp |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
---- a/modules/webadmin.cpp
-+++ b/modules/webadmin.cpp
-@@ -20,6 +20,7 @@
- #include <znc/IRCNetwork.h>
- #include <znc/IRCSock.h>
-+using std::string;
- using std::stringstream;
- using std::make_pair;
- using std::set;
-@@ -75,7 +76,7 @@ class CWebAdminMod : public CModule {
- public:
-       MODCONSTRUCTOR(CWebAdminMod) {
-               VPair vParams;
--              vParams.push_back(make_pair("user", ""));
-+              vParams.push_back(make_pair((string)"user", (string)""));
-               AddSubPage(new CWebSubPage("settings", "Global Settings", CWebSubPage::F_ADMIN));
-               AddSubPage(new CWebSubPage("edituser", "Your Settings", vParams));
-               AddSubPage(new CWebSubPage("traffic", "Traffic Info", CWebSubPage::F_ADMIN));
diff --git a/net/znc/patches/900-remove_cpp11_usage.patch b/net/znc/patches/900-remove_cpp11_usage.patch
deleted file mode 100644 (file)
index e87730b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/modules/certauth.cpp b/modules/certauth.cpp
-index 61e5687..4857d59 100644
---- a/modules/certauth.cpp
-+++ b/modules/certauth.cpp
-@@ -204,7 +204,7 @@ public:
-                       return;
-               }
--              SCString::const_iterator it2 = it->second.begin();
-+              SCString::iterator it2 = it->second.begin();
-               while (id > 1) {
-                       ++it2;
-                       id--;