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

Static build #27

Open
dimerr opened this issue Jan 2, 2025 · 1 comment
Open

Static build #27

dimerr opened this issue Jan 2, 2025 · 1 comment

Comments

@dimerr
Copy link
Collaborator

dimerr commented Jan 2, 2025

Hello, i assume with all the tricky stuff in hal with dlopen/dlsym, static build is close to impossible without rewriting eveyrthing?

@wberube
Copy link
Member

wberube commented Jan 5, 2025

Good evening and really sorry for the delay of response!

I have been thinking of a couple solutions in order to provide static builds and retain the dynamic linking with manufacturer userspace libraries. foreign-dlopen by pfalcon (worth reading in order to better understand the inner workings) or the implementation that was designed for Cosmopolitan libc (a brillant hack that produces multi-platform executables which inevitably need the same functionality present) are both great examples of how this could be done.

If the plan is to link the resulting executables to static libraries, then I guess we wouldn't have a choice but to rewrite the dlsym calls in the headers included under each platform's *_hal.h using zero-cost inline declarations in order to reduce to a minimum the number of modifications needed.

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

2 participants