public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org, Fangrui Song <maskray@google.com>
Subject: [PATCH 6/7] Remove --with-default-link configure option
Date: Tue, 15 Nov 2022 16:31:58 -0300	[thread overview]
Message-ID: <20221115193159.173838-7-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20221115193159.173838-1-adhemerval.zanella@linaro.org>

Now that there is no need to use a special linker script to hardening
internal data structures, remove the --with-default-link configure
option and associated definitions.
---
 INSTALL                   |  6 ------
 Makerules                 | 21 ++++++---------------
 config.make.in            |  1 -
 configure                 | 13 -------------
 configure.ac              |  7 -------
 elf/Makefile              |  2 --
 iconvdata/extra-module.mk |  2 +-
 manual/install.texi       |  6 ------
 8 files changed, 7 insertions(+), 51 deletions(-)

diff --git a/INSTALL b/INSTALL
index 659f75a97f..f57c743d77 100644
--- a/INSTALL
+++ b/INSTALL
@@ -90,12 +90,6 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
      library will still be usable, but functionality may be lost--for
      example, you can't build a shared libc with old binutils.
 
-'--with-default-link'
-     With '--with-default-link', the build system does not use a custom
-     linker script for linking shared objects.  The default is
-     '--without-default-link', because the custom linker script is
-     needed for full RELRO protection.
-
 '--with-nonshared-cflags=CFLAGS'
      Use additional compiler flags CFLAGS to build the parts of the
      library which are always statically linked into applications and
diff --git a/Makerules b/Makerules
index 41fc8db4ba..97864402fb 100644
--- a/Makerules
+++ b/Makerules
@@ -544,13 +544,8 @@ $(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \
 	  -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
 endef
 
-# If the linker is good enough, we can let it use its default linker script.
-# In the long term the custom linker script will be removed.
-shlib-lds =
-shlib-lds-flags =
-
 define build-shlib
-$(build-shlib-helper) -o $@ $(shlib-lds-flags) \
+$(build-shlib-helper) -o $@ \
 	  $(csu-objpfx)abi-note.o $(build-shlib-objlist)
 endef
 
@@ -569,12 +564,12 @@ endef
 # binutils only position loadable notes into the first page for binaries,
 # not for shared objects
 define build-module
-$(build-module-helper) -o $@ $(shlib-lds-flags) \
+$(build-module-helper) -o $@ \
 	  $(csu-objpfx)abi-note.o $(build-module-objlist) $(link-libc-args)
 $(call after-link,$@)
 endef
 define build-module-asneeded
-$(build-module-helper) -o $@ $(shlib-lds-flags) \
+$(build-module-helper) -o $@ \
 	  $(csu-objpfx)abi-note.o \
 	  -Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed \
 	  $(link-libc-args)
@@ -606,7 +601,6 @@ $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
 	$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
 	$(LDFLAGS-c_pic.os) $(whole-archive) $^ -o $@
 
-ifeq (,$(strip $(shlib-lds-flags)))
 # Generate a list of -R options to excise .gnu.glibc-stub.* sections.
 $(common-objpfx)libc_pic.opts: $(common-objpfx)libc_pic.os
 	$(OBJDUMP) -h $< | \
@@ -620,7 +614,6 @@ $(common-objpfx)libc_pic.os.clean: $(common-objpfx)libc_pic.opts \
 generated += libc_pic.opts libc_pic.os.clean
 
 libc_pic_clean := .clean
-endif
 
 # Build a possibly-modified version of libc_pic.a for use in building
 # linkobj/libc.so.
@@ -650,16 +643,14 @@ $(common-objpfx)linkobj/libc.so: link-libc-deps = # empty
 $(common-objpfx)libc.so: $(common-objpfx)libc_pic.os$(libc_pic_clean) \
 			 $(elf-objpfx)sofini.os \
 			 $(elf-objpfx)interp.os \
-			 $(elf-objpfx)ld.so \
-			 $(shlib-lds)
+			 $(elf-objpfx)ld.so
 	$(build-shlib)
 	$(call after-link,$@)
 
 $(common-objpfx)linkobj/libc.so: $(common-objpfx)linkobj/libc_pic.a \
 			 $(elf-objpfx)sofini.os \
 			 $(elf-objpfx)interp.os \
-			 $(elf-objpfx)ld.so \
-			 $(shlib-lds)
+			 $(elf-objpfx)ld.so
 	$(build-shlib)
 	$(call after-link,$@)
 
@@ -720,7 +711,7 @@ endif
 
 extra-modules-build := $(filter-out $(modules-names-nobuild),$(modules-names))
 $(extra-modules-build:%=$(objpfx)%.so): $(objpfx)%.so: \
-		$(objpfx)%.os $(shlib-lds) $(link-libs-deps)
+		$(objpfx)%.os $(link-libs-deps)
 	$(build-module)
 endif
 \f
diff --git a/config.make.in b/config.make.in
index d7c416cbea..befcc22625 100644
--- a/config.make.in
+++ b/config.make.in
@@ -69,7 +69,6 @@ have-libaudit = @have_libaudit@
 have-libcap = @have_libcap@
 have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
 bind-now = @bindnow@
-use-default-link = @use_default_link@
 have-cxx-thread_local = @libc_cv_cxx_thread_local@
 have-loop-to-function = @libc_cv_cc_loop_to_function@
 have-textrel_ifunc = @libc_cv_textrel_ifunc@
diff --git a/configure b/configure
index 9a8acc4ef7..eff64601b4 100755
--- a/configure
+++ b/configure
@@ -679,7 +679,6 @@ hardcoded_path_in_tests
 enable_timezone_tools
 rtld_early_cflags
 extra_nonshared_cflags
-use_default_link
 sysheaders
 ac_ct_CXX
 CXXFLAGS
@@ -757,7 +756,6 @@ with_gd_lib
 with_binutils
 with_selinux
 with_headers
-with_default_link
 with_nonshared_cflags
 with_rtld_early_cflags
 with_timeoutfactor
@@ -1476,7 +1474,6 @@ Optional Packages:
   --with-selinux          if building with SELinux support
   --with-headers=PATH     location of system headers to use (for example
                           /usr/src/linux/include) [default=compiler default]
-  --with-default-link     do not use explicit linker scripts
   --with-nonshared-cflags=CFLAGS
                           build nonshared libraries with additional CFLAGS
   --with-rtld-early-cflags=CFLAGS
@@ -3460,16 +3457,6 @@ fi
 
 
 
-
-# Check whether --with-default-link was given.
-if test "${with_default_link+set}" = set; then :
-  withval=$with_default_link; use_default_link=$withval
-else
-  use_default_link=no
-fi
-
-
-
 # Check whether --with-nonshared-cflags was given.
 if test "${with_nonshared_cflags+set}" = set; then :
   withval=$with_nonshared_cflags; extra_nonshared_cflags=$withval
diff --git a/configure.ac b/configure.ac
index 5709c7a0cf..992d1f6937 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,13 +149,6 @@ AC_ARG_WITH([headers],
 	    [sysheaders=''])
 AC_SUBST(sysheaders)
 
-AC_SUBST(use_default_link)
-AC_ARG_WITH([default-link],
-	    AS_HELP_STRING([--with-default-link],
-			   [do not use explicit linker scripts]),
-	    [use_default_link=$withval],
-	    [use_default_link=no])
-
 dnl Additional build flags injection.
 AC_ARG_WITH([nonshared-cflags],
 	    AS_HELP_STRING([--with-nonshared-cflags=CFLAGS],
diff --git a/elf/Makefile b/elf/Makefile
index 8527e659dc..9e5bbb963b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1235,8 +1235,6 @@ endif
 # Command to link into a larger single relocatable object.
 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
 
-$(objpfx)sotruss-lib.so: $(shlib-lds)
-
 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
 	$(reloc-link) -o $@ $^
 
diff --git a/iconvdata/extra-module.mk b/iconvdata/extra-module.mk
index ecaf507624..a816659763 100644
--- a/iconvdata/extra-module.mk
+++ b/iconvdata/extra-module.mk
@@ -4,7 +4,7 @@ extra-modules-left := $(strip $(filter-out $(mod),$(extra-modules-left)))
 extra-objs := $(extra-objs) $(patsubst %,%.os,$($(mod)-routines))
 
 $(objpfx)$(mod).so: $(addprefix $(objpfx),$(addsuffix .os,$($(mod)-routines)))\
-		    $(shlib-lds) $(link-libc-deps)
+		    $(link-libc-deps)
 	$(build-module-asneeded)
 
 ifneq (,$(extra-modules-left))
diff --git a/manual/install.texi b/manual/install.texi
index c775005581..ba2231024b 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -117,12 +117,6 @@ problem and suppress these constructs, so that the library will still be
 usable, but functionality may be lost---for example, you can't build a
 shared libc with old binutils.
 
-@item --with-default-link
-With @code{--with-default-link}, the build system does not use a custom
-linker script for linking shared objects.  The default is
-@code{--without-default-link}, because the custom linker script is
-needed for full RELRO protection.
-
 @item --with-nonshared-cflags=@var{cflags}
 Use additional compiler flags @var{cflags} to build the parts of the
 library which are always statically linked into applications and
-- 
2.34.1


  parent reply	other threads:[~2022-11-15 19:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 19:31 [PATCH 0/7] Fixing remaining lld issues Adhemerval Zanella
2022-11-15 19:31 ` [PATCH 1/7] configure: Move locale tools early Adhemerval Zanella
2022-11-15 19:31 ` [PATCH 2/7] elf: Do not assume symbol order on tst-audit25{a,b} Adhemerval Zanella
2022-12-12 12:36   ` Adhemerval Zanella Netto
2022-11-15 19:31 ` [PATCH 3/7] stdlib: Move _IO_cleanup to call_function_static_weak Adhemerval Zanella
2022-12-12 10:52   ` Florian Weimer
2022-12-13 16:52     ` Joseph Myers
2022-11-15 19:31 ` [PATCH 4/7] Move libc_freeres_ptrs and libc_subfreeres to weak functions Adhemerval Zanella
2022-12-12 10:55   ` Florian Weimer
2022-12-12 13:14     ` Adhemerval Zanella Netto
2022-12-12 10:58   ` Florian Weimer
2022-12-12 13:16     ` Adhemerval Zanella Netto
2022-12-12 11:00   ` Florian Weimer
2022-12-12 13:49     ` Adhemerval Zanella Netto
2022-12-12 14:05       ` Florian Weimer
2022-12-12 14:16         ` Adhemerval Zanella Netto
2022-12-12 15:39           ` Florian Weimer
2022-12-12 11:05   ` Andreas Schwab
2022-12-12 13:49     ` Adhemerval Zanella Netto
2022-12-12 11:08   ` Florian Weimer
2022-12-12 13:51     ` Adhemerval Zanella Netto
2022-11-15 19:31 ` [PATCH 5/7] libio: Remove the usage of __libc_IO_vtables Adhemerval Zanella
2022-12-12 11:40   ` Florian Weimer
2022-11-15 19:31 ` Adhemerval Zanella [this message]
2022-11-15 19:31 ` [PATCH 7/7] Remove set-hooks.h from generic includes Adhemerval Zanella

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=20221115193159.173838-7-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.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).