Compiling Wireguard-Android repo on a M1 Silicon Mac

Houman houmie at gmail.com
Thu Feb 9 08:05:35 UTC 2023


I have difficulties compiling the Wireguard-Android repo on a M1 Silicon Mac.

I got this error message below. Any idea what I need to do? Thanks

* What went wrong:
Execution failed for task ':tunnel:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/houmie/Projects/wireguard-android/tunnel/.cxx/Debug/2w2e1e1x/arm64-v8a'
  [1/18] Building C object CMakeFiles/libwg-quick.so.dir/ndk-compat/compat.c.o
  [2/18] Building C object
CMakeFiles/libwg-quick.so.dir/wireguard-tools/src/wg-quick/android.c.o
  [3/18] Linking C executable
/Users/houmie/Projects/wireguard-android/tunnel/build/intermediates/cxx/Debug/2w2e1e1x/obj/arm64-v8a/libwg-quick.so
  [4/18] Building wireguard-go
  FAILED: CMakeFiles/libwg-go.so
/Users/houmie/Projects/wireguard-android/tunnel/.cxx/Debug/2w2e1e1x/arm64-v8a/CMakeFiles/libwg-go.so
  cd /Users/houmie/Projects/wireguard-android/tunnel/tools/libwg-go &&
make ANDROID_ARCH_NAME=arm64
ANDROID_C_COMPILER=/Users/houmie/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
ANDROID_TOOLCHAIN_ROOT=/Users/houmie/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64
ANDROID_LLVM_TRIPLE=aarch64-none-linux-android21 ANDROID_SYSROOT=
ANDROID_PACKAGE_NAME=com.wireguard.android.debug
GRADLE_USER_HOME=/Users/houmie/.gradle "CFLAGS=-g -DANDROID
-fdata-sections -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2
-Wformat -Werror=format-security  -Wno-unused-command-line-argument"
"LDFLAGS=-Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a
-Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id
-Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments
-fuse-ld=gold" DESTDIR=/Users/houmie/Projects/wireguard-android/tunnel/build/intermediates/cxx/Debug/2w2e1e1x/obj/arm64-v8a
BUILDDIR=/Users/houmie/Projects/wireguard-android/tunnel/build/intermediates/cxx/Debug/2w2e1e1x/obj/arm64-v8a/../generated-src
  mkdir -p "/Users/houmie/.gradle/caches/golang/"
  flock "/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz.lock"
-c ' \
  [ -f "/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz"
] && exit 0; \
  curl -o "/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz.tmp"
"https://dl.google.com/go/go1.18.2.darwin-arm64.tar.gz" && \
  echo "6c7df9a2405f09aa9bab55c93c9c4ce41d3e58127d626bc1825ba5d0a0045d5c
 /Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz.tmp"
| sha256sum -c && \
  mv "/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz.tmp"
"/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz"'
    % Total    % Received % Xferd  Average Speed   Time    Time
Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
100  131M  100  131M    0     0  17.0M      0  0:00:07  0:00:07 --:--:-- 20.0M
  zsh:1: command not found: sha256sum
  make: *** [/Users/houmie/.gradle/caches/golang/go1.18.2.darwin-arm64.tar.gz]
Error 127
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /Users/houmie/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/houmie/Projects/wireguard-android/tunnel/.cxx/Debug/2w2e1e1x/arm64-v8a
\
        libwg-quick.so \
        libwg.so
    from /Users/houmie/Projects/wireguard-android/tunnel

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.


More information about the WireGuard mailing list