wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* [wireguard-apple] [iOS] Running WireGuard on a simulator
@ 2021-09-02  0:57 Neutron
  2021-09-02  1:20 ` Jeffrey Walton
  2021-09-02  2:10 ` Jeffrey Walton
  0 siblings, 2 replies; 5+ messages in thread
From: Neutron @ 2021-09-02  0:57 UTC (permalink / raw)
  To: WireGuard mailing list; +Cc: Jason A. Donenfeld, roop

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-02  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  0:57 [wireguard-apple] [iOS] Running WireGuard on a simulator Neutron
2021-09-02  1:20 ` Jeffrey Walton
2021-09-02  2:10 ` Jeffrey Walton
2021-09-02  6:48   ` Neutron
2021-09-02  7:02     ` Jeffrey Walton

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).