libxml2.a and -fPIC

Jeremy Messenger mezz.freebsd at gmail.com
Thu Aug 16 01:32:51 UTC 2012


On Wed, Aug 15, 2012 at 7:31 AM, Dmitry Sivachenko <demon at freebsd.org> wrote:
> Hello!
>
> I am writing some kind of shared library at work which uses libxml2.
>
> I want to link statically with it.
>
> When I try, I get the following error:
>
> /usr/bin/ld: /usr/local/lib/libxml2.a(error.o): relocation R_X86_64_32
> against `a local symbol' can not be used when making a shared object;
> recompile with -fPIC
>
> If I add -fPIC to CFLAGS and recompile libxml2 port, this error disappears.
>
> Is it possible to make this change to port so libxml2.a is always built with
> -fPIC?

Sure, go ahead.

Cheers,
Mezz


> Thanks!


-- 
mezz.freebsd at gmail.com - mezz at FreeBSD.org
FreeBSD GNOME Team
http://www.FreeBSD.org/gnome/ - gnome at FreeBSD.org


More information about the freebsd-gnome mailing list