From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: libc-alpha@sourceware.org
Subject: [PATCH v3 1/5] configure: Require PI_STATIC_AND_HIDDEN for static pie
Date: Tue, 12 Jan 2021 17:21:42 +0000 [thread overview]
Message-ID: <5a446e7a422bc4edd49384884106383485d05c08.1610471272.git.szabolcs.nagy@arm.com> (raw)
In-Reply-To: <cover.1610471272.git.szabolcs.nagy@arm.com>
The glibc static pie self relocation code relies on that local
symbols can be accessed without dynamic relocations in position
independent code.
---
configure | 14 ++++++++++++++
configure.ac | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/configure b/configure
index 49f7b32b52..81fd116d87 100755
--- a/configure
+++ b/configure
@@ -6818,6 +6818,20 @@ if test "$static_pie" = yes; then
if test "$libc_cv_no_dynamic_linker" != yes; then
as_fn_error $? "linker support for --no-dynamic-linker needed" "$LINENO" 5
fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef PI_STATIC_AND_HIDDEN
+# error static pie depends on PI_STATIC_AND_HIDDEN
+#endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ as_fn_error $? "the target does not support static pie" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
# Default to PIE.
libc_cv_pie_default=yes
$as_echo "#define ENABLE_STATIC_PIE 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index 341d4eeac2..8b7c99001d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1835,6 +1835,11 @@ if test "$static_pie" = yes; then
if test "$libc_cv_no_dynamic_linker" != yes; then
AC_MSG_ERROR([linker support for --no-dynamic-linker needed])
fi
+
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifndef PI_STATIC_AND_HIDDEN
+# error static pie depends on PI_STATIC_AND_HIDDEN
+#endif]])], , AC_MSG_ERROR([the target does not support static pie]))
+
# Default to PIE.
libc_cv_pie_default=yes
AC_DEFINE(ENABLE_STATIC_PIE)
--
2.17.1
next prev parent reply other threads:[~2021-01-12 17:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 17:21 [PATCH v3 0/5] fix ifunc with static pie [BZ #27072] Szabolcs Nagy
2021-01-12 17:21 ` Szabolcs Nagy [this message]
2021-01-12 18:38 ` [PATCH v3 1/5] configure: Require PI_STATIC_AND_HIDDEN for static pie Adhemerval Zanella
2021-01-12 17:22 ` [PATCH v3 2/5] Make libc symbols hidden in static PIE Szabolcs Nagy
2021-01-12 23:09 ` H.J. Lu
2021-01-13 0:02 ` H.J. Lu
2021-01-13 0:33 ` H.J. Lu
2021-01-13 1:19 ` H.J. Lu
2021-01-13 9:50 ` Szabolcs Nagy
2021-01-14 11:17 ` Szabolcs Nagy
2021-01-14 15:39 ` H.J. Lu
2021-01-15 3:36 ` H.J. Lu
2021-01-15 4:29 ` H.J. Lu
2021-01-15 11:25 ` Szabolcs Nagy
2021-01-15 13:43 ` H.J. Lu
2021-01-15 14:27 ` Szabolcs Nagy
2021-01-15 15:28 ` H.J. Lu
2021-01-15 22:42 ` H.J. Lu
2021-01-16 0:41 ` H.J. Lu
2021-01-16 13:18 ` H.J. Lu
2021-01-18 16:22 ` Szabolcs Nagy
2021-01-12 17:22 ` [PATCH v3 3/5] elf: Make the tunable struct definition internal only Szabolcs Nagy
2021-01-13 17:38 ` Adhemerval Zanella
2021-01-12 17:22 ` [PATCH v3 4/5] elf: Avoid RELATIVE relocs in __tunables_init Szabolcs Nagy
2021-01-13 17:42 ` Adhemerval Zanella
2021-01-12 17:23 ` [PATCH v3 5/5] csu: Move static pie self relocation later [BZ #27072] Szabolcs Nagy
2021-01-12 22:55 ` H.J. Lu
2021-01-14 15:49 ` H.J. Lu
2021-01-14 15:52 ` H.J. Lu
2021-01-14 16:01 ` H.J. Lu
2021-01-14 16:26 ` H.J. Lu
2021-01-14 17:19 ` Szabolcs Nagy
2021-01-14 17:59 ` Szabolcs Nagy
2021-01-14 17:05 ` Szabolcs Nagy
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=5a446e7a422bc4edd49384884106383485d05c08.1610471272.git.szabolcs.nagy@arm.com \
--to=szabolcs.nagy@arm.com \
--cc=libc-alpha@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).