lancethepants / tomatoware

Tomatoware is a set of scripts to create a native development environment for tomato firmware supported routers.
Other
71 stars 22 forks source link

UPX static compile error #52

Closed houzi- closed 2 years ago

houzi- commented 2 years ago

Hi guys

error:

admin@R6300V2-2F63:/mmc/compile/upx/src# ./upx.out
step1: 0x09f003f7 0x09ec03f6 0x09f003f7
./upx.out: main.cpp: 1364: void upx_sanity_check(): Assertion `upx_adler32(d, 4) == 0x062e0277' failed.
Aborted

compile operation: UCL_1.0.3: ./configure --prefix=/mmc CPPFLAGS="$CPPFLAGS -std=c90 -fPIC" LZMA_14.32.7: ./configure --prefix=/mmc UPX_3.94: make all LIBS="--static -lucl -lz" CXXFLAGS="-Wno-erro"

The above errors will appear when the binary(upx.out) file generated by compilation runs. What is the reason for this?

lancethepants commented 2 years ago

What version of upx are you compiling? In Tomatoware I've intentionally held back upx to version 3.94 because 3.95 & 3.96 have been buggy with either arm or mipsel compressed binaries not working properly. I did try compiling the very latest from git a few months ago and it seemed to be in better shape.

houzi- commented 2 years ago

@lancethepants 3.94

lancethepants commented 2 years ago

So usually I cross-compile upx, but this is how to do it natively on your router. This is the method they explain in README.SRC. You only need ucl and upx.

# UCL
CFLAGS="-std=c90" \
./configure

make -j2

# Adjust to your location of ucl.
export UPX_UCLDIR=/mmc/src/upx/ucl-1.03

# UPX
LDFLAGS="-s -static" \
make -j2 \
all \
CXXFLAGS_WERROR= \
CHECK_WHITESPACE=/bin/true
houzi- commented 2 years ago

OK!i try👍

houzi- commented 2 years ago

It's the same mistake. It's estimated that I modified the source code of upx thanks guys