I was trying to compile a binary on Fedora 7 so that is was portable to as many systems as possible, but was getting a "Floating point exception" at startup, on older systems?
I.E. compile the following on Fedora 7:
#include <stdio.h> int main(void) { printf ("Hello world\n"); return 0; }
The resultant binary will throw a floating point exception at startup on ubuntu breezy and debian sarge at least (but is Ok on ubuntu feisty).
Note, if I link the binary statically on F7, then it runs everywhere, though we're told that's a bad idea: http://people.redhat.com/drepper/no_static_linking.html
Note also, that binaries compiled on Feisty are Ok everywhere. Pertinent package versions on F7 and Feisty are: $ dpkg -l libc6 gcc | grep ii ii gcc 4.1.2-1ubuntu1 The GNU C compiler ii libc6 2.5-0ubuntu14 GNU C Library: Shared libraries $ rpm -q glibc gcc glibc-2.6-3 gcc-4.1.2-12
any ideas?
Pádraig.
On Mon, 2007-08-20 at 16:30 +0100, Pádraig Brady wrote:
I was trying to compile a binary on Fedora 7 so that is was portable to as many systems as possible, but was getting a "Floating point exception" at startup, on older systems?
your subject: is misguided; this isn't BACKWARDS compatibility; backwards compatibility is "older software runs on new releases".. what you want is the other way around.
I.E. compile the following on Fedora 7:
#include <stdio.h> int main(void) { printf ("Hello world\n"); return 0; }
The resultant binary will throw a floating point exception at startup on ubuntu breezy and debian sarge at least (but is Ok on ubuntu feisty).
you need an LD option --hash-style=sysv
Arjan van de Ven wrote:
On Mon, 2007-08-20 at 16:30 +0100, Pádraig Brady wrote:
I was trying to compile a binary on Fedora 7 so that is was portable to as many systems as possible, but was getting a "Floating point exception" at startup, on older systems?
you need an LD option --hash-style=sysv
http://docs.fedoraproject.org/release-notes/fc6/en_US/sn-Devel.html#id297079...
that works thanks, Pádraig.