- download xmrig: https://github.com/xmrig/xmrig/releases
- copy xmrig/scripts to xmrig-proxy/scripts
$ cp -frv xmrig/scripts xmrig-proxy/$ cd xmrig-proxy && scripts/build_deps.sh- edit cmake/cmake.flags
- find
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")and add-staticto it - result:
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -static") $ mkdir -p build && cd build$ cmake .. -DXMRIG_DEPS=scripts/deps$ make -j`nproc`
xmrig-proxy built this way will work on most systems, although if you want a truly static binary you should compile on Alpine Linux.
- apk add git make cmake libstdc++ gcc g++ libuv-dev openssl-dev hwloc-dev
- apk add bash automake libtool m4 autom4te autoconf linux-headers
- (optional) edit
build.openssl.shand change the version from1.1.1mto1.1.1nfor added security - scripts/build_deps.sh
$ mkdir -p build && cd build$ cmake .. -DXMRIG_DEPS=scripts/deps$ make -j`nproc`