godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.17k stars 21.2k forks source link

iOS export of C++ GDExtension fails in 4.3 RC3 #95363

Closed fatduckling closed 3 months ago

fatduckling commented 3 months ago

Tested versions

System information

Ubuntu 20.04.6 LTS

Issue description

Hi

I'm having similar issues related to #90168

I'm no longer able to export a simple game using C++ GDExtension in Godot 4.3 RC3.

Here is my full build log after running

/Applications/Godot.app/Contents/MacOS/Godot --headless --path /tmp/ravageous --export-debug Release_IOS /tmp/ravageous/releases/ravageous.ipa

build.log

Basically, this is the error, which is the same as #90168

ld: multiple errors: file cannot be mmap()ed, errno=22 path=ravageous/dylibs/bin/libRavageousLibrary_ios.framework/libRavageousLibrary_ios in 'ravageous/dylibs/bin/libRavageousLibrary_ios.framework/libRavageousLibrary_ios'; file cannot be mmap()ed, errno=22 path=ravageous/dylibs/bin/ios/libtbb.framework/libtbb in 'ravageous/dylibs/bin/ios/libtbb.framework/libtbb'; file cannot be mmap()ed, errno=22 path=ravageous/dylibs/bin/ios/libjuice.framework/libjuice in 'ravageous/dylibs/bin/ios/libjuice.framework/libjuice'; file cannot be mmap()ed, errno=22 path=ravageous/dylibs/bin/ios/libtbbmalloc.framework/libtbbmalloc in 'ravageous/dylibs/bin/ios/libtbbmalloc.framework/libtbbmalloc'

I built godot-cpp using OSXCross, something like:

IOS_SDK_VERSION=17.5
IOS_SDK=iPhoneOS17.5.sdk
IOS_TRIPLE=arm-apple-darwin11
IOS_TOOLCHAIN_ROOT=/opt/osxcross/build/cctools-port/usage_examples/ios_toolchain/target
IOS_SDK_MINIMUM=12.0

 AR=$IOS_TRIPLE-ar CC="$IOS_TRIPLE-clang -fuse-ld=$IOS_TOOLCHAIN_ROOT/bin/$IOS_TRIPLE-ld" CODESIGN_ALLOCATE=$IOS_TOOLCHAIN_ROOT/bin/$IOS_TRIPLE-codesign_allocate CPLUS_INCLUDE_PATH=$IOS_TOOLCHAIN_ROOT/include CXX="$IOS_TRIPLE-clang++ -fuse-ld=$IOS_TOOLCHAIN_ROOT/bin/$IOS_TRIPLE-ld" C_INCLUDE_PATH=$IOS_TOOLCHAIN_ROOT/include HOST=$IOS_TRIPLE LIBRARY_PATH=$IOS_TOOLCHAIN_ROOT/lib PATH=$IOS_TOOLCHAIN_ROOT/bin:$PATH RANLIB=$IOS_TRIPLE-ranlib  cmake -DCMAKE_TOOLCHAIN_FILE=$IOS_TOOLCHAIN_ROOT/iOS.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Ofast" -DCMAKE_C_FLAGS="-Ofast" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=$IOS_TOOLCHAIN_ROOT  -DAPPLE=1 -DGODOT_CPP_WARNING_AS_ERROR=OFF -DGODOT_CPP_SYSTEM_HEADERS=ON -DFLOAT_PRECISION=single -B /tmp/11773e52b0c66b86a64a4e17b41714bcd3e12813/build_IOS_ARM64 /tmp/11773e52b0c66b86a64a4e17b41714bcd3e12813 

Here is the output of my .gdextension file:

[configuration]

entry_symbol = "ravageous_init_extension"
compatibility_minimum = 4.1

[libraries]

linux.x86_64 = "res://bin/libRavageousLibrary.linux_x86_64.so"
windows.x86_64 = "res://bin/libRavageousLibrary.windows_x86_64.dll"
windows.x86_32 = "res://bin/libRavageousLibrary.windows_x86_32.dll"
android.arm64 = "res://bin/libRavageousLibrary.android_arm64-v8a.so"
android.arm32 = "res://bin/libRavageousLibrary.android_armeabi-v7a.so"
android.x86_32 = "res://bin/libRavageousLibrary.android_x86.so"
android.x86_64 = "res://bin/libRavageousLibrary.android_x86_64.so"
macos.release = "res://bin/libRavageousLibrary.dylib"
macos.arm64 = "res://bin/libRavageousLibrary.dylib"
macos.x86_64 = "res://bin/libRavageousLibrary.dylib"
ios.arm64 = "res://bin/libRavageousLibrary_ios.dylib"

[dependencies]

ios.arm64 = {
    "res://bin/ios/libtbb.dylib": "",
    "res://bin/ios/libtbbmalloc.dylib": "",
    "res://bin/ios/libjuice.dylib": ""
}

I've attached my ios dylib dependencies here: libs.zip

Steps to reproduce

In the .gdextension file, add the following lines:

ios.arm64 = "res://bin/libRavageousLibrary_ios.dylib"

[dependencies]

ios.arm64 = {
    "res://bin/ios/libtbb.dylib": "",
    "res://bin/ios/libtbbmalloc.dylib": "",
    "res://bin/ios/libjuice.dylib": ""
}

I've attached the related dylib files.

Export the ios project, and you'll see the error:

/Applications/Godot.app/Contents/MacOS/Godot --headless --path /tmp/ravageous --export-debug Release_IOS /tmp/ravageous/releases/ravageous.ipa

Minimal reproduction project (MRP)

N/A

Happy to provide any other information anyone needs. Thanks

AThousandShips commented 3 months ago

This is already fixed, but isn't in rc3 which was released before that report

Closing as a duplicate of https://github.com/godotengine/godot/issues/90168

If you can reproduce this on master with that fix this can be reopened