From owner-freebsd-python@FreeBSD.ORG  Fri May  4 16:14:18 2012
Return-Path: <owner-freebsd-python@FreeBSD.ORG>
Delivered-To: python@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0B629106564A
	for <python@FreeBSD.org>; Fri,  4 May 2012 16:14:18 +0000 (UTC)
	(envelope-from nukama@googlemail.com)
Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com
	[209.85.161.182])
	by mx1.freebsd.org (Postfix) with ESMTP id BD6F78FC18
	for <python@FreeBSD.org>; Fri,  4 May 2012 16:14:17 +0000 (UTC)
Received: by ggnk4 with SMTP id k4so616848ggn.13
	for <python@FreeBSD.org>; Fri, 04 May 2012 09:14:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type;
	bh=OSFvUk0ZrOa/tAg29k4IWWNRp7b+L7lXHI3ep9SWNtQ=;
	b=0t8gHvCX2B6MZ2tMoRbn6WC8h3Ho0+N5kiZk/bwOirhzjOQ0J0E0Skz2mFda+CQ6PR
	X5KI9n9JElSKARxIx+26RQ1+HxmcwEe/EjbcaHGgtQwI7YtO5NizkEMAE8A9eQH8Ukga
	BlgGG/qLbXs0RDeAa6orcUNK4KhgmadlIOzIpc1Kgo9fGjKYubjPEUq0FeFzyXZp5WQS
	4ntLTr068FntQqZ1mkS0TWRq7DRxB+F9EvEoIIxklnR7uUrwv8WBlWNkdXU0MNoVfd2w
	6HKdSepF+WwZbLUBcGHmfmWbe2brKhIwVGyPgcXG4H5414TKofpXu7jgOyRVyOjHQi8M
	9atw==
MIME-Version: 1.0
Received: by 10.50.45.234 with SMTP id q10mr3436596igm.54.1336148051365; Fri,
	04 May 2012 09:14:11 -0700 (PDT)
Received: by 10.50.171.9 with HTTP; Fri, 4 May 2012 09:14:11 -0700 (PDT)
Date: Fri, 4 May 2012 16:14:11 +0000
Message-ID: <CA+zcas3VBR5yP_Rq9MBypf7o6k6VWxZVuYqCTeTRbYkonKpk2A@mail.gmail.com>
From: Hakisho Nukama <nukama@googlemail.com>
To: python@FreeBSD.org
Content-Type: text/plain; charset=UTF-8
Cc: uwe@hermann-uwe.de
Subject: lang/python32 with CFLAG -fPIC for libpython3.2mu.a
X-BeenThere: freebsd-python@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-python>, 
	<mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-python>,
	<mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 04 May 2012 16:14:18 -0000

Hello,

I tried to compile libsigrokdecode against libpython32 with this port:
https://redports.org/browser/Nukama/devel/libsigrokdecode

But doing so results in following error:

/usr/bin/ld: /usr/local/lib/python3.2/config-3.2mu/libpython3.2mu.a(abstract.o):
relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/usr/local/lib/python3.2/config-3.2mu/libpython3.2mu.a: could not read
symbols: Bad value

Compiling against python31 actually works.
Setting CFLAGS= -fPIC in python32/Makefile gets rid of this error.

But globally setting PIC is discouraged according to this how-to:
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3

What's the best way to link against libpython3.2mu.a?

Best Regards,
Hakisho Nukama