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

Explore interface libraries #2

Open
ericoporto opened this issue Jun 3, 2024 · 0 comments
Open

Explore interface libraries #2

ericoporto opened this issue Jun 3, 2024 · 0 comments

Comments

@ericoporto
Copy link
Owner

The idea of using dynamic loading is to not require steam libraries when building but also to make the library more resilient. If that isn't possible for some reason, another strategy is to explore interface library, which would have stubs and then one would be able to switch it by the real library later

From libsdl-org/SDL#9580

Not a dumb idea at all. It ties to this issue with the satellite libraries. I remembered this old Phoronix article about llvm creating interface libraries and tried it on the SDL library.

llvm-ifs --input-format=ELF libSDL3.so.0 --output-ifs libSDL3.txt

generates this file.

I pruned all non-SDL symbols and ran the following command:

llvm-ifs --endianness=little --arch=x86_64 --bitwidth=64 --input-format=IFS libSDL3.pruned.txt --output-elf libSDL3_ifs.so

Compiling and linking a SDL test executable against this interface library results in a working executable:

gcc ../test/testutils.c ../test/testsprite.c -I ../include libSDL3_test.a  -lunwind libSDL3_ifs.so -Wl,-rpath,$PWD

The only issue with the interface library is that:

The caveat is Steam and Galaxy are C++ APIs do things may have further complications...

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

1 participant