Commit 0994fba
Do not escape $ORIGIN at least on Android
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 @mdavidsaver1 parent e07b12f commit 0994fba
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
| 287 | + | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| |||
0 commit comments