Add RTLD_DEEPBIND flag to dlopen mode #2247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
By default, internal dependences of a library loaded with
dlopen
are resolved using the global lookup scope first. If there are already matched symbols in the global scope, internal calls in the library that are supposed to use its local functions, will be linked to some external code, which is usually results in segmentation faults when the library is used. This is particularly true for thelibharfbuzz.so.0
, that is often present in the system, exports the same symbols aslibHarfBuzzSharp.so
and is implicitly used by some dependencies ofmono
ordotnet
. To avoid such conflicts, there is a flag RTLD_DEEPBIND inglibc
since version 2.3.4. Earlier versions do not check the mode argument for unknown flags, andmusl
does not check it either. So just adding this flag to the mode appears to be quite harmless.Bugs Fixed
API Changes
None.
Behavioral Changes
None.
Required skia PR
None.
PR Checklist