Hide Blender symbols by default on all platforms #76442
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76442
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The purpose of this task is to hide Blender symbols by default on all platforms, where previously it was only done on Windows.
Related reports that are solved by hiding symbols, and there have been various others in the past.
One solution would be compiling all external libraries with
-fvisibility=hidden
, however the simpler solution seems to be to use a symbol map to hide all symbols except a few required ones.Status:
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @brecht, @Sergey
What might also help here is to use
RLTD_DEEPBIND
when loading libraries, so that those libraries use their own symbols over global symbols from Blender.This could be done in clew and Python (with
sys.setdlopenflags
).Will this break
ctypes
usage in Python scripts?RLTD_DEEPBIND
seems fine to just go ahead and do it. Just make sure this is done in upstream, covering the generator templates. Think you have commit access to all wranglers we use.What is also not clear to me is whether anything special is to be done with Python modules (
_ssl.so
for example). Are they not pulling symbols to global scope already? Is it controlled withsys.setdlopenflags
? Or do we need to compile all dependencies with hidden visibility?If
ctypes
is being used to access Blender symbols, that will indeed break. However that already would not have worked on Windows, so I guess none of the commonly used add-ons/plugins rely on it?RTLD_DEEPBIND
didn't seem to help in #68052. But probably it's the right thing to do regardless.From my understanding
RTLD_DEEPBIND
is about preferring local symbols over globals ones when binding symbols. So for example if a Luxrender add-on Python module uses OpenImageDenoise, it would use its own version rather than Blender's.sys.setdlopenflags
sets the default flags used when loading Python modules. I don't think this matters much for bundled Python modules like ssl, it's for add-ons that ship binary Python modules.Did you use
RTLD_DEEPBIND
,RTLD_NOW | RTLD_DEEPBIND
orRTLD_LAZY | RTLD_DEEPBIND
?The reason our tweaks might not have helped is because the driver might be doing library load, and then you have collision of symbols in the whatever ICD is loading.
In Python I remember having all symbols which are not
Py*
,_Py*
,_py*
be hidden. The reason of this was conflict with some of the addon which was loading another .so. Apparently, this mapping file got lost when we've switched tomake deps
for the release environment. So we either need to restore this mapping file, or use hidden visibility for Python as well. Do you have strong opinion on this topic?This issue was referenced by
f937c186de
Added subscriber: @xavierh
This issue was referenced by
cfd16c04f8
Build with -fvisibility=hidden on Linux and macOSto Hide Blender symbols by default on all platforms