Skip to content

Instantly share code, notes, and snippets.

@theaog
Last active May 5, 2022 13:19
Show Gist options
  • Save theaog/87144a32b61a409d191937f99accf408 to your computer and use it in GitHub Desktop.
Save theaog/87144a32b61a409d191937f99accf408 to your computer and use it in GitHub Desktop.
xmrig-proxy static link v6.15.2+

v6.15.2 at the time of this writing

  • 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 -static to 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.

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.sh and change the version from 1.1.1m to 1.1.1n for added security
  • scripts/build_deps.sh
  • $ mkdir -p build && cd build
  • $ cmake .. -DXMRIG_DEPS=scripts/deps
  • $ make -j`nproc`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment