From: Aidan Kehoe (kehoea at domain parhasard.net)
Date: Mon 15 Oct 2001 - 12:42:23 IST
Ar an 15u la de mi 10, scriobh John P. Looney :
> -fpic, or not to -fpic ?
>
> I just noticed that I had a Makefile of shared lib I was using without
> any mention of "-fpic". Does GCC generate it by default now or something ?
> Because it was working fine, and "gcc -shared" didn't moan at me...
>
Depends on the architecture, I think. Ah, here we are ... OpenBSD
sparc,
12:37PM ~ > make c.o
cc -Wall -W -Wshadow -Wformat -pedantic -O3 -g -c c.c
c.c: In function `our_main':
c.c:12: warning: flag `#' used with type `p'
12:37PM ~ > cc -shared -o c.so c.o
ld: c.o: RRS text relocation at 0x30 for "_malloc"
ld: c.o: RRS text relocation at 0x40 for "_printf"
12:38PM ~ > # (fails) .
12:38PM ~ > cc -Wall -W -Wshadow -Wformat -pedantic -O3 -g -fPIC -c c.c
c.c: In function `our_main':
c.c:12: warning: flag `#' used with type `p'
12:38PM ~ > cc -shared -o c.so c.o
12:38PM ~ > file c.so
c.so: OpenBSD/sparc demand paged shared library not stripped
12:38PM ~ >
vs. Red Hat Linux release 6.1 ;
7:40am ~ > cc -Wall -W -Wshadow -Wformat -pedantic -O3 -g -c c.c
c.c: In function `our_main':
c.c:12: warning: flag `#' used with type `p'
7:40am ~ > cc -shared -o c.so c.o
7:40am ~ > file c.so
c.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped
7:40am ~ >
Has someone got Linux on another architecture kicking around to
verify that?
-- `... when the elephant man broke strong men's necks, when he'd had too many Powers, ...'
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:12:44 GMT