Do not escape $ORIGIN at least on Android#44
Merged
mdavidsaver merged 1 commit intoepics-base:masterfrom Mar 2, 2026
Merged
Conversation
Commit a83de88 ($ORIGIN escaping, 2018) added \$ORIGIN/... to built DSO/Extension with the reason that # Some versions of GCC will expand shell macros _internally_ when # passing arguments to 'ld', and need '\$ORIGIN'. And some versions don't, # and fail with '\$ORIGIN'. # Presumably this was a bug in gcc-wrapper which was fixed at some point. # # So what to do? # For lack of a better idea, give both versions and hope that the non-functional # one is really non-functional. That does not create issues on regular Linux, but on Android it leads to the following warnings issued by system dynamic linker: ((1.venv) ) poco:~/setuptools_dso/example/src$ python -m dsodemo.cli WARNING: linker: Warning: unable to normalize "\/data/data/com.termux/files/home/setuptools_dso/example/src/dsodemo/ext/../lib" (ignoring) WARNING: linker: Warning: unable to normalize "\/data/data/com.termux/files/home/setuptools_dso/example/src/dsodemo/ext/../lib" (ignoring) From foo.c From bar.cpp I would say the proper fix would be to drop that $ORIGIN escaping completely, but trying to preserve backward compatibility we can leave it on applied only selectively if the linker is indeed GCC. This fixes the issue on Android/Termux because there the compiler is CLang. After this patch the warnings are gone: ((1.venv) ) poco:~/setuptools_dso/example/src$ python -m dsodemo.cli From foo.c From bar.cpp /cc @mdavidsaver
mdavidsaver
approved these changes
Mar 2, 2026
Member
mdavidsaver
left a comment
There was a problem hiding this comment.
This seems a reasonable way to handle a situation which should be increasingly historical.
Contributor
Author
|
Thanks, Michael. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit a83de88 ($ORIGIN escaping, 2018) added $ORIGIN/... to built DSO/Extension with the reason that
That does not create issues on regular Linux, but on Android it leads to the following warnings issued by system dynamic linker:
I would say the proper fix would be to drop that $ORIGIN escaping completely, but trying to preserve backward compatibility we can leave it on applied only selectively if the linker is indeed GCC. This fixes the issue on Android/Termux because there the compiler is CLang.
After this patch the warnings are gone:
/cc @mdavidsaver