Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 37813
-# Copyright (C) 2011-2012 OpenWrt.org
+# Copyright (C) 2011-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=upx
include $(TOPDIR)/rules.mk
PKG_NAME:=upx
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2
PKG_SOURCE_URL:=@SF/upx
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2
PKG_SOURCE_URL:=@SF/upx
-PKG_MD5SUM:=8186ab103288242f7e8ecad1acd4af03
+PKG_MD5SUM:=1253da46eac54a217eb73e2d44818e53
PKG_CAT:=bzcat
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)-src
PKG_CAT:=bzcat
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)-src
--- a/src/compress.cpp
+++ b/src/compress.cpp
--- a/src/compress.cpp
+++ b/src/compress.cpp
+@@ -41,7 +41,7 @@ unsigned upx_adler32(const void *buf, un
if (len == 0)
return adler;
assert(buf != NULL);
if (len == 0)
return adler;
assert(buf != NULL);
# define WITH_UCL 1
#endif
#if 0 && !defined(WITH_LZMA)
# define WITH_UCL 1
#endif
#if 0 && !defined(WITH_LZMA)
+@@ -640,7 +640,11 @@ struct lzma_compress_config_t
{
void reset() { memset(this, 0xff, sizeof(*this)); }
};
{
void reset() { memset(this, 0xff, sizeof(*this)); }
};
+@@ -692,7 +696,9 @@ struct lzma_compress_result_t
struct ucl_compress_result_t
{
struct ucl_compress_result_t
{
};
--- a/src/main.cpp
+++ b/src/main.cpp
};
--- a/src/main.cpp
+++ b/src/main.cpp
+@@ -618,7 +618,9 @@ static int do_option(int optc, const cha
opt->method = -1;
opt->all_filters = true;
opt->filter = -1;
opt->method = -1;
opt->all_filters = true;
opt->filter = -1;
/* fallthrough */
case 900: // --best
if (!set_method(-1, 10))
/* fallthrough */
case 900: // --best
if (!set_method(-1, 10))
+@@ -709,6 +711,7 @@ static int do_option(int optc, const cha
opt->exact = true;
break;
// compression runtime parameters
opt->exact = true;
break;
// compression runtime parameters
case 801:
getoptvar(&opt->crp.crp_ucl.c_flags, 0, 3, arg);
break;
case 801:
getoptvar(&opt->crp.crp_ucl.c_flags, 0, 3, arg);
break;
+@@ -730,6 +733,7 @@ static int do_option(int optc, const cha
case 807:
getoptvar(&opt->crp.crp_ucl.m_size, 10000u, 999999u, arg);
break;
case 807:
getoptvar(&opt->crp.crp_ucl.m_size, 10000u, 999999u, arg);
break;
break;
--- a/src/Makefile
+++ b/src/Makefile
break;
--- a/src/Makefile
+++ b/src/Makefile
+@@ -57,7 +57,10 @@ ifneq ($(wildcard $(UPX_UCLDIR)/include/
INCLUDES += -I$(UPX_UCLDIR)/include
LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext))))
endif
INCLUDES += -I$(UPX_UCLDIR)/include
LIBS += $(addprefix -L,$(dir $(wildcard $(UPX_UCLDIR)/libucl$(libext) $(UPX_UCLDIR)/src/.libs/libucl$(libext))))
endif
ifneq ($(UPX_LZMA_VERSION),)
--- a/src/packer.cpp
+++ b/src/packer.cpp
ifneq ($(UPX_LZMA_VERSION),)
--- a/src/packer.cpp
+++ b/src/packer.cpp
+@@ -199,6 +199,7 @@ bool Packer::compress(upx_bytep i_ptr, u
if (cconf_parm)
cconf = *cconf_parm;
// cconf options
if (cconf_parm)
cconf = *cconf_parm;
// cconf options
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
{
if (opt->crp.crp_ucl.c_flags != -1)
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
{
if (opt->crp.crp_ucl.c_flags != -1)
+@@ -216,6 +217,7 @@ bool Packer::compress(upx_bytep i_ptr, u
if (M_IS_LZMA(ph.method))
{
oassign(cconf.conf_lzma.pos_bits, opt->crp.crp_lzma.pos_bits);
if (M_IS_LZMA(ph.method))
{
oassign(cconf.conf_lzma.pos_bits, opt->crp.crp_lzma.pos_bits);
+@@ -250,6 +252,7 @@ bool Packer::compress(upx_bytep i_ptr, u
if (r != UPX_E_OK)
throwInternalError("compression failed");
if (r != UPX_E_OK)
throwInternalError("compression failed");
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
{
const ucl_uint *res = ph.compress_result.result_ucl.result;
if (M_IS_NRV2B(ph.method) || M_IS_NRV2D(ph.method) || M_IS_NRV2E(ph.method))
{
const ucl_uint *res = ph.compress_result.result_ucl.result;
+@@ -267,6 +270,7 @@ bool Packer::compress(upx_bytep i_ptr, u
assert(cconf.conf_ucl.max_match == 0 || cconf.conf_ucl.max_match >= ph.max_match_found);
}
}
assert(cconf.conf_ucl.max_match == 0 || cconf.conf_ucl.max_match >= ph.max_match_found);
}
}
if (!checkCompressionRatio(ph.u_len, ph.c_len))
--- a/src/p_exe.cpp
+++ b/src/p_exe.cpp
if (!checkCompressionRatio(ph.u_len, ph.c_len))
--- a/src/p_exe.cpp
+++ b/src/p_exe.cpp
+@@ -506,7 +506,9 @@ void PackExe::pack(OutputFile *fo)
Filter ft(ph.level);
// compress (max_match = 8192)
upx_compress_config_t cconf; cconf.reset();
Filter ft(ph.level);
// compress (max_match = 8192)
upx_compress_config_t cconf; cconf.reset();
--- a/src/p_ps1.cpp
+++ b/src/p_ps1.cpp
--- a/src/p_ps1.cpp
+++ b/src/p_ps1.cpp
+@@ -499,7 +499,9 @@ void PackPs1::pack(OutputFile *fo)
// compress (max_match = 65535)
upx_compress_config_t cconf; cconf.reset();
// compress (max_match = 65535)
upx_compress_config_t cconf; cconf.reset();
--- a/src/p_tos.cpp
+++ b/src/p_tos.cpp
--- a/src/p_tos.cpp
+++ b/src/p_tos.cpp
+@@ -506,7 +506,9 @@ void PackTos::pack(OutputFile *fo)
Filter ft(ph.level);
// compress (max_match = 65535)
upx_compress_config_t cconf; cconf.reset();
Filter ft(ph.level);
// compress (max_match = 65535)
upx_compress_config_t cconf; cconf.reset();