[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rpaths



> So now I have much more useful logs, which let me
> fix various things, so I have a tensorflow package-set with no lintian
> errors. yay!

That sounds great! 

> However, it's not helping much with the rpath thing because neither
> the string 'rpath' nor the value it gets set to ('ORIGIN' or
> '_U_S_Stensorflow_Clibtensorflow_Ucc') appears anywhere in the
> log. Which is odd, as there are still rpaths in the final .so files.

About the remaining rpath options, I guess it comes from:
https://cs.opensource.google/bazel/bazel/+/master:tools/cpp/unix_cc_toolchain_config.bzl;l=478?q=%22rpath%22%20file:.bzl&ss=bazel
(BTW, I recommend using https://cs.opensource.google/bazel/bazel to search bazel source code, a similar one also exists for tensorflow, it's almost identical to our internal code search tool. Syntax reference)

I thought it should only be used for cc_test, and I'm not sure how it ends up in tensorflow_cc.

The linking command should also be printed by the `-s` option. The reason you didn't see it in the log might be the link command uses a parameter file.
You should be able to check its content somewhere like ./baze-bin/tensorflow/libtensorflow_cc.so-2.params

Hope this helps!



On Thu, May 27, 2021 at 2:44 PM Wookey <wookey01@arm.com> wrote:
On 2021-05-26 18:03 +0200, Yun Peng wrote:
>    On Wed, May 26, 2021 at 5:46 PM Wookey <wookey@wookware.org> wrote:

> > Currently my build log shows all the warnings, but no compile
> > commands.

> If you want to see the compile commands, you can use the "-s"
> option,

Thanks (I did work this out myself in the meantime, but this is indeed
just what I wanted). So now I have much more useful logs, which let me
fix various things, so I have a tensorflow package-set with no lintian
errors. yay!

However, it's not helping much with the rpath thing because neither
the string 'rpath' nor the value it gets set to ('ORIGIN' or
'_U_S_Stensorflow_Clibtensorflow_Ucc') appears anywhere in the
log. Which is odd, as there are still rpaths in the final .so files.

Now rpath is set at link time (via -Wl) so is strictly a linker
option, not a compiler option. Is there perhaps some setting for 'show
me linker commands' too? (although the tensorflow.bzl file seems to be
setting them via -Wl so it should appear in the compiler
commands, however maybe we've killed that but there is still some
default linker config which is making sure rpaths get put in - I don't
know).

I'm just going to use chrpath -d for now, but it would be good to
understand what's going on here (and it helps me learn how to grok
bazel builds)

> > $ chrpath libtensorflow_cc.so.2.3.1
> > libtensorflow_cc.so.2.3.1:
> >    RUNPATH=$ORIGIN/../_solib_k8/_U_S_Stensorflow_Clibtensorflow_Ucc.so.2.3.1___Utensorflow:$ORIGIN/
> > $ chrpath libtensorflow_framework.so.2.3.1
> > libtensorflow_framework.so.2.3.1: RUNPATH=$ORIGIN/

Wookey
--
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/

Reply to: