Ticket #8278: libtorrent.patch

File libtorrent.patch, 5.7 KB (added by sav, 7 years ago)

Update libtorrent to 0.12.7 r1189

  • libtorrent

    diff -durN libtorrent.old/Makefile libtorrent/Makefile
    old new  
    88include $(TOPDIR)/rules.mk 
    99 
    1010PKG_NAME:=libtorrent 
    11 PKG_REV:=1165 
    12 PKG_VERSION:=0.12.6_r$(PKG_REV) 
    13 PKG_RELEASE:=2 
     11PKG_REV:=1189 
     12PKG_VERSION:=0.12.7_r$(PKG_REV) 
     13PKG_RELEASE:=1 
    1414 
    1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
    1616PKG_SOURCE_URL:=svn://rakshasa.no/libtorrent/trunk/libtorrent 
     
    2828  CATEGORY:=Libraries 
    2929  TITLE:=Rakshasa's BitTorrent library 
    3030  URL:=http://libtorrent.rakshasa.no/ 
    31   DEPENDS:=+libopenssl +libsigcxx @!LINUX_2_4 
     31  DEPENDS:=+libopenssl +libsigcxx +libpthread @!LINUX_2_4 
    3232endef 
    3333 
    3434define Package/libtorrent/description 
     
    3939 the speed of the official client. 
    4040endef 
    4141 
    42 ifneq ($(CONFIG_GCC_VERSION_3_4)$(CONFIG_GCC_VERSION_4_1),) 
     42ifneq ($(CONFIG_GCC_VERSION_4_1),) 
    4343  TARGET_CPPFLAGS += -fno-strict-aliasing 
    4444endif 
    4545 
     
    4848# XXX: fixes the following error when configure from rtorrent is trying 
    4949# to link against libtorrent on arm (#7026) 
    5050# 
    51 # ./staging_dir/toolchain-arm_v5t_gcc-4.3.3+cs_uClibc-0.9.30.1_eabi/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.3.3/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: conftest: hidden symbol `__sync_add_and_fetch_4' in /media/Scratch/OpenWrt/backfire/build.d/orion/staging_dir/toolchain-arm_v5t_gcc-4.3.3+cs_uClibc-0.9.30.1_eabi/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.3.3/libgcc.a(linux-atomic.o) is referenced by DSO 
    52 # ./staging_dir/toolchain-arm_v5t_gcc-4.3.3+cs_uClibc-0.9.30.1_eabi/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.3.3/../../../../arm-openwrt-linux-uclibcgnueabi/bin/ld: final link failed: Nonrepresentable section on output 
    53 # 
     51 
    5452ifneq ($(CONFIG_arm)$(CONFIG_armeb),) 
    5553  TARGET_LDFLAGS += -Wl,--whole-archive -lgcc -lgcc_s -Wl,--no-whole-archive 
    5654endif 
  • patches/110-fix-no-posix_memalign.diff

    diff -durN libtorrent.old/patches/110-fix-no-posix_memalign.diff libtorrent/patches/110-fix-no-posix_memalign.diff
    old new  
    11--- a/rak/allocators.h 
    22+++ b/rak/allocators.h 
    3 @@ -74,17 +74,13 @@ public: 
     3@@ -74,17 +74,13 @@ 
    44   size_type max_size () const throw() { return std::numeric_limits<size_t>::max() / sizeof(T); } 
    55  
    66   pointer allocate(size_type num, const_void_pointer hint = 0) { return alloc_size(num*sizeof(T)); } 
    7 +  void deallocate (pointer p, size_type num) { dealloc_size(p, num*sizeof(T)); } 
    8   
     7- 
    98-  static pointer alloc_size(size_type size) { 
    109-    pointer ptr = NULL; 
    1110-    int __UNUSED result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size); 
    1211- 
    1312-    return ptr; 
    1413-  } 
     14+  void deallocate (pointer p, size_type num) { dealloc_size(p, num*sizeof(T)); } 
     15 
    1516+  static pointer alloc_size(size_type size); 
    1617+  static void dealloc_size(pointer p, size_type size); 
    1718  
    1819   void construct (pointer p, const T& value) { new((void*)p)T(value); } 
    1920   void destroy (pointer p) { p->~T(); } 
    20 -  void deallocate (pointer p, size_type num) { ::operator delete((void*)p); } 
     21-  void deallocate (pointer p, size_type num) { free((void*)p); } 
    2122 }; 
    2223  
    2324  
    24 @@ -98,6 +94,36 @@ bool operator!= (const cacheline_allocat 
     25@@ -98,6 +94,36 @@ 
    2526   return false; 
    2627 } 
    2728  
  • patches/123-canceled_keep.diff

    diff -durN libtorrent.old/patches/123-canceled_keep.diff libtorrent/patches/123-canceled_keep.diff
    old new  
     1Index: libtorrent/src/protocol/request_list.cc 
     2=================================================================== 
     3--- libtorrent/src/protocol/request_list.cc     (revision 1149) 
     4+++ libtorrent/src/protocol/request_list.cc     (working copy) 
     5@@ -244,9 +244,16 @@ 
     6   // reordering. 
     7   // 
     8   // Add some extra checks here to avoid clearing too often. 
     9-  if (!m_canceled.empty()) { 
     10-    std::for_each(m_canceled.begin(), m_canceled.end(), std::ptr_fun(&Block::release)); 
     11-    m_canceled.clear(); 
     12+//   if (!m_canceled.empty()) { 
     13+//     std::for_each(m_canceled.begin(), m_canceled.end(), std::ptr_fun(&Block::release)); 
     14+//     m_canceled.clear(); 
     15+//   } 
     16+ 
     17+  if (m_canceled.size() > 1024) { 
     18+    ReserveeList::iterator cancel_itr = m_canceled.begin(); 
     19+    std::advance(cancel_itr, 512); 
     20+    std::for_each(m_canceled.begin(), cancel_itr, std::ptr_fun(&Block::release)); 
     21+    m_canceled.erase(m_canceled.begin(), cancel_itr); 
     22   } 
     23  
     24   while (m_queued.begin() != end) { 
  • patches/124-fix_crash_torrent_conection.patch

    diff -durN libtorrent.old/patches/124-fix_crash_torrent_conection.patch libtorrent/patches/124-fix_crash_torrent_conection.patch
    old new  
     1diff -durN libtorrent-0.12.6_r1144/src/protocol/peer_connection_leech.cc libtorrent-0.12.6_r1143/src/protocol/peer_connection_leech.cc 
     2--- libtorrent-0.12.6_r1144/src/protocol/peer_connection_leech.cc       2010-03-15 19:42:05.000000000 +0300 
     3+++ libtorrent-0.12.6_r1143/src/protocol/peer_connection_leech.cc       2010-11-17 14:13:15.000000000 +0300 
     4@@ -333,13 +333,13 @@ 
     5       m_down->set_state(ProtocolRead::READ_EXTENSION); 
     6     } 
     7  
     8-    if (!down_extension()) 
     9-      return false; 
     10+    if (down_extension()) { 
     11+      if (m_extensions->has_pending_message()) 
     12+       write_insert_poll_safe(); 
     13+      m_down->set_state(ProtocolRead::IDLE); 
     14+    } 
     15  
     16-    if (m_extensions->has_pending_message()) 
     17-      write_insert_poll_safe(); 
     18  
     19-    m_down->set_state(ProtocolRead::IDLE); 
     20     return true; 
     21  
     22   default: