On Thu, 2019-10-10 at 18:41 +0200, Florian Weimer wrote: > > * Steve Ellcey: > > > I would like these used by default so I took some ideas from > > --with-advance-toolchain and used that to automatically add these options > > to LINK_SPEC (see attached patch). I can compile and link a program with > > this setup, but when I run the program I get: > > > > % ./x > > Inconsistency detected by ld.so: get-dynamic-info.h: 147: > > elf_get_dynamic_info: > > Assertion `info[DT_RPATH] == NULL' failed! > > > > I am not sure why this doesn't work. Can anyone help me understand > > why this doesn't work or help me figure out how else I might be able to > > get the functionality I want. That is: to use shared libraries and a dynamic > > linker (at run time) that are in a non-standard location without needing > > to compile or link with special flags. > > An argument could be made that if ld.so has DT_RPATH set, > LD_LIBRARY_PATH would stop working, which would be a bug. Hence the > assert. It's probably less an issue for DT_RUNPATH. > > The real fix would be to make sure that ld.so isn't built with those > dynamic tags. If ld.so wants to use an alternative search path, that > should be baked into the loader itself, explicitly. > > Do you know where those dynamic tags originate? Is there some wrapper > script involved that sets them unconditionally?
I am not sure, but my guess is that it is because I am building binutils (including ld) using --with-sysroot. I build both GCC and binutils with the sysroot directory where I put the glibc that I am building. Maybe I should try building GCC with --with-sysroot but build binutils without it. Steve Ellcey sell...@marvell.com