diff --git a/binaries/linux/x86_64/strace b/binaries/linux/x86_64/strace new file mode 100755 index 0000000..2a86946 Binary files /dev/null and b/binaries/linux/x86_64/strace differ diff --git a/strace/Dockerfile b/strace/Dockerfile new file mode 100644 index 0000000..e161d04 --- /dev/null +++ b/strace/Dockerfile @@ -0,0 +1,8 @@ +FROM andrewd/musl-cross +MAINTAINER Andrew Dunham + +# Add our build script +ADD . /build/ + +# This builds the program and copies it to /output +CMD /build/build.sh diff --git a/strace/build.sh b/strace/build.sh new file mode 100755 index 0000000..2923fdd --- /dev/null +++ b/strace/build.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -e +set -o pipefail +set -x + + +STRACE_VERSION=4.10 + + +function build_strace() { + cd /build + + # Download + curl -LO http://downloads.sourceforge.net/project/strace/strace/${STRACE_VERSION}/strace-${STRACE_VERSION}.tar.xz + tar xJvf strace-${STRACE_VERSION}.tar.xz + cd strace-${STRACE_VERSION} + + # Add missing headers. + patch -p2 < /build/strace.patch + + # Set up path + export PATH=$PATH:/opt/cross/x86_64-linux-musl/bin/ + + # Build + CC='x86_64-linux-musl-gcc -static -fPIC' \ + ./configure --host=x86_64-linux + make + x86_64-linux-musl-strip strace +} + +function doit() { + build_strace + + # Copy to output + if [ -d /output ] + then + OUT_DIR=/output/`uname | tr 'A-Z' 'a-z'`/x86_64 + mkdir -p $OUT_DIR + cp /build/strace-${STRACE_VERSION}/strace $OUT_DIR/ + echo "** Finished **" + else + echo "** /output does not exist **" + fi +} + +doit diff --git a/strace/strace.patch b/strace/strace.patch new file mode 100644 index 0000000..10df07e --- /dev/null +++ b/strace/strace.patch @@ -0,0 +1,13 @@ +diff --git 1/strace-4.10-orig/defs.h 2/strace-4.10/defs.h +index dad4fe8..d1378ab 100644 +--- 1/strace-4.10-orig/defs.h ++++ 2/strace-4.10/defs.h +@@ -54,6 +54,8 @@ + #include + #include + #include ++#include ++#include + + #ifndef HAVE_STRERROR + const char *strerror(int);