yugr / Implib.so

POSIX equivalent of Windows DLL import libraries
MIT License
229 stars 33 forks source link

Add support for the POWER architecture #35

Closed hawkinsp closed 5 months ago

hawkinsp commented 8 months ago

Our project (JAX) uses implib.so internally, and one of our end users asked for POWER architecture support, which requires POWER support in implib.so. It'd be great if POWER support were added!

(By the way: thanks for this project, it's incredibly useful! We use it to ship Python wheels that refer to NVIDIA's CUDA libraries while obeying the Python manylinux2014 rules, which only allow direct dynamic linking against a small allowlist of libraries.)

yugr commented 8 months ago

Hi Peter, thank you, I'm very excited to hear that the project was useful for you! I'll take a look at Power support this week.

yugr commented 8 months ago

I've added initial support for 64-bit PowerPC (let me know if 32-bit support is needed). PowerPC ABI is a bit complicated so it would be really great if someone with low-level PowerPC expertise could review my changes.

hawkinsp commented 7 months ago

Thanks for doing this! I'll plumb it through in our project and see if it makes the end user happy.

yugr commented 7 months ago

Thanks for doing this! I'll plumb it through in our project and see if it makes the end user happy.

Please give me couple of days, there is a bug in big-endian ABI (powerpc64-linux-gnu target) which I'm currently aware of (more modern powerpc64le-linux-gnu target is ok).

yugr commented 7 months ago

Thanks for doing this! I'll plumb it through in our project and see if it makes the end user happy.

Please give me couple of days, there is a bug in big-endian ABI (powerpc64-linux-gnu target) which I'm currently aware of (more modern powerpc64le-linux-gnu target is ok).

Ok, I partially worked around the issue with big-endian powerpc64-linux-gnu. Support for this target is still limited:

It would be great if someone with low-level PowerPC expertise could suggest a better way to implement a trampoline mechanism for powerpc64-linux-gnu.

hawkinsp commented 7 months ago

Happily for my use case we only support ppc64le anyway, so this part doesn't block me personally.