From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@buildroot.org
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: [Buildroot] [PATCH 1/1] package/mdadm: replace PIE workaround
Date: Wed, 8 May 2024 14:00:57 +0200 [thread overview]
Message-ID: <20240508120057.791378-1-fontaine.fabrice@gmail.com> (raw)
Replace PIE workaround added by commit
826e0bc3360ac1daa3581232c52ee47697bfabc6 by an upstream patch
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
.../0004-Makefile-Move-pie-to-LDFLAGS.patch | 40 +++++++++++++++++++
package/mdadm/mdadm.mk | 2 +-
2 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 package/mdadm/0004-Makefile-Move-pie-to-LDFLAGS.patch
diff --git a/package/mdadm/0004-Makefile-Move-pie-to-LDFLAGS.patch b/package/mdadm/0004-Makefile-Move-pie-to-LDFLAGS.patch
new file mode 100644
index 0000000000..4d46d58230
--- /dev/null
+++ b/package/mdadm/0004-Makefile-Move-pie-to-LDFLAGS.patch
@@ -0,0 +1,40 @@
+From 893a55831e5abbcd15b171db66fa1f389fb61506 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 7 May 2024 19:32:16 +0200
+Subject: Makefile: Move -pie to LDFLAGS
+
+Move -pie from LDLIBS to LDFLAGS and make LDFLAGS configurable to allow
+the user to drop it by setting their own LDFLAGS (e.g. PIE could be
+enabled or disabled by the buildsystem such as buildroot).
+
+Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+
+Upstream: https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=893a55831e5abbcd15b171db66fa1f389fb61506
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7c221a89..adac7905 100644
+--- a/Makefile
++++ b/Makefile
+@@ -132,12 +132,12 @@ CFLAGS += -DUSE_PTHREADS
+ MON_LDFLAGS += -pthread
+ endif
+
+-LDFLAGS = -Wl,-z,now,-z,noexecstack
++LDFLAGS ?= -pie -Wl,-z,now,-z,noexecstack
+
+ # If you want a static binary, you might uncomment these
+ # LDFLAGS += -static
+ # STRIP = -s
+-LDLIBS = -ldl -pie
++LDLIBS = -ldl
+
+ # To explicitly disable libudev, set -DNO_LIBUDEV in CXFLAGS
+ ifeq (, $(findstring -DNO_LIBUDEV, $(CXFLAGS)))
+--
+cgit 1.2.3-korg
+
diff --git a/package/mdadm/mdadm.mk b/package/mdadm/mdadm.mk
index 6de9467092..153395d32a 100644
--- a/package/mdadm/mdadm.mk
+++ b/package/mdadm/mdadm.mk
@@ -21,7 +21,7 @@ MDADM_BUILD_OPTS = \
CXFLAGS="$(MDADM_CXFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -DBINDIR=\\\"/sbin\\\"" \
CHECK_RUN_DIR=0 \
- LDLIBS=-ldl
+ LDFLAGS=$(TARGET_LDFLAGS)
MDADM_INSTALL_TARGET_OPTS = install-bin
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2024-05-08 12:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 12:00 Fabrice Fontaine [this message]
2024-05-08 16:31 ` [Buildroot] [PATCH 1/1] package/mdadm: replace PIE workaround Thomas Petazzoni via buildroot
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=20240508120057.791378-1-fontaine.fabrice@gmail.com \
--to=fontaine.fabrice@gmail.com \
--cc=buildroot@buildroot.org \
/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.