gcc -fPIC genereerib jagatud teekide jaoks positsioonist sõltumatu koodi (PIC).
$ gcc -fPIC [options] [source files] [object files] -o output file
Tõhusama koodi genereerimiseks kasutage -fPIC asemel -fpic, kui platvormi kompilaator seda toetab.
Kirjutage lähtefail myfile.c :
// myfile.c
#include <stdio.h>
int
myfunc()
{
printf("myfunc\n");
}
Build myfile.c genereerib faili myfile.o :
$ gcc -fPIC -c myfile.c
$
Advertising