[SciPy-Dev] Disable rpaths in shared objects when cross compiling

Ralf Gommers ralf.gommers at gmail.com
Sun Mar 1 14:35:28 EST 2020


On Thu, Feb 27, 2020 at 10:46 PM Greg Anders <greg at gpanders.com> wrote:

> Hi all,
>
> I'm cross compiling Scipy in Yocto Linux for an embedded platform. I'm
> able to compile Scipy, but Yocto is giving me warnings because the
> shared objects are linked with the -rpath flag using absolute paths on
> the build host. I'd like to disable the -rpath flag when linking the
> shared objects, but I'm not sure how to do that.
>
> I've dug through the numpy.distutils code and I found the following in
> the CCompiler_customize_cmd function:
>
>      if allow('rpath'):
>          self.set_runtime_library_dirs(cmd.rpath)
>
> So it *looks* like if I can pass 'rpath' into the optional `ignore`
> paramater to the `customize_cmd` function, numpy will not use the -rpath
> flag when linking.
>
> However, it's not clear to me how to _use_ the `ignore` parameter of
> `customize_cmd`. All usages of `customize_cmd` in build_ext.py only use
> a single parameter, so `ignore` is always set to the default value of an
> empty tuple.
>
> Is there an easier way to disable rpaths than patching numpy.distutils
> to path `ignore=('rpath')` as a second parameter to `customize_cmd`?
>

Hi Greg, the not so great news is that cross-compiling is in general not
well-supported by distutils. I don't have an answer to your specific
question, but I do want to point you to an issue where people were
discussing Yocto cross-compiling: https://github.com/scipy/scipy/issues/8571.
Hopefully that's of help.

Cheers,
Ralf



> Thanks!
>
> Greg
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20200301/3b68e550/attachment.html>


More information about the SciPy-Dev mailing list