Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [wireguard-apple] [iOS] Running WireGuard on a simulator
Date: Thu, 2 Sep 2021 03:02:32 -0400	[thread overview]
Message-ID: <CAH8yC8k--EzaMeAcrpPNjRBnMb5KNLx3aFJemNQg-pQTMxJ=Cg@mail.gmail.com> (raw)
In-Reply-To: <4hMWm75HKpodCnXIg9XhHltxE-7XSQVijaKMwRC5XcKpdTEWnZ9Vn4TtWr4k1EdAMbBMMMS4BBPrvNhoisXG-oQLUj_3jErUO76UBfjM2ZY=@protonmail.ch>

On Thu, Sep 2, 2021 at 2:50 AM Neutron <dotneutron@protonmail.ch> wrote:
>
> Jeff, thank you for the clarification on how a simulator operates compared to an
> emulator. The difference was certainly blurry in my head. I did a little more
> digging and it turns out
>
> GOOS_iphonesimulator := ios
>
> is not required when targeting an iOS12.0 simulator. I had initially run it with
> iOS14.5. Perhaps this line can be useful in the Makefile once the project's iOS
> version gets bumped. Still, I would like to know why this happens.

Getting the environment setup correctly is tricky with Clang. With
GCC, you just run 'gcc -dumpmachine' and you can tell what you are
targeting. -dumpmachine does not work with Clang. Clang reports the
host's arch, like x86_64 even if you are targeting iPhone or
iPhoneSimulator or WatchOS or AppleTV.

To get the information from Clang you need to do something like this:
https://github.com/weidai11/cryptopp/blob/master/GNUmakefile#L50. You
have to run the preprocessor with CFLAGS or CXXFLAGS, and look for
defines like __x86_64__ or __aarch64__.

You have to use CFLAGS or CXXFLAGS because that's where you put '-arch
arm64'. Xcode sets this for you in the IDE, but you have to do it
manually when setting up a makefile.

> Just like before on iOS14.5, I'm having issues with creating/editing
> configurations in the simulator, with log messages like:
>
> Saving configuration failed: Error Domain=NEVPNErrorDomain Code=5 "IPC failed"
>
> The message I'm getting may be just as well be unrelated, but a common theme I'm
> seeing is that you can't get Network Extension providers to work on simulators.

Yeah, Apple has some cryptic error messages at times. If you can't
find it while searching, then you have to burn one of those Apple
Support incidences.

> This Eskimo fellow seems to have good insight on the matter.
>
> https://developer.apple.com/forums/thread/46004?answerId=134358022#134358022

Quinn is usually very helpful. He's been supporting Apple development
for as long as I can remember.

Jeff

      reply	other threads:[~2021-09-02  7:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  0:57 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 message]

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='CAH8yC8k--EzaMeAcrpPNjRBnMb5KNLx3aFJemNQg-pQTMxJ=Cg@mail.gmail.com' \
    --to=noloader@gmail.com \
    --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).