Position independent code

v13 at priest.com v13 at priest.com
Wed Nov 7 15:24:01 EET 2001


On Tuesday 06 November 2001 10:54, Yannis Mitsos wrote:
> Hello all,
> 
> Exw enan GNU cross compiler [platform-gcc, platform-ld, ktl ktl]. Jerei
> kanenas pws mporw na checkarw an ayta ta tools mporoun na bgaloun
> position independent code ? To -fPIC pernaei san parametros alla mallon
> ayto den shmainei tipota. To oti den mporw na kanw build mia aplh shared
> library leei kati sxetika me to 8ema ?

Dokimase kai to -shared:

       -shared
           Produce a shared object which can then be linked with
           other objects to form an executable.  Not all systems
           support this option.  For predictable results, you
           must also specify the same set of options that were
           used to generate code (-fpic, -fPIC, or model subop-
           tions) when you specify this option.[1]

Symboyli moy einai na dokimaseis prota na ftiakseis shared lib gia to diko soy
mixanima mono kai afoy to katafereis, tote dokimase me ton idio akribos tropo 
gia ta ypoloipa.

An thes more help, steile mail me to ti akribos kaneis kai ti soy bgazei... 
Den einai idiaitera duskolo to na ftiakseis elf shared object, alla an thes
portability, des kai to libtool. Se apalasei apo arketoys ponokefaloys (p.x.
edo tha eleges mono 

libtool --mode=compile gcc -shared a.c (an thymamai kala)

kai proeretika

libtool --mode=compile gcc -shared a.lo -o a.so

h 

mv a.lo a.so

kai tha doyleve se oti platforma ypostirizetai apo to libtool (kai exei 
shared libs)

> Fotis.
<<V13>>




More information about the Linux-greek-users mailing list