Prerequisites
Preparation
- Download everything needed
- Extract upx to anywhere you like, extract ucllib as
/path/to/upx/ucl
, zlibg as/path/to/upx/zlib
- Build cross compile docker with
docker run --rm dockcross/windows-static-x64 > ./dockcross-win64
- Run
./dockcross-win64 bash
to enter cross compile environment.
Compile dependencies
UCL
cd ucl
./configure --host=x86_64-w64-mingw32 --enable-static --prefix=/usr/src/mxe/usr/x86_64-w64-mingw32.static/ CPPFLAGS="$CPPFLAGS -std=c90 -fPIC"
make && make install
Zlib
cd zlib
./configure --static --prefix=/usr/src/mxe/usr/x86_64-w64-mingw32.static/
make && make install
Compile UPX
setup env
export UPX_UCLDIR=/work/ucl
Build!
make all
No error should occur and you get your compiled result as src/upx.out
!
Congratulations!
And I also prepared a compiled file for your lazy guys upx-4.0.0.zip
最后一次更新于2022-10-14
welcome
By snowie at November 10th, 2022 at 02:12 pm.