|
悬赏100恩山币已解决
客户机环境:乌班图22.04
使用的源码:openwrt官方的21.02分支
使用的upx源码:https://github.com/coolsnowwolf/ ... e/lean/upx/Makefile
- #
- # Copyright (C) 2011-2020 OpenWrt.org
- #
- # This is free software, licensed under the GNU General Public License v2.
- # See /LICENSE for more information.
- #
- include $(TOPDIR)/rules.mk
- PKG_NAME:=upx
- PKG_VERSION:=4.2.2
- PKG_RELEASE:=1
- PKG_SOURCE_PROTO:=git
- PKG_SOURCE_URL:=https://github.com/upx/upx.git
- PKG_SOURCE_VERSION:=099c3d829e80488af7395a4242b318877e980da4
- PKG_MIRROR_HASH:=8bee3cd1ada2e4bfbe396348d2aecb3e044f92cdae2b7010838e36997fe6b3c3
- PKG_MAINTAINER:=Xingwang Liao <kuoruan@gmail.com>
- PKG_LICENSE:=GPL-2.0-only
- PKG_LICENSE_FILES:=COPYING LICENSE
- HOST_BUILD_DEPENDS:=ucl/host
- MAKE_PATH:=src
- include $(INCLUDE_DIR)/package.mk
- include $(INCLUDE_DIR)/host-build.mk
- define Package/upx
- SECTION:=utils
- CATEGORY:=Utilities
- DEPENDS:=+libucl +libstdcpp +zlib
- TITLE:=The Ultimate Packer for eXecutables
- URL:=https://upx.github.io/
- endef
- define Package/upx/description
- UPX is a free, secure, portable, extendable, high-performance
- executable packer for several executable formats.
- endef
- define Host/Compile
- UPX_UCLDIR=$(STAGING_DIR_HOST) \
- $(MAKE) -C $(HOST_BUILD_DIR)/src \
- LDFLAGS="$(HOST_LDFLAGS)" \
- CXX="$(HOSTCXX)"
- endef
- define Host/Install
- $(CP) $(HOST_BUILD_DIR)/build/release/upx $(STAGING_DIR_HOST)/bin/upx
- endef
- define Host/Clean
- rm -f $(STAGING_DIR_HOST)/bin/upx
- endef
- define Package/upx/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/release/upx $(1)/usr/bin/upx
- endef
- $(eval $(call HostBuild))
- $(eval $(call BuildPackage,upx))
复制代码 遇到的报错日志:
- make[2]: Entering directory '/workdir/openwrt/feeds/small8/upx'
- mkdir -p /workdir/openwrt/dl
- SHELL= flock /workdir/openwrt/tmp/.upx-4.2.3-src.tar.xz.flock -c ' /workdir/openwrt/scripts/download.pl "/workdir/openwrt/dl" "upx-4.2.3-src.tar.xz" "d6357eec6ed4c1b51f40af2316b0958ff1b7fa6f53ef3de12da1d5c96d30e412" "" "https://github.com/upx/upx/releases/download/v4.2.3" '
- touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.prepared_8ab2f467838f73a03180672eee52e05a_6664517399ebbbc92a37c5bb081b5c53_check
- . /workdir/openwrt/include/shell.sh; xzcat /workdir/openwrt/dl/upx-4.2.3-src.tar.xz | tar -C /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.. -xf -
- [ ! -d ./src/ ] || cp -fpR ./src/. /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src
- touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.prepared_8ab2f467838f73a03180672eee52e05a_6664517399ebbbc92a37c5bb081b5c53
- rm -f /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.configured_*
- rm -f /workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.upx_installed
- mkdir -p /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build
- (cd /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build; CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src=upx-4.2.3-src -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src=upx-4.2.3-src -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " LDFLAGS="-L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.
- -- UPX_VERSION_GITREV: disabled
- -- The C compiler identification is GNU 8.4.0
- -- The CXX compiler identification is GNU 8.4.0
- -- Detecting C compiler ABI info
- -- Detecting C compiler ABI info - done
- -- Check for working C compiler: /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc - skipped
- -- Detecting C compile features
- -- Detecting C compile features - done
- -- Detecting CXX compiler ABI info
- -- Detecting CXX compiler ABI info - done
- -- Check for working CXX compiler: /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-g++ - skipped
- -- Detecting CXX compile features
- -- Detecting CXX compile features - done
- -- CMAKE_VERSION = 3.25.2
- -- CMAKE_GENERATOR = Unix Makefiles
- -- CMAKE_HOST_SYSTEM_NAME = Linux
- -- CMAKE_HOST_SYSTEM_VERSION = 6.5.0-1018-azure
- -- CMAKE_HOST_SYSTEM_PROCESSOR = x86_64
- -- CMAKE_SYSTEM_NAME = Linux
- -- CMAKE_SYSTEM_VERSION = 1
- -- CMAKE_SYSTEM_PROCESSOR = mipsel
- -- CMAKE_CROSSCOMPILING = TRUE
- -- CMAKE_C_COMPILER = /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc
- -- CMAKE_CXX_COMPILER = /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-g++
- -- CMAKE_AR = /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc-ar
- -- CMAKE_RANLIB = /workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc-ranlib
- -- CMAKE_C_COMPILER_ID = GNU
- -- CMAKE_C_COMPILER_VERSION = 8.4.0
- -- CMAKE_C_PLATFORM_ID = Linux
- -- CMAKE_C_COMPILER_ABI = ELF
- -- CMAKE_CXX_COMPILER_ID = GNU
- -- CMAKE_CXX_COMPILER_VERSION = 8.4.0
- -- CMAKE_CXX_PLATFORM_ID = Linux
- -- CMAKE_CXX_COMPILER_ABI = ELF
- -- CMAKE_TRY_COMPILE_CONFIGURATION = Release
- -- UNIX = 1
- -- CMAKE_INSTALL_PREFIX = /usr
- -- CMAKE_BUILD_TYPE = Release
- -- Configuring done
- -- Generating done
- CMake Warning:
- Manually-specified variables were not used by the project:
- CMAKE_ASM_COMPILER
- CMAKE_ASM_COMPILER_LAUNCHER
- CMAKE_EXPORT_NO_PACKAGE_REGISTRY
- CMAKE_EXPORT_PACKAGE_REGISTRY
- CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
- CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
- CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
- CMAKE_FIND_USE_PACKAGE_REGISTRY
- CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
- CMAKE_MODULE_LINKER_FLAGS
- CMAKE_SHARED_LINKER_FLAGS
- DL_LIBRARY
- -- Build files have been written to: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build
- touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.configured_68b329da9893e34099c7d8ad5cb9c940
- rm -f /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.built
- touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.built_check
- CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src=upx-4.2.3-src -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src=upx-4.2.3-src -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,
- make[3]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[4]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- [ 1%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/alloc.c.o
- [ 2%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2b_99.c.o
- [ 3%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2b_d.c.o
- [ 4%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2b_ds.c.o
- [ 5%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2b_to.c.o
- [ 6%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2d_99.c.o
- [ 7%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2d_d.c.o
- [ 8%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2d_ds.c.o
- [ 9%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2d_to.c.o
- [ 10%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2e_99.c.o
- [ 11%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2e_d.c.o
- [ 12%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2e_ds.c.o
- [ 13%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/n2e_to.c.o
- [ 14%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/ucl_crc.c.o
- [ 15%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/ucl_init.c.o
- [ 16%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/ucl_ptr.c.o
- [ 17%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/ucl_str.c.o
- [ 18%] Building C object CMakeFiles/upx_vendor_ucl.dir/vendor/ucl/src/ucl_util.c.o
- [ 20%] Linking C static library libupx_vendor_ucl.a
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- [ 20%] Built target upx_vendor_ucl
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- [ 21%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/adler32.c.o
- [ 22%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/crc32.c.o
- [ 23%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/deflate.c.o
- [ 24%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/gzclose.c.o
- [ 25%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/gzlib.c.o
- [ 26%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/gzread.c.o
- [ 27%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/gzwrite.c.o
- [ 28%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/infback.c.o
- [ 29%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/inffast.c.o
- [ 30%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/inflate.c.o
- [ 31%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/inftrees.c.o
- [ 32%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/trees.c.o
- [ 33%] Building C object CMakeFiles/upx_vendor_zlib.dir/vendor/zlib/zutil.c.o
- [ 34%] Linking C static library libupx_vendor_zlib.a
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- [ 34%] Built target upx_vendor_zlib
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[5]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- [ 35%] Building CXX object CMakeFiles/upx.dir/src/check/dt_check.cpp.o
- [ 36%] Building CXX object CMakeFiles/upx.dir/src/check/dt_cxxlib.cpp.o
- [ 37%] Building CXX object CMakeFiles/upx.dir/src/check/dt_impl.cpp.o
- [ 38%] Building CXX object CMakeFiles/upx.dir/src/check/dt_xspan.cpp.o
- {standard input}: Assembler messages:
- {standard input}:899: Error: invalid operands `srl $0,$0,13'
- {standard input}:900: Error: invalid operands `srl $0,$0,29'
- {standard input}:901: Error: invalid operands `srl $0,$0,3'
- {standard input}:902: Error: invalid operands `srl $0,$0,19'
- {standard input}:903: Error: invalid operands `or $13,$13,$13'
- make[5]: *** [CMakeFiles/upx.dir/build.make:118: CMakeFiles/upx.dir/src/check/dt_xspan.cpp.o] Error 1
- make[4]: *** [CMakeFiles/Makefile2:140: CMakeFiles/upx.dir/all] Error 2
- make[5]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[4]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[3]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/openwrt-build'
- make[3]: *** [Makefile:136: all] Error 2
- make[2]: *** [Makefile:60: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/upx-4.2.3-src/.built] Error 2
- make[2]: Leaving directory '/workdir/openwrt/feeds/small8/upx'
- time: package/feeds/small8/upx/compile#8.85#1.05#9.50
- ERROR: package/feeds/small8/upx failed to build.
- make[1]: *** [package/Makefile:120: package/feeds/small8/upx/compile] Error 1
- make[1]: Leaving directory '/workdir/openwrt'
- make: *** [/workdir/openwrt/include/toplevel.mk:230: package/upx/compile] Error 2
- Error: Process completed with exit code 2.
复制代码
需求:需要使用upx压缩xray
即:
- $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/main
复制代码
请问各位大佬,这个问题该如何解决?
- {standard input}: Assembler messages:
- {standard input}:899: Error: invalid operands `srl $0,$0,13'
- {standard input}:900: Error: invalid operands `srl $0,$0,29'
- {standard input}:901: Error: invalid operands `srl $0,$0,3'
- {standard input}:902: Error: invalid operands `srl $0,$0,19'
- {standard input}:903: Error: invalid operands `or $13,$13,$13'
复制代码
|
最佳答案
查看完整内容
这样添加到Makefile里 先下载upx预编译好的文件到STAGING_DIR_HOST里
|