libOpenCL.so.1 fails out of the box on Ubuntu on Windows (WSL)

libOpenCL.so.1 has the execstack flag set, although it does not seem to require execstack. WSL does not support PROT_GROWSDOWN and so using the library fails until the bit is cleared with execstack -c.

It is exceedingly likely that this is an artefact of the GNU tool chain. When assembly files (.S or .s) are used, then the GNU tool chain defaults to requesting execstack on Linux and FreeBSD.

I have helped fix this upstream for Swift and the dyncall library. It’s a reasonably trivial fix.
I’d be happy to assist here, too. I have no experience with the NVidia openCL project, however. You’d need to point me towards the right person to talk to, and we can get it done.

The discussion about execstack and WSL lives here: fis-gtm does not run due to missing support for executable stack · Issue #286 · microsoft/WSL · GitHub