From patchwork Fri Apr 29 07:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1624001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=qJPGnCdO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KqNgQ4bWqz9sBB for ; Fri, 29 Apr 2022 17:01:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AAD7F3857432 for ; Fri, 29 Apr 2022 07:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AAD7F3857432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651215663; bh=xMSOhO1VPctQl/HAY/6s1URVA+G+Re3boszWX120w+w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qJPGnCdOgDKC5klYdIzlFFuEocoz+dyMOuovnBSbnCdVJCqPH0tfecROowGs09h+G jwu+1zXTpgMxJHTYBJbjmgCcNRuhX0jzomVAd9MNzQTVZ0DGQYNGXXw0P8YDz7Av1F 19NatftupYQUQBnYPwbdo7lBhDA9d96+9fIA7fXo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 8DA9B3858D1E for ; Fri, 29 Apr 2022 07:00:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DA9B3858D1E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-i8PXVhhJPLiwJF44RTcLww-1; Fri, 29 Apr 2022 03:00:37 -0400 X-MC-Unique: i8PXVhhJPLiwJF44RTcLww-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D0AE381079D for ; Fri, 29 Apr 2022 07:00:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8153414A5060 for ; Fri, 29 Apr 2022 07:00:36 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Do not use --hash-style=both for building glibc shared objects Date: Fri, 29 Apr 2022 09:00:34 +0200 Message-ID: <87levo74rx.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" The comment indicates that --hash-style=both was used to maintain compatibility with static dlopen, but we had many internal ABI changes since then, so this compatiblity does not add value anymore. Tested on i686-linux-gnu and x86_64-linux-gnu. Built with build-many-glibcs.py. Reviewed-by: Carlos O'Donell --- Makeconfig | 9 --------- Makerules | 7 ------- config.make.in | 1 - configure | 28 ---------------------------- configure.ac | 16 ---------------- 5 files changed, 61 deletions(-) diff --git a/Makeconfig b/Makeconfig index 0aa5fb0099..760f14e92f 100644 --- a/Makeconfig +++ b/Makeconfig @@ -362,15 +362,6 @@ relro-LDFLAGS = -Wl,-z,relro LDFLAGS.so += $(relro-LDFLAGS) LDFLAGS-rtld += $(relro-LDFLAGS) -ifeq (yes,$(have-hash-style)) -# For the time being we unconditionally use 'both'. At some time we -# should declare statically linked code as 'out of luck' and compile -# with --hash-style=gnu only. -hashstyle-LDFLAGS = -Wl,--hash-style=both -LDFLAGS.so += $(hashstyle-LDFLAGS) -LDFLAGS-rtld += $(hashstyle-LDFLAGS) -endif - ifeq (no,$(build-pie-default)) pie-default = $(no-pie-ccflag) else # build-pie-default diff --git a/Makerules b/Makerules index 428464f092..354528b8c7 100644 --- a/Makerules +++ b/Makerules @@ -557,13 +557,6 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules -Wl,--verbose 2>/dev/null | \ sed > $@T \ -e '/^=========/,/^=========/!d;/^=========/d' \ - $(if $(filter yes,$(have-hash-style)), \ - -e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ - -e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \ - -e '/DATA_SEGMENT_ALIGN/{H;g}' \ - , \ - -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ - ) \ -e 's/^.*\*(\.dynbss).*$$/& \ PROVIDE(__start___libc_freeres_ptrs = .); \ *(__libc_freeres_ptrs) \ diff --git a/config.make.in b/config.make.in index bf728c71c0..fff4c78dd0 100644 --- a/config.make.in +++ b/config.make.in @@ -70,7 +70,6 @@ have-libcap = @have_libcap@ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@ fno-unit-at-a-time = @fno_unit_at_a_time@ bind-now = @bindnow@ -have-hash-style = @libc_cv_hashstyle@ 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@ diff --git a/configure b/configure index 5a730dc5fc..716dc041b6 100755 --- a/configure +++ b/configure @@ -622,7 +622,6 @@ libc_cv_cc_nofma libc_cv_mtls_dialect_gnu2 fno_unit_at_a_time libc_cv_has_glob_dat -libc_cv_hashstyle libc_cv_fpie libc_cv_z_execstack ASFLAGS_config @@ -6194,33 +6193,6 @@ $as_echo "$libc_cv_fpie" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style option" >&5 -$as_echo_n "checking for --hash-style option... " >&6; } -if ${libc_cv_hashstyle+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then - libc_cv_hashstyle=yes -else - libc_cv_hashstyle=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hashstyle" >&5 -$as_echo "$libc_cv_hashstyle" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_DAT reloc" >&5 $as_echo_n "checking for GLOB_DAT reloc... " >&6; } if ${libc_cv_has_glob_dat+:} false; then : diff --git a/configure.ac b/configure.ac index a045f6608e..d08ad4d64e 100644 --- a/configure.ac +++ b/configure.ac @@ -1360,22 +1360,6 @@ LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no]) AC_SUBST(libc_cv_fpie) -AC_CACHE_CHECK(for --hash-style option, - libc_cv_hashstyle, [dnl -cat > conftest.c <&AS_MESSAGE_LOG_FD]) -then - libc_cv_hashstyle=yes -else - libc_cv_hashstyle=no -fi -rm -f conftest*]) -AC_SUBST(libc_cv_hashstyle) - AC_CACHE_CHECK(for GLOB_DAT reloc, libc_cv_has_glob_dat, [dnl cat > conftest.c <