Re: gcc compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----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-----

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux