-
Notifications
You must be signed in to change notification settings - Fork 479
Fix GL stub symbol conflicts for 16KB page size support #545
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
Fix GL stub symbol conflicts for 16KB page size support #545
Conversation
… fix 16KB page size symbol conflicts Co-authored-by: wysaid <[email protected]>
cgeGL3Stub.* cgeGL31Stub.* 系列文件的符号冲突。 下面是具体描述
背景: 谷歌要求所有的 app 支持 16kb page size. 应谷歌要求, 本项目也支持了编译支持 16kb page size 的版本。 但在...|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@copilot |
…der dependency Co-authored-by: wysaid <[email protected]>
You're absolutely right! I've moved the |
|
@copilot 目前关于 CGE_NO_EXPORT 放置的位置还是有一些奇怪。
#ifndef CGE_NO_EXPORT
#if defined(__ANDROID__)
#define CGE_NO_EXPORT __attribute__((visibility("hidden")))
#else
#define CGE_NO_EXPORT
#endif
#endif这样可以防止重复定义。
|
…finitions Co-authored-by: wysaid <[email protected]>
... I've addressed all the issues you mentioned:
The solution prevents duplicate definitions while ensuring all files have access to the macro without creating circular dependencies. The macro is now properly defined with platform-specific visibility attributes to fix the 16KB page size symbol conflicts. English summary: Fixed Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Android 15 introduced support for 16KB page sizes, which causes symbol conflicts in OpenGL ES function pointer declarations when apps use the new page size configuration. The issue occurs because GL stub files export symbols that conflict with system GL implementations, leading to runtime errors and crashes on devices with 16KB page size enabled.
Problem Analysis
The root cause was identified as follows:
cgeGL3Stub.h,cgeGL31Stub.h) usedGL_APICALLfor function pointer declarations, which exports symbols publiclycgeGlobal.h→cgePlatform_ANDROID.h→cgeGL*Stub.h→cgeCommonDefine.h→cgeGlobal.hCGE_NO_EXPORTbut didn't have access to its definitionSolution
GL_APICALLtoCGE_NO_EXPORTto hide symbols from external linkage#ifndefguards to prevent duplicate definitions incgePlatform_ANDROID.hcgeGL3Stub.handcgeGL31Stub.hto avoid circular dependenciescgeCommonDefine.hTechnical Details
The
__attribute__((visibility("hidden")))directive ensures that GL function pointers are not exported from the shared library, preventing conflicts with system GL implementations when 16KB page sizes are used. This approach maintains compatibility while fixing the symbol collision issue.Files Modified
cgePlatform_ANDROID.h: Added#ifndefguards to macro definitioncgeGL3Stub.h: Added macro definition and replacedGL_APICALLwithCGE_NO_EXPORTcgeGL31Stub.h: Added macro definition and replacedGL_APICALLwithCGE_NO_EXPORTcgeGL3Stub.c: Function pointer definitions now useCGE_NO_EXPORTcgeGL31Stub.c: Function pointer definitions now useCGE_NO_EXPORT✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.