wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Neutron <dotneutron@protonmail.ch>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	"roop@roopc.net" <roop@roopc.net>
Subject: [wireguard-apple] [iOS] Running WireGuard on a simulator
Date: Thu, 02 Sep 2021 00:57:30 +0000	[thread overview]
Message-ID: <-_8oxop6VI5mP0UY_0vydSMUBInbj0hR4IUPDWshTaRG0-6O9ybfu6kzIAk68XdY9N-LHiVgaiWhNQw6-iYG1cR14pfODj2o5JMStY-75ns=@protonmail.ch> (raw)

Hello,

I've tried running wireguard-apple on an iOS simulator and encountered some
trouble during the compilation of WireGuardKitGo. I did this on an Apple M1,
which I thought at first would be the culprit.

The Go version is "go1.16 darwin/arm64". The build process fails at
# runtime/cgo
Undefined symbols for architecture arm64:
  "_darwin_arm_init_mach_exception_handler", referenced from:
      _x_cgo_init in _x004.o
  "_darwin_arm_init_thread_exception_port", referenced from:
      _threadentry in _x004.o
      _x_cgo_init in _x004.o
ld: symbol(s) not found for architecture arm64

This issue was reported a few times in Go's issues section, e.g.,
https://github.com/golang/go/issues/45772#issuecomment-874616905

Further head banging lead me to the discovery that

xcodebuild -target WireGuardiOS -sdk iphoneos14.5

actually builds successfully. I looked through the Makefile and applied some
monkey see, monkey do. It turns out I could get it to link by adding
GOOS_iphonesimulator := ios.

For a moment I thought this was a definite win, but it turns out connecting to
one of the test tunnels doesn't do anything. I hit a dead end after finding this
answer on a forum thread.

https://developer.apple.com/forums/thread/651779?answerId=617050022#617050022

"If you’re talking about the iOS Simulator here, be aware that, because of the
way they interact with the networking stack, NetworkExtension providers only
work on real hardware."

I don't have an actual iPhone on hand at the moment, so I guess the question is,
is the project supposed to work only on real hardware? Was that flag left out
intentionally? If so, is there a way to get it to run properly on simulators?

I'm a neophyte when it comes to anything iOS related, so perhaps someone
with more experience can shed some light on the subject.

Neutron

             reply	other threads:[~2021-09-02  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  0:57 Neutron [this message]
2021-09-02  1:20 ` [wireguard-apple] [iOS] Running WireGuard on a simulator Jeffrey Walton
2021-09-02  2:10 ` Jeffrey Walton
2021-09-02  6:48   ` Neutron
2021-09-02  7:02     ` Jeffrey Walton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='-_8oxop6VI5mP0UY_0vydSMUBInbj0hR4IUPDWshTaRG0-6O9ybfu6kzIAk68XdY9N-LHiVgaiWhNQw6-iYG1cR14pfODj2o5JMStY-75ns=@protonmail.ch' \
    --to=dotneutron@protonmail.ch \
    --cc=Jason@zx2c4.com \
    --cc=roop@roopc.net \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).