From patchwork Mon Nov 6 20:04:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 834900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yW3S56nYLz9ryk for ; Tue, 7 Nov 2017 07:04:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2F33686283; Mon, 6 Nov 2017 20:04:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KOV2L1j+NHKs; Mon, 6 Nov 2017 20:04:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7508D864EF; Mon, 6 Nov 2017 20:04:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DBEB21BFEBD for ; Mon, 6 Nov 2017 20:04:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D74CC85658 for ; Mon, 6 Nov 2017 20:04:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MnjpTzXG6BGs for ; Mon, 6 Nov 2017 20:04:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by fraxinus.osuosl.org (Postfix) with ESMTP id E65D5856C7 for ; Mon, 6 Nov 2017 20:04:27 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id BFC07206F7; Mon, 6 Nov 2017 21:04:25 +0100 (CET) Received: from localhost (unknown [88.128.80.166]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7E5D9203A0; Mon, 6 Nov 2017 21:04:15 +0100 (CET) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Mon, 6 Nov 2017 21:04:14 +0100 Message-Id: <20171106200414.5268-1-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 Subject: [Buildroot] [PATCH] prosody: build with -fPIC X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Dushara Jayasinghe MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The prosody configure script defines CFLAGS as -fPIC -Wall, but because we pass our own CFLAGS, the -fPIC goes away, causing a build failure when building shared libraries on x86-64: /home/test/autobuild/run/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-amd-linux-gnu/6.2.0/../../../../x86_64-amd-linux-gnu/bin/ld: encodings.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC So let's pass this -fPIC flag explicitly in CFLAGS. We don't bother passing it conditionally !BR2_STATIC_LIBS because other packages (e.g lua) also pass -fPIC unconditionally. Fixes: http://autobuild.buildroot.net/results/7f0eb285b75cdeacb21a1f9a9f64d2f0cbbf1d59/ Signed-off-by: Thomas Petazzoni --- package/prosody/prosody.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/prosody/prosody.mk b/package/prosody/prosody.mk index b98748e3b6..d19653503d 100644 --- a/package/prosody/prosody.mk +++ b/package/prosody/prosody.mk @@ -21,7 +21,7 @@ endif PROSODY_CONF_OPTS = \ --with-lua=$(STAGING_DIR)/usr \ --c-compiler=$(TARGET_CC) \ - --cflags="$(TARGET_CFLAGS)" \ + --cflags="$(TARGET_CFLAGS) -fPIC" \ --linker=$(TARGET_CC) \ --ldflags="$(TARGET_LDFLAGS) -shared" \ --sysconfdir=/etc/prosody \