Re: ITP: g-wrap (& question about -fPIC)
Robert Graham Merkel <rgmerk@mira.net> writes:
> The packages pass lintian, with one notable exception -
> libgwrapguile.so is not compiled with the -fPIC flag. According to
> policy, shared libraries should be compiled with -fPIC, while static
> libraries should not. g-wrap uses automake, and therefore libtool,
> to compile its libraries. Is there a "standard way" to set things up
> so that the .so gets compiled with -fPIC and the .a does not?
g-wrap already does it right. I downloaded and built your package. The
relevant portion from the make run:
/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -I/usr/include -c g-wrap-fns.c
rm -f .libs/g-wrap-fns.lo
gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -I/usr/include -c -fPIC -DPIC g-wrap-fns.c -o .libs/g-wrap-fns.lo
gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -I/usr/include -c g-wrap-fns.c -o g-wrap-fns.o >/dev/null 2>&1
mv -f .libs/g-wrap-fns.lo g-wrap-fns.lo
/bin/sh ../libtool --mode=link gcc -g -O2 -I/usr/include -o libgwrapguile.la -export-dynamic -rpath /usr/lib g-wrap-fns.lo -L/usr/lib -lguile -lqthreads -ldl -lm
rm -fr .libs/libgwrapguile.la .libs/libgwrapguile.* .libs/libgwrapguile.*
gcc -shared g-wrap-fns.lo -L/usr/lib -lguile -lqthreads -ldl -lm -lc -Wl,-soname -Wl,libgwrapguile.so.0 -o .libs/libgwrapguile.so.0.0.0
(cd .libs && rm -f libgwrapguile.so.0 && ln -s libgwrapguile.so.0.0.0 libgwrapguile.so.0)
(cd .libs && rm -f libgwrapguile.so && ln -s libgwrapguile.so.0.0.0 libgwrapguile.so)
Note that the only file going into the .so is g-wrap-fns.lo, which is
compiled using -fPIC.
The lintian check seems to produce false positives (it seems to check
for the presence of certain sections in .so files - being no ELF guru,
I can't comment on that). If this is not a known problem, you should
file a bug report.
--
Robbe
Reply to: