cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
5.52k stars 1.58k forks source link

Glslang libs doesn't support iOS 12, the iOS deployment target is 14.5 #14093

Open kylescf2 opened 1 year ago

kylescf2 commented 1 year ago

Cocos Creator version

3.6.2, 3.6.3, 3.7.0

System information

iOS 12

Issue description

We find that glslang libs used by Cocos engine are build on iOS 14.5. We make a static library with version 3.6.2 engine code, and encounter crashes on startup with iOS 12 devices. We revolve the problem by compiling the glslang source code (version 11.5) with iOS 12.0. So we expect Cocos team can update the libs compatible for iOS 12.0.

For details, we find the Symbol "_chkstk_darwin" is in libMachineIndependent.a(glslangtab.cpp.o)). When compiled with deployment target iOS 12.0, chkstk_darwin is not shown. We use some command tools below to find symbols.

lipo libMachineIndependent.a -thin arm64 -output arm.a ar -x arm.a nm -g glslang_tab.cpp.o > nm2.txt

Relevant error log output

Xcode output when launching app: dyld: Symbol not found: ___chkstk_darwin Referenced from: /var/containers/Bundle/Application/165B679C-82B1-45A1-A4E6-DC084E7F9626/Runner.app/Runner Expected in: /usr/lib/libSystem.B.dylib in /var/containers/Bundle/Application/165B679C-82B1-45A1-A4E6-DC084E7F9626/Runner.app/Runner

Steps to reproduce

Steps to show the Xcode warning:

  1. Download Cocos Creator 3.6.2
  2. Create an empty template project Cocos Creator , Export an iOS project
  3. Open the iOS project with Xcode and build the app, in Xcode click "Show the Report Navigator" to see build logs (Filtering for "_tab".), and you will find logs below.

Showing All Messages, Filtering for "_tab". Object file (/Applications/CocosCreator/Creator/3.6.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/external/ios/libs/glslang/libMachineIndependent.a(glslang_tab.cpp.o)) was built for newer iOS version (14.5) than being linked (12.0)

Minimal reproduction project

No response

pandamicro commented 1 year ago

@PatriceJiang please take a look

minggo commented 11 months ago

As cocos supports iOS 11+, so should compile with iOS 11.

mmyduckx commented 11 months ago

@bluesky013 Please consider recomplie lib glslang. Considering that 3.8.1 is ready to release, postpone this issue to the next version.