gcc compatibility
Harald Krammer
Harald.Krammer@hkr.at
Tue May 27 09:09:00 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
cdinesh schrieb:
> Properly
> Strike
> Protest
>
> Hi
>
> I have two Linux systems have different gcc version
> system A -> gcc (3.4.4)
> system B -> gcc (4.1.2)
>
>
> I would like to build test program that can be run on both systems
> ---------------------------
> #include <stdio.h>
> main(){
> printf("hello world \n");
> }
> ---------------------------
> gcc test.c -o test
>
> ldd on system A
> linux-gate.so.1 => (0x00d42000)
> libc.so.6 => /lib/tls/libc.so.6 (0x00b0c000)
> /lib/ld-linux.so.2 (0x00af2000)
>
> ldd on system B
> linux-gate.so.1 => (0x00814000)
> libc.so.6 => /lib/libc.so.6 (0x0054a000)
> /lib/ld-linux.so.2 (0x0052d000)
>
> Test case 1
> Build test.c on system A and run on both systems A and B.
> ï on sytem A ok
> ï on system B ok.
>
> Test case 2
> Build test.c on system B and run on both systems A and B.
> ï on system B ok
> ï on system A error
> error log
> # ./test
> Floating point exception
>
> # ldd
> /usr/bin/ldd: line 124: 3911 Floating pointexception
> LD_TRACE_LOADED_OBJECTS=1 LD_WARN=
> LD_BIND_NOW= LD_LIBRARY_VERSION
> =$verify_out LD_VERBOSE= "$@"
>
> for other information
>
> System A
> kernel 2.6.12
> gliibc version 2.3.6
> binutils 2.15.92.0.2
> selinux disable
>
> System B
> kernel 2.6.18
> gliibc version 2.5
> binutils 2.17.50.0.6
> selinux disable
>
>
> I have a feeling the problem is in the libraries. Please give any advice ?
>
> Thank you
>
Hello,
you can use a static link. (gcc -static test.c -o test).
It is a easy solution and often used, but keep in mind: A security
update (also bugfix) in glibc needs a recompilation of your application!
Nice greetings,
Harald
- --
Harald Krammer
Brucknerstrasse 33
A - 4020 Linz
AUSTRIA
Mobil +43.(0) 664. 130 59 58
Mail: Harald.Krammer (at) hkr.at
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIOxih9QlAsubHO9sRCDiBAKCMmR63int+hk3UxNTLADOn8s5vZgCfYsSC
HhvMzigRzKMbSjW03T9aq+U=
=03rc
-----END PGP SIGNATURE-----
More information about the Gcc-help
mailing list