[Libreoffice] ld dynamic linker hash style

Michael Meeks michael.meeks at novell.com
Tue Apr 5 03:53:55 PDT 2011


Hi Francois,

On Mon, 2011-04-04 at 22:51 +0200, Francois Tigeot wrote:
> During the last few days, my builds have been broken with this error message:
>   makedepend: Shared object has no run-time symbol table

	Oh - that is a downer indeed. What system are you using ?

> It adds the "--hash-style=gnu" string on ld invocations.
> --hash-style=gnu sets the type of linker's hash tables to a new ".gnu.hash"
> format.

	Right - if your gcc supports that, presumably your system library
should too [ after all, it is trivial to implement, and a huge speedup
for linking ].

> The problem is, this flag also prevents ld to write classic ELF ".hash"
> sections, preventing some systems to be able to run the generated binaries.

	Right - because they are big, and there is not much point in dragging
all that obsolete bloat around ;-)

> One of my machines is using binutils-2.21 and cannot run binaries linked with
> the --hash-style=gnu option. I need to investigate.

	So - if you want to create binaries to run on other systems, then you
need to beware. You will have hideous problems beyond belief, and way
beyond just linking issues: glibc symbol versions alone will break
almost everything :-)

> Howewer, the fix is quite simple: replace --hash-style=gnu by
> --hash-style=both The --hash-style=both option generates both old
> and new-style sections, keeping all binutils happy.

	Well - we need to do this for the 'Generic' builds with an explicit
=both (cf. distro-configs) so it can run even on ancient systems, but
Linux distributions in general should use the --hash-style=gnu if it is
present in the toolchain (IMHO).

> The attached patch does just that.

	So - I'm really not convinced :-) What system are you compiling on,
and/or did you upgrade your gcc/binutils without upgrading glibc ?

	I guess it might be a good idea to default to 'auto' for hash-style,
and compile and link a small test program with that, defaulting to 'gnu'
if that is supported, and no flag if not. Should be fairly easy to do
that with an AC_TRY_RUN (?).

	ie. since the win from --hash-style=gnu is fairly huge, I'd like to
have this by default wherever possible, --hash-style=both adds some real
chunk of data we don't need to the output, so it is not a great default
for a fast office suite :-)

	ATB,

		Michael.

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the LibreOffice mailing list