From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 042153858D28 for ; Sat, 4 Mar 2023 17:39:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 042153858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677951596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PUqK51hpw0Hud74ym4SVrviplP3eUg2q5GWA5bg6MQU=; b=hC+ZldELLnTYs6fvER8RIf9iUz9jJi3zqbw/PpLWZjbNYRrrjQD+zHL+5hqbHLjqig144I 6KVVW6cMjSpkd9RHyhLd0dJegw3DNc1+uYU3YFigJY/RTA07GmpfUdVXAb82TIPQCFf37j E6FuxmAcLGjCFFAQmY+bbxVgK1+y9hU= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-444--PmuGcY4MSeppJmOdQKDmg-1; Sat, 04 Mar 2023 12:39:53 -0500 X-MC-Unique: -PmuGcY4MSeppJmOdQKDmg-1 Received: by mail-io1-f69.google.com with SMTP id b26-20020a5d805a000000b0074cfe3a44aeso3086029ior.10 for ; Sat, 04 Mar 2023 09:39:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677951592; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tl/MXvYTJqJ/fsDCOVh+DDfBunXYg0N0oJpp+kgbPIY=; b=yS+jF3IQ4yMWJKur3quz+7gPSmLfmd5DDeXyVct7wxZrR7s8DQObralVLiuXLuLjy7 zxnN1QpDMYyJ9rbyhoqzzUr5MJ01uQVzs82yL6irSpEaVA4I7J0W167V/SENBwOIvNpK ankK658MZ+YdQ2aZtdNkc0joHUP8Kym0Ab3WZwpd2FKQMAnaTPFnwJvRiSTwU04p6Wys zQSfFUM4lpE4Ao+aHawGejWs0u910dl4//MReFcCLAFTXyZYYSoFbPMJ2HWLWLXKxNwp UOokvru/XgIBAfGuCe7dfwnWsbRZp4n3WYRhkQ9R2BhZ6oBzFQ+nAtJBFIR0tGP85oHf l4jQ== X-Gm-Message-State: AO0yUKU5Vs/VyuKXq9Yueni81eFcucliSeNAFZ0/cepwsuSqX1CwJ2g9 5C9oNlPxso9B+AmwKJZYoPwAyPBgrcBTNIHLqRjoPaHJNkPnjxK6Maw7gI4nrKrxruoa8ejTw/C 5bGKPzFUrQ+LxtBUMidKr X-Received: by 2002:a6b:6a1a:0:b0:704:b905:e652 with SMTP id x26-20020a6b6a1a000000b00704b905e652mr3492728iog.11.1677951592028; Sat, 04 Mar 2023 09:39:52 -0800 (PST) X-Google-Smtp-Source: AK7set//n5p1s5DVjeqBqlu4Pk4Uz0foKlkM8maCmOJR0K9BKEaK+bZI/pLIyrizgHRb+JeyFgQdSQ== X-Received: by 2002:a6b:6a1a:0:b0:704:b905:e652 with SMTP id x26-20020a6b6a1a000000b00704b905e652mr3492719iog.11.1677951591731; Sat, 04 Mar 2023 09:39:51 -0800 (PST) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id v12-20020a6b5b0c000000b00746cb6d90c0sm1686048ioh.14.2023.03.04.09.39.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Mar 2023 09:39:51 -0800 (PST) Message-ID: <1965273d-2885-253a-a00a-2f1d0eb9f9da@redhat.com> Date: Sat, 4 Mar 2023 12:39:50 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3 3/4] Remove --with-default-link configure option To: Adhemerval Zanella , libc-alpha@sourceware.org, Florian Weimer References: <20221227211145.3765256-1-adhemerval.zanella@linaro.org> <20221227211145.3765256-4-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221227211145.3765256-4-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-22.1 required=5.0 tests=BAYES_00,DKIM_INVALID,DKIM_SIGNED,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/27/22 16:11, Adhemerval Zanella via Libc-alpha wrote: > Now that there is no need to use a special linker script to hardening s/hardening/harden/g > internal data structures, remove the --with-default-link configure > option and associated definitions. LGTM. Please post v4. Reviewed-by: Carlos O'Donell > --- > 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. > - OK. > '--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 = > - OK. > define build-shlib > -$(build-shlib-helper) -o $@ $(shlib-lds-flags) \ > +$(build-shlib-helper) -o $@ \ OK. > $(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 OK. > > # 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 > > 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@ OK. > 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 62c2581cb0..df2e126e6f 100755 > --- a/configure > +++ b/configure > @@ -678,7 +678,6 @@ hardcoded_path_in_tests > enable_timezone_tools > rtld_early_cflags > extra_nonshared_cflags > -use_default_link > sysheaders > ac_ct_CXX > CXXFLAGS > @@ -756,7 +755,6 @@ with_gd_lib > with_binutils > with_selinux > with_headers > -with_default_link > with_nonshared_cflags > with_rtld_early_cflags > with_timeoutfactor > @@ -1475,7 +1473,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 OK. > --with-nonshared-cflags=CFLAGS > build nonshared libraries with additional CFLAGS > --with-rtld-early-cflags=CFLAGS > @@ -3459,16 +3456,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 > - > - > - OK. > # 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 022b8f68bc..a57303938e 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]) > - OK. > 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 f5157030c4..05f9b6dd54 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -1233,8 +1233,6 @@ endif > # Command to link into a larger single relocatable object. > reloc-link = $(LINK.o) -nostdlib -nostartfiles -r > > -$(objpfx)sotruss-lib.so: $(shlib-lds) > - OK. > $(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 OK. -- Cheers, Carlos.