Skip to content
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

LD_PRELOAD doesn't work with some binaries from toltec #37

Open
Witos opened this issue Dec 22, 2020 · 4 comments
Open

LD_PRELOAD doesn't work with some binaries from toltec #37

Witos opened this issue Dec 22, 2020 · 4 comments

Comments

@Witos
Copy link

Witos commented Dec 22, 2020

reMarkable: /opt/lib/ LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.0 grep ERROR: ld.so: object '/opt/lib/librm2fb_client.so.1.0.0' from LD_PRELOAD cannot be preloaded (internal error): ignored. Usage: grep [OPTION]... PATTERNS [FILE]... Try 'grep --help' for more information.

reMarkable: /opt/lib/ file which grep /opt/bin/grep: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /opt/lib/ld-linux.so.3, for GNU/Linux 3.2.0, stripped

LD_PRELOAD works fine with the busybox grep:
reMarkable: /opt/lib/ LD_PRELOAD=/opt/lib/librm2fb_client.so.1.0.0 busybox grep BusyBox v1.30.1 (2020-11-04 10:42:32 UTC) multi-call binary. Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

reMarkable: /opt/lib/ file /bin/busybox.nosuid /bin/busybox.nosuid: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=e9c75f6d853dde1bbf974fdf11daa3493f4eadde, stripped

I suspect it's a matter of the interpreter. If it's ld-linux-armhf.so.3, it works fine, if it's /opt/lib/ld-linux.so.3 it shows error.

@raisjn
Copy link
Collaborator

raisjn commented Dec 22, 2020

wow, thanks for the investigation!

the good news is that /opt/lib/ld-linux.so.3 is an artifact of Entware (i believe). Any packages relying on that interpreter will not be remarkable specific (or even trying to draw to framebuffer), so while this is a noisy error, it isn't affecting actual behavior (usually)

@Eeems
Copy link
Collaborator

Eeems commented Jan 1, 2021

I'm guessing there is no way to work around this? It's an annoying warning.

@raisjn
Copy link
Collaborator

raisjn commented Jan 19, 2021

one workaround proposed by @LinusCDE is to clear LD_PRELOAD path before calling out to binaries from entware that are linked against /opt/lib. this will help suppress some warnings but not all of them.

there is also the question of whether re-linking toltec binaries against the same location (/opt/lib/) will fix things. the main issue is that xochitl is still pointing to /lib. if we can have one client.so for xochitl (and /lib) and one client.so for toltec (and /opt/lib), i think this would resolve things.

@Eeems
Copy link
Collaborator

Eeems commented Jan 19, 2021

one workaround proposed by @LinusCDE is to clear LD_PRELOAD path before calling out to binaries from entware that are linked against /opt/lib. this will help suppress some warnings but not all of them.

This is a per-application solution though, and not something that rm2fb handles itself.

there is also the question of whether re-linking toltec binaries against the same location (/opt/lib/) will fix things. the main issue is that xochitl is still pointing to /lib. if we can have one client.so for xochitl (and /lib) and one client.so for toltec (and /opt/lib), i think this would resolve things.

That's probably the best idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants