Binary Compatibility Issue between Linux Distributions and Versions

5 comments

I was recently working with a Third-Party ISV that had run into an issue of binary compatibility with their application they built on RHEL 5 while running it on SUSE Linux Enterprise 10.  I wanted to point this out for any other developers that may run into this issue.  When they built their C and C++ applications on RHEL 5 and ran it on SLES 10, they would get a "Floating Point Exception".  This problem also exists between RHEL 4 and RHEL 5.  It turned out that there was a change in the hash style of the ELF format generated with newer versions of GCC.

 

To make binaries that are compatible across distributions, developers need to use the linker flag '--hash-style=sysv' when building their application.  For example;

 

> gcc helloworld.c -Wl,--hash-style=sysv -o helloworld

 

Avinesh from IBM has a good description of the issue on his blog.

 

4
Average: 4 (3 votes)
Link to mail list archive for the patch to the gnu hash style. - Submitted by Darren Davis on Thu, 08/28/2008 - 19:47.

For those that want more information, you can read about the patch in the mail list archives.

http://sources.redhat.com/ml/binutils/2006-06/msg00418.html

Darren R. Davis

Technical Product Manager

Novell Open Platform Solutions

http://www.novell.com/linux

 

Nice point Darren - Submitted by Amanda McPherson on Mon, 08/25/2008 - 03:18.

This is useful stuff.

LSB followup - Submitted by Darren Davis on Thu, 08/28/2008 - 17:09.

As a note for the ISVs that are using the LSB SDK, 'lsbcc' sets the hash style to sysv automatically. Another good reason to use the LSB SDK for building applications.

Darren R. Davis

Technical Product Manager

Novell Open Platform Solutions

http://www.novell.com/linux

 

Linux Application Checker detects such incompatibilities - Submitted by Alexey Khoroshilov on Tue, 10/07/2008 - 18:37.

The good thing is the new Linux Application Checker 2.1 detects this kind of compatibility issues and reports that an application under test built with gnu hash style cannot be run on distributions supporting sysv hash style only.

Linux Application Checker 2.1 - Submitted by Darren Davis on Tue, 10/07/2008 - 18:55.

Yes, I noticed that in the release notes for 2.1! The Linux Application Checker, and ISP RAS rocks!

Darren R. Davis

Technical Product Manager

Novell Open Platform Solutions

http://www.novell.com/linux

 

Copyright © 2008 Linux Foundation. All rights reserved.
LSB is a trademark of the Linux Foundation. Linux is a registered trademark of Linus Torvalds