From patchwork Wed Jan 24 04:09:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 865159 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zRBXG453Bz9ryr for ; Wed, 24 Jan 2018 15:10:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7965A87EE5; Wed, 24 Jan 2018 04:10:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DuOVReYGfjYN; Wed, 24 Jan 2018 04:10:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 816808745E; Wed, 24 Jan 2018 04:10:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 36F821CE7F4 for ; Wed, 24 Jan 2018 04:09:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 337A42F21D for ; Wed, 24 Jan 2018 04:09:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kq-jC60qAIsa for ; Wed, 24 Jan 2018 04:09:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by silver.osuosl.org (Postfix) with ESMTPS id D585C2F1E3 for ; Wed, 24 Jan 2018 04:09:55 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 23 Jan 2018 22:09:55 -0600 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id E2CD12007F; Tue, 23 Jan 2018 22:09:54 -0600 (CST) From: Matt Weber To: buildroot@buildroot.org Date: Tue, 23 Jan 2018 22:09:45 -0600 Message-Id: <1516766992-48428-6-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516766992-48428-1-git-send-email-matthew.weber@rockwellcollins.com> References: <1516766992-48428-1-git-send-email-matthew.weber@rockwellcollins.com> Subject: [Buildroot] [PATCH v4 06/13] busybox: patch to remove -pie from LDFLAGS 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch will remove '-pie' option from LDFLAGS if it was passed from TARGET_LDFLAGS. Removing of -pie linker option is required because it cannot be used with the -r option. Busybox bydefault enables -r option. Upstream: http://lists.busybox.net/pipermail/busybox/2017-November/085971.html Signed-off-by: Matthew Weber --- Changes v3 -> v4 - New --- ...-busybox-patch-to-remove-pie-from-LDFLAGS.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/busybox/0005-busybox-patch-to-remove-pie-from-LDFLAGS.patch diff --git a/package/busybox/0005-busybox-patch-to-remove-pie-from-LDFLAGS.patch b/package/busybox/0005-busybox-patch-to-remove-pie-from-LDFLAGS.patch new file mode 100644 index 0000000..e8223fc --- /dev/null +++ b/package/busybox/0005-busybox-patch-to-remove-pie-from-LDFLAGS.patch @@ -0,0 +1,42 @@ +From 140c2a447a068ff0572dd2e5df53ee12fff0c547 Mon Sep 17 00:00:00 2001 +From: Yogesh Prasad +Date: Tue, 3 Oct 2017 10:46:46 -0500 +Subject: [PATCH 1/1] busybox: patch to remove -pie from LDFLAGS + +Description +This patch will remove '-pie' option from LDFLAGS if it was passed +from TARGET_LDFLAGS. Removing of -pie linker option is required +because it cannot be used with the -r option. +Busybox bydefault enables -r option. if -r and -pie are used together +below error is thrown by the linker. +------------------------------------------------------------------------- +/host/lib/gcc/powerpc-buildroot-linux-gnu/6.4.0/../../../../ +powerpc-buildroot-linux-gnu/bin/ld: -r and -pie may not be used together +collect2: error: ld returned 1 exit status +make[3]: *** [applets/built-in.o] Error 1 +make[2]: *** [applets_dir] Error 2 +make[1]: *** [/build/busybox-1.27.1/.stamp_built] Error 2 +make: *** [_all] Error 2 +------------------------------------------------------------------------- + +Signed-off-by: Yogesh Prasad +--- + scripts/Makefile.lib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib +index 3e54ea7..acf5d33 100644 +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -121,7 +121,7 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) + # yet ld_flags is fed to ld. + #ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) + # Remove the -Wl, prefix from linker options normally passed through gcc +-ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) ++ld_flags = $(filter-out -Wl$(comma)% -pie,$(LDFLAGS) $(EXTRA_LDFLAGS)) + + + # Finds the multi-part object the current object will be linked into +-- +1.9.1 +