All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Weber <matthew.weber@rockwellcollins.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 06/13] busybox: patch to remove -pie from LDFLAGS
Date: Tue, 23 Jan 2018 22:09:45 -0600	[thread overview]
Message-ID: <1516766992-48428-6-git-send-email-matthew.weber@rockwellcollins.com> (raw)
In-Reply-To: <1516766992-48428-1-git-send-email-matthew.weber@rockwellcollins.com>

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 <matthew.weber@rockwellcollins.com>
--
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 <yogesh.prasad@rockwellcollins.com>
+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 <yogesh.prasad@rockwellcollins.com>
+---
+ 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
+
-- 
1.9.1

  parent reply	other threads:[~2018-01-24  4:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  4:09 [Buildroot] [PATCH v4 01/13] stack protector: moved option out of adv menu Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 02/13] security hardening: add RELFO, FORTIFY options Matt Weber
2018-01-28 14:20   ` Peter Korsgaard
2018-02-04 21:56   ` Matthew Weber
2018-04-26 15:55   ` Johan Oudinet
2018-04-27 13:05     ` Matthew Weber
2018-05-02 13:10       ` Matthew Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 03/13] valgrind: correct linker flag seq Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 04/13] ncurses: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 05/13] boost: " Matt Weber
2018-01-24  4:09 ` Matt Weber [this message]
2018-01-24  4:09 ` [Buildroot] [PATCH v4 07/13] libpcap: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 08/13] iptables: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 09/13] zlib: correct linker flag sequence Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 10/13] ustr: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 11/13] tcl: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 12/13] readline: " Matt Weber
2018-01-24  4:09 ` [Buildroot] [PATCH v4 13/13] libcap: corrected " Matt Weber
2018-01-28 14:17 ` [Buildroot] [PATCH v4 01/13] stack protector: moved option out of adv menu Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516766992-48428-6-git-send-email-matthew.weber@rockwellcollins.com \
    --to=matthew.weber@rockwellcollins.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.