2

Building my Wireguard-Apple project with latest Xcode 15 Beta release leads to some build issue. It looks like the problem appears when building the target WireguardNetworkExtensionsmasOs (same for target WireguardNetworkExtensionsiOS). Using the same code base and building with Xcode 14, all looks fine.

I downloaded the reference implementation from https://git.zx2c4.com/wireguard-apple and the same problem appears.

ld: warning: '/Users/daniel/Library/Developer/Xcode/DerivedData/WireGuard-eummroygnzwynwfxhjfgjmamxkof/Build/Products/Debug/libwg-go.a[arm64][2](go.o)' has malformed LC_DYSYMTAB, expected 72 undefined symbols to start at index 4928, found 81 undefined symbols starting at index 15
ld: initializer pointer must point to start of function (no addend) in '/Users/daniel/Library/Developer/Xcode/DerivedData/WireGuard-eummroygnzwynwfxhjfgjmamxkof/Build/Products/Debug/libwg-go.a[arm64][2](go.o)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Somehow, the problem must be with GO@1.20 and the latest Xcode 15 beta release.

I tried to use the WireGuard_Apple reference implementation (https://git.zx2c4.com/wireguard-apple) to exclude the error from my application.

  • Using Xcode 15 beta, the problem shows up. Build is not possible.
  • Switching back to Xcode 14, everything build well.
Daniel
  • 21
  • 3
  • I suspect [this issue](https://github.com/golang/go/issues/60694) may be relevant (fix in go 1.21 which has just been released). – Brits Aug 08 '23 at 19:38

1 Answers1

0

After further analysing the issue, I found an interesting article in the internet: https://github.com/golang/go/issues/61229 Is seams that this error is related to the new linker of Xcode 15 beta. The mentioned article already explained a fix/workaround which I shortly would like to explain how I patched my system.

GoLang provides a fix that is for now still isolated on a branch. This we need to download to our system, build go fresh and reference to the patched version.

  1. Create a new directory on your Mac System
  2. Initialise git with git init
  3. Download the special patch branch from GoLang git clone https://go.googlesource.com/go refs/changes/15/505415/11
  4. Change into the source folder cd ./refs/changes/15/505415/11/src
  5. Build the new Go ./make.bash

After while, you will find the new Go binaries in your folder. Last, we only need to reference the newly built binaries on our Xcode Project. Go to your Xcode Project and add a User-Defined Build Setting. Name it PATH and add this value ${PATH}:<your new Go directory>/bin

Clean the Build Folder before you give it a try. For me it worked and I am able to compile my project with Xcode 15 Beta 5 for iOS 17 beta devices.

Daniel
  • 21
  • 3