Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't cross-compile for iOS on Linux after following documentation #9353

Open
kus04e4ek opened this issue May 9, 2024 · 3 comments
Open
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation bug topic:buildsystem

Comments

@kus04e4ek
Copy link

kus04e4ek commented May 9, 2024

Tested versions

master [c4279fe3e0b27d0f40857c00eece7324a967285f]

System information

Ubuntu 22.04.4 LTS 22.04

Issue description

Get this error when trying to compile:

clang: error: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Werror,-Wstdlibcxx-not-found]

This patch fixes it, but not sure if this is the correct solution:

diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index e3bac4ec5ce..ddb8e775803 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -126,6 +126,7 @@ def configure(env: "SConsEnvironment"):
             CCFLAGS=(
                 "-fobjc-arc -arch x86_64"
                 " -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks"
+                " -stdlib=libc++"
                 " -fasm-blocks -isysroot $IOS_SDK_PATH"
             ).split()
         )
@@ -136,6 +137,7 @@ def configure(env: "SConsEnvironment"):
                 "-fobjc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing"
                 " -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits"
                 " -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies"
+                " -stdlib=libc++"
                 " -isysroot $IOS_SDK_PATH".split()
             )
         )

Steps to reproduce

Follow the steps from the documentation while using Xcode 14.3.1.

@akien-mga
Copy link
Member

The docs seem to be outdated / invalid, they instruct to copy only the target/bin folder but the whole target needs to be copied.

Here's how it looks like in the official build container:

# ls /root/ioscross/arm64
SDK  bin  include  lib  libexec  share  usr

Built from https://github.com/godotengine/build-containers/blob/main/Dockerfile.ios

@akien-mga akien-mga transferred this issue from godotengine/godot May 10, 2024
@akien-mga akien-mga changed the title Can't cross-compile for iOS on Linux Can't cross-compile for iOS on Linux after following documentation May 10, 2024
@akien-mga
Copy link
Member

I moved this to the docs repo.

@kus04e4ek
Copy link
Author

The docs seem to be outdated / invalid, they instruct to copy only the target/bin folder but the whole target needs to be copied.

Here's how it looks like in the official build container:

# ls /root/ioscross/arm64
SDK  bin  include  lib  libexec  share  usr

Built from https://github.com/godotengine/build-containers/blob/main/Dockerfile.ios

Tried doing this, but it didn't help. The docs seem to contain different instructions in other places too, but couldn't really find the exact reason why it doesn't work

@skyace65 skyace65 added the area:contributing Issues and PRs related to the Contributing/Development section of the documentation label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation bug topic:buildsystem
Projects
None yet
Development

No branches or pull requests

4 participants