Implib.so icon indicating copy to clipboard operation
Implib.so copied to clipboard

Add support for the POWER architecture

Open hawkinsp opened this issue 1 year ago • 6 comments

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.)

hawkinsp avatar Mar 11 '24 13:03 hawkinsp

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 avatar Mar 11 '24 19:03 yugr

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.

yugr avatar Mar 17 '24 10:03 yugr

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

hawkinsp avatar Mar 27 '24 15:03 hawkinsp

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 avatar Mar 27 '24 16:03 yugr

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 supports functions with up to 16 parameters
  • and is inefficient

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.

yugr avatar Mar 27 '24 17:03 yugr

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

hawkinsp avatar Mar 27 '24 17:03 hawkinsp