public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: libc-alpha@sourceware.org
Cc: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Subject: [PATCH 5/5] Enable static-pie on powerpc64
Date: Mon, 24 Jan 2022 14:36:06 +1030	[thread overview]
Message-ID: <Ye4lrkAX7ED7mq0V@squeak.grove.modra.org> (raw)
In-Reply-To: <Ye1NJQwEpe7AyNYD@squeak.grove.modra.org>

Also regenerate another powerpc configure file that wasn't done when
making the corresponding configure.ac change.

With this series and latest gcc + binutils I get mostly working
static-pie on powerpc64le-linux.  There are a number of regressions:
FAIL: elf/tst-glibc-hwcaps-cache
FAIL: elf/tst-glibc-hwcaps-prepend-cache
FAIL: elf/tst-ldconfig-bad-aux-cache
FAIL: elf/tst-ldconfig-ld_so_conf-update
FAIL: elf/tst-tlsifunc-static

	* sysdeps/powerpc/powerpc64/configure.ac (SUPPORT_STATIC_PIE): Define.
	(PI_STATIC_AND_HIDDEN): Define.
	* sysdeps/powerpc/powerpc64/configure: Regenerate.
	* sysdeps/unix/sysv/linux/powerpc/configure: Regenerate.

diff --git a/sysdeps/powerpc/powerpc64/configure b/sysdeps/powerpc/powerpc64/configure
index fddea0355a..4a219ab8ac 100644
--- a/sysdeps/powerpc/powerpc64/configure
+++ b/sysdeps/powerpc/powerpc64/configure
@@ -1,6 +1,13 @@
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/powerpc/powerpc64.
 
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+
+
+# Static PIE is supported.
+$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for support for overlapping .opd entries" >&5
 $as_echo_n "checking for support for overlapping .opd entries... " >&6; }
 if ${libc_cv_overlapping_opd+:} false; then :
diff --git a/sysdeps/powerpc/powerpc64/configure.ac b/sysdeps/powerpc/powerpc64/configure.ac
index 1f3d54414c..5eedd2f81c 100644
--- a/sysdeps/powerpc/powerpc64/configure.ac
+++ b/sysdeps/powerpc/powerpc64/configure.ac
@@ -1,6 +1,13 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/powerpc/powerpc64.
 
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+# Static PIE is supported.
+AC_DEFINE(SUPPORT_STATIC_PIE)
+
 AC_CACHE_CHECK(for support for overlapping .opd entries,
 libc_cv_overlapping_opd, [dnl
 libc_cv_overlapping_opd=no
diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure
index a4c809fd98..7183573bc0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/configure
@@ -93,7 +93,13 @@ EOF
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
   then
-    libc_linker_feature=yes
+    if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-tls-get-addr-optimize -nostdlib \
+	-nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \
+	| grep "warning: --no-tls-get-addr-optimize ignored" > /dev/null 2>&1; then
+      true
+    else
+      libc_linker_feature=yes
+    fi
   fi
   rm -f conftest*
 fi

-- 
Alan Modra
Australia Development Lab, IBM

  parent reply	other threads:[~2022-01-24  4:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-23 12:42 [PowerPC64] Use medium model toc accesses throughout Alan Modra
2022-01-24  3:47 ` [PATCH 2/5] [PowerPC64] Set up thread register for _dl_relocate_static_pie Alan Modra
2022-02-16 23:02   ` Paul E Murphy
2022-02-19  0:49     ` Alan Modra
2022-01-24  3:50 ` [PATCH 3/5] [PowerPC] Relocate stinfo->main Alan Modra
2022-01-24  4:48   ` H.J. Lu
2022-01-24  6:51     ` Alan Modra
2022-01-24  3:52 ` [PATCH 4/5] Constify a variable in dl_vdso_vsym Alan Modra
2022-01-24  4:06 ` Alan Modra [this message]
2022-01-27 18:39   ` [PATCH 5/5] Enable static-pie on powerpc64 Florian Weimer
2022-01-28  8:45     ` Alan Modra
2022-01-28 17:48 ` [PowerPC64] Use medium model toc accesses throughout Paul E Murphy
2022-01-29  1:24   ` Alan Modra
2022-02-28  6:40 ` [PATCH v2 0/4] PowerPC64 static-pie Alan Modra
2022-02-28  6:40   ` [PATCH v2 1/4] powerpc64: Use medium model toc accesses throughout Alan Modra
2022-04-08 22:28     ` Tulio Magno Quites Machado Filho
2022-02-28  6:40   ` [PATCH v2 2/4] powerpc64: Set up thread register for _dl_relocate_static_pie Alan Modra
2022-04-08 22:28     ` Tulio Magno Quites Machado Filho
2022-02-28  6:40   ` [PATCH v2 3/4] powerpc: Relocate stinfo->main Alan Modra
2022-04-08 22:32     ` Tulio Magno Quites Machado Filho
2022-02-28  6:40   ` [PATCH v2 4/4] powerpc64: Enable static-pie Alan Modra
2022-04-08 22:49     ` Tulio Magno Quites Machado Filho
2022-04-14  1:16       ` Alan Modra
2022-04-14  3:42         ` Fangrui Song
2022-04-20  7:21         ` [PATCH v3] " Alan Modra
2022-03-04 12:48   ` [PATCH v2 0/4] PowerPC64 static-pie Alan Modra
2022-04-08  8:06     ` Alan Modra
2022-04-09  0:14       ` Fangrui Song
2022-04-14  0:33         ` Alan Modra
2022-04-14  1:54           ` DT_RELR without libc.so dependency H.J. Lu
2022-04-14  3:43             ` Fangrui Song
2022-04-14  5:18             ` Alan Modra
2022-04-14 17:55               ` H.J. Lu
2022-04-08 22:27   ` [PATCH v2 0/4] PowerPC64 static-pie Tulio Magno Quites Machado Filho
2022-04-11  1:38     ` Alan Modra

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=Ye4lrkAX7ED7mq0V@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=tuliom@linux.ibm.com \
    /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).