[lsb-discuss] FW: News to me: --hash-style=gnu

Bastian, Waldo waldo.bastian at intel.com
Tue Jul 10 11:57:36 PDT 2007


Didn't see this mentioned here yet... probably worth a FAQ entry.

Cheers,
Waldo
 
Intel Corporation - Platform Software Engineering, UMG - Hillsboro,
Oregon

----- Forwarded message from ... -----

> Turns out that the difficulties getting pvm to run were not just
> pvm problems.  There is a bizarre problem where every program, even
> "Hello World" built on Mandriva 2007.1 (gcc 4.1.2,2.6.17-14mdv) 
> will not run on Mandriva 2007.0 (gcc 4.1.1, 2.6.19.3).

Google with strings from the back trace messages showed
that this was a known issue. New distributions such as Mandriva
2007.1 and FC7 default to a new linker mode:

  --hash-style=gnu

Unfortunately ld in older distros has no clue what this is
and treats the binary as if it had the older

  --hash-style=sysv

resulting in "floating point exception" (which is a bit of a
red herring in terms of figuring out why the program won't run)
and a core dump.  The newer version of ld still knows
about the older hash-style, so old binaries work on the newer
systems. 

To build a binary on the newer system that can run on the
older one use either:

  gcc -g  -o hello -Wl,--hash-style=sysv hello.c

or

  gcc -g  -o hello -Wl,--hash-style=both hello.c

----- End forwarded message -----




More information about the lsb-discuss mailing list