From patchwork Thu Mar 5 09:22:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 446649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 5673F14015A for ; Thu, 5 Mar 2015 20:22:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2F501A36EB; Thu, 5 Mar 2015 09:22:26 +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 fVGZ11y9sjGB; Thu, 5 Mar 2015 09:22:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C8375A36E7; Thu, 5 Mar 2015 09:22:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 547801C293D for ; Thu, 5 Mar 2015 09:22:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 52509956A9 for ; Thu, 5 Mar 2015 09:22:24 +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 6MyGD8d+3ptG for ; Thu, 5 Mar 2015 09:22:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by hemlock.osuosl.org (Postfix) with ESMTP id 8BA63956A8 for ; Thu, 5 Mar 2015 09:22:23 +0000 (UTC) Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 8F209BE4A428A; Thu, 5 Mar 2015 09:22:20 +0000 (GMT) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 5 Mar 2015 09:22:22 +0000 Received: from localhost.localdomain (192.168.154.104) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Thu, 5 Mar 2015 09:22:21 +0000 From: Vicente Olivert Riera To: Date: Thu, 5 Mar 2015 09:22:17 +0000 Message-ID: <1425547337-20035-1-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Originating-IP: [192.168.154.104] Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH v2] openswan: do not use -fPIE for static builds X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" -fPIE produces shared objects, and shared objects need "/lib/ld.so" which won't be present on a statically built target. So, building openswan with -static -fPIE is invalid and will fail with an error like this one: /br/output/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-ctng-linux-uclibc/4.8.2/../../../../mipsel-ctng-linux-uclibc/bin/ld: /br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libgmp.a(lt2-add.o): relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used when making a shared object; recompile with -fPIC Fixes: http://autobuild.buildroot.net/results/68b/68b2211cc7acfbdfed8d4b161cbdaf1429315017/ Signed-off-by: Vicente Olivert Riera --- Changes v1 -> v2: do not disable the package for static builds. Instead of that, only use -fPIE when BR2_STATIC_LIBS is not set. package/openswan/openswan.mk | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package/openswan/openswan.mk b/package/openswan/openswan.mk index ba36f7c..863d1f4 100644 --- a/package/openswan/openswan.mk +++ b/package/openswan/openswan.mk @@ -11,8 +11,9 @@ OPENSWAN_LICENSE_FILES = COPYING LICENSE OPENSWAN_DEPENDENCIES = host-bison host-flex gmp iproute2 OPENSWAN_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" \ - USERCOMPILE="$(TARGET_CFLAGS) -fPIE" INC_USRLOCAL=/usr \ - USE_KLIPS=false USE_MAST=false USE_NM=false + USERCOMPILE="$(TARGET_CFLAGS) $(if $(BR2_STATIC_LIBS),,-fPIE)" \ + USERLINK="$(TARGET_LDFLAGS) $(if $(BR2_STATIC_LIBS),,-fPIE)" \ + INC_USRLOCAL=/usr USE_KLIPS=false USE_MAST=false USE_NM=false ifeq ($(BR2_PACKAGE_LIBCURL),y) OPENSWAN_DEPENDENCIES += libcurl