httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Engelhardt <>
Subject apxs is missing -fPIC and ignores it
Date Sat, 07 Jun 2008 11:29:26 GMT

I was compiling an authnz module and noticed that apxs2 does not pass 
-fPIC to the compiler by default when compiling .c files into .slo. 
Also, when passing -fPIC manually as part of the CFLAGS (command line is
`apxs2 "-Wc,-Wall -fPIC" -c foobar.c`), the -fPIC gets stripped.
libtool normally adds PIC for shared libraries, but apxs2's copy of 
libtool even removes an explicitly specified -fPIC flag?

Opensuse 10.3 i586 and x86_64, Linux, apache2 2.2.4.

$ touch foo.c
$ apxs2 -c foo.c -fPIC
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic   
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2  
-I/usr/include/apr-1   -I/usr/include/apr-1   -c -o foo.lo foo.c && 
touch foo.slo
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o  
-rpath /usr/lib64/apache2 -module -avoid-version    foo.lo -fPIC

As can be seen, -fPIC is not passed to the compiler, but only to the 
link stage. Any ideas?


View raw message