-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update some info in the readme #62
Conversation
I think it can be useful to keep the section on Not sure what's wrong with musl though! What's the discussion you're mentioning? On which Discord? |
Apologies, here's the thread: https://discord.com/channels/385916768696139794/386181213699702786/824072591881797662 I'd be happy to have My impression is that statically linking |
Alright I fixed building with musl (works for rM device v1) in #64 and hinted a bit more on Regarding
|
Cool. Just tinkered around a bit and made a draft that can explicitly check for and call the for LD_PRELOAD intended functions of rm2fb. This would remove the requirement of setting LD_PRELOAD altogether. The draft is very basic though. It's very inefficient (always looking up the ioctl symbol again) and doing a lot of dirty debug printing I used for testing. I also didn't bother using rm2fb's close method (which could be problematic for some applications as rm2fb only ever expects one fd for /dev/fb0). But this may serve as a bases for explicitly using the lib. Feel free to do whatever you want with this poc. I personally don't plan on continuing on it in the foreseeable future and don't care what happens with that at all. Here is a compiled version of the demo example. It'll work as long as the lib is present at I also built a custom version of the rm2fb package that has lots of print debugging (source). (cc @raisjn) |
Just gave @fenollp's musl build a try. The shim doesn't work on it indeed since no interpreter (usually some linux-ld library) is declared at all and this preventing any ld based interception. The above poc could for example only be enabled on musl builds to make them still work with the shim. |
Hey thanks for this. Is everything alright with you? your language seems kind of harsh. This is a pretty sic PoC if you ask me :) I'll definitely continue your work. |
Sorry for that. Had a long day and wanted to make it clear that there is no issue in coping/using it at all. I'm sorry if that came forth as harsh. I didn't proof-read that message and it seems harsh indeed.
I gave lazily getting the For the close I was more concerned that rust will issue a normal close once Framebuffer gets dropped. If a library would for some reason want to reopen it afterwards, rm2fb wouldn't have expected the fd to be closed. Implementing A quick test also turned out that this won't work easily for a musl build. My guess is that libloader uses ld itself. Should we be able to add libloaders dependencies statically I'm not sure how this would be for loading rm2fb. It would probably require to at least load libc again anyway. Maybe creating a rm2fb rust crate with the option to use either a dynamically linked library (rust *-sys crate) or vendoring it would be useful for musl. I thinking of how openssl is done. You can specify the "vendored" feature to get it compiled into the rust binary. As of now the poc can only serve to remove the need of using LD_PRELOAD. Not sure how useful that is. EDIT: Giving the mentioned musl faq a look. It seems that we may just need to tweak something to get |
That is definitely a very cool direction... seems like it would make adopting the library and cross-building for RM1 & RM2 much simpler. (From my perspective the main appeal of the Do folks think this PR is worth landing in the meantime? Or should I close and open a new issue for the |
Yeah. I think that the |
This is possible today (no musl involved). Works for rM1 & rM2:
This only requires
Mentioned in my PR. Thanks |
Yep, figured this out eventually... but it wasn't clear when I was first learning this stuff a couple months back!
I restored the section on Maintainers should be allowed to edit this branch, so if there are tweaks to the wording you prefer feel free to make them directly! |
Ah, just saw the latest commits in #64, which covers this and more... will close this one down. Thanks for the discussion! |
Opened #65 as a tracking issue for the LD_PRELOAD-less approach! |
As discussed in Dischord!
I dropped the entire musl section for now - we can always bring it back if we find instructions that work, but for now having it in seems confusing.
Also added a couple minor tweaks, like pointing to the wiki for the toolchain while that's in limbo.