From patchwork Thu Nov 28 13:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1202054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107501-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="KdDUWlsW"; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="cj65itj2"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NySt3G2kz9sP6 for ; Fri, 29 Nov 2019 00:01:34 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=VxJoMwCSiEX38yo8 /KSLBIjYkGy+OiGhBuOoFAMeuQDTQWLOdGwFqz+FnjfA8HNTiQiFDp2o3+nNIYsS s23A/nEu8PsyC09q9vQpqGZyDtu5xfgErbtD9uj5NXWfzp+cHSoQ/pwD1ZrK+iyK fsJzQMb2f1zSgZG2PUoeLU1Vnjs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=3yktyz/wEVCygbfLwbQWlp Atch0=; b=KdDUWlsWnsGjQUqmSIAC7qMAsmB6ahoelpc+q3Grd2G17ff5s0dWCp Gy7zGOL1IQcRS7Qf2Ac29j7bZF/AZtMfCP0EUx7D/WtR1O0ff5rGH7DNlqKEiMiV k4VkKGvwKUY6kVQsjMYwTb+7DBHCgmYc6Jih8FQCXVrFBycHMtNTk= Received: (qmail 85499 invoked by alias); 28 Nov 2019 13:01:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 85449 invoked by uid 89); 28 Nov 2019 13:01:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574946084; 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=NvbbZ6P0V1tiEQvubm6pcZhSjIKEMxVVeeqztiToG3I=; b=cj65itj2wsovgbi5stMNJacB5+DKFg4qVrdSLBo1JqkzeVSPxYm2GHdmcs1vnFr/5TJERS I5V8/Bdu7lMPLyPMhGWDxL1pkfyCh/Pkat0sVz5Vr0CUpO2oI+Vsf8pJe4qPGlOp6l8gJf StJBi54Rpto9T/CdEjPKRMS5jMtbL/U= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 1/3] nptl_db: Install libthread_db under a regular implementation name In-Reply-To: References: Message-Id: <21acb7886147c07e09f5d198ab6bb4b215f41369.1574945909.git.fweimer@redhat.com> Date: Thu, 28 Nov 2019 14:01:19 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Currently, the name is always libthread_db-1.0.so. It does not change with the glibc version, like the other libraries. GDB hard-codes libthread_db.so.1 (the soname), so this change does not affect loading libthread_db. Tested on x86_64-linux-gnu, in an environment where the nptl GDB tests actually run. --- nptl_db/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/nptl_db/Makefile b/nptl_db/Makefile index bbe38ca273..ba66107cee 100644 --- a/nptl_db/Makefile +++ b/nptl_db/Makefile @@ -21,8 +21,6 @@ subdir := nptl_db include ../Makeconfig -nptl_db-version = 1.0 - extra-libs = libthread_db extra-libs-others := $(extra-libs) From patchwork Thu Nov 28 13:01:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1202056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107502-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="AoBh+XAk"; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="U7Xw+Jar"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NyTR00LNz9sPK for ; Fri, 29 Nov 2019 00:02:02 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=vyFazPnI2KpuRt4u CN4tWe1aYwkzAHopS11dYKnPYzxTPILKpRnAHg44s4U/DUEU0HCbEgnyA07wcXh6 wXgVby6zGhinQyG+o3cUedGh3f19PAPZZOp+lUtEorm793Nr6sJdwV1NRTIdyRro NPYbTNn0vHx1X6ormjhPxjAQRs8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=JsyJmgUJ06DoGF7Y/P8lSa 9zNds=; b=AoBh+XAkYXyoM4SLBMfPenB20wE2oVii1EOcM56D8wD1kiXISYwbdW 7832siVXKg6z3OF9HFIfX5EpGZdU3i/byX97Yxk/AkNkVtn3vtPo9z/HMRUE833d /x7QJ2kny+vlWW3pNmKDkFNbIVv3SWmcT/nKZa87owbuRQObj9nEI= Received: (qmail 86268 invoked by alias); 28 Nov 2019 13:01:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 86190 invoked by uid 89); 28 Nov 2019 13:01:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=l, L, so, o X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574946090; 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=4eK7hH6355dDQv1gC+YNF80l8DpOMJx7JjjuCCezPEM=; b=U7Xw+JarKt+nw028qC0IoKo5Ez+7JNEWr89dShEzO8EINfx/kwzOt1GQiHa4Oey6pkFwih xNHkEWLRt3slOJdAAMBePxuVL/788cLzgUMYV2Y3AuX0/uV/oU0+L2h8Pc0w/h0GQoPnyZ whJsSbXMMq0mOW9Ubo1qruTRm74uyaw= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 2/3] Makerules: Remove lib-version, $(subdir-version) In-Reply-To: References: Message-Id: <1d809de12a6bee31860c1156b3afea47331015f1.1574945909.git.fweimer@redhat.com> Date: Thu, 28 Nov 2019 14:01:25 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Also clarify that the “versioned” term refers to the soname, not the glibc version (which also ends up in the installed file name). I verified on x86_64-linux-gnu that “make install” produces the same files. --- Makerules | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/Makerules b/Makerules index f5134586fa..bf6ffee186 100644 --- a/Makerules +++ b/Makerules @@ -984,22 +984,21 @@ install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so)) install-lib := $(filter-out %.so %_pic.a,$(install-lib)) ifeq (yes,$(build-shared)) -# Find which .so's have versions. +# Find which .so's have a version number in their soname. versioned := $(strip $(foreach so,$(install-lib.so),\ $(patsubst %,$(so),$($(so)-version)))) install-lib.so-versioned := $(filter $(versioned), $(install-lib.so)) install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so)) -# For versioned libraries, we install three files: +# For libraries whose soname have version numbers, we install three files: # $(inst_libdir)/libfoo.so -- for linking, symlink or ld script # $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink # $(inst_slibdir)/libfoo-X.Y.Z.so -- the real shared object file -lib-version := $(firstword $($(subdir)-version) $(version)) install-lib-nosubdir: $(install-lib.so-unversioned:%=$(inst_slibdir)/%) \ $(foreach L,$(install-lib.so-versioned),\ $(inst_libdir)/$L \ - $(inst_slibdir)/$(L:.so=)-$(lib-version).so \ + $(inst_slibdir)/$(L:.so=)-$(version).so \ $(inst_slibdir)/$L$($L-version)) # Install all the unversioned shared libraries. @@ -1135,7 +1134,6 @@ include $(o-iterator) generated += $(foreach o,$(versioned),$o$($o-version)) -ifeq (,$($(subdir)-version)) define o-iterator-doit $(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so \ $(+force); @@ -1150,23 +1148,7 @@ $(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o $(+force); endef object-suffixes-left := $(versioned) include $(o-iterator) -else -define o-iterator-doit -$(inst_slibdir)/$o$($o-version): \ - $(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so $(+force); - $$(make-shlib-link) -endef -object-suffixes-left := $(versioned) -include $(o-iterator) - -define o-iterator-doit -$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o $(+force); - $$(do-install-program) -endef -object-suffixes-left := $(versioned) -include $(o-iterator) -endif -endif +endif # ifneq (,$(versioned)) define do-install-so $(do-install-program) From patchwork Thu Nov 28 13:01:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1202057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107503-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="jn8mdfUU"; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="U4CAG6Uj"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NyTd5QHrz9sPL for ; Fri, 29 Nov 2019 00:02:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=yTif/KoVOhV3R8Px Gfe4XLQzsp31XjTANYynY8KatTB5pF11PTDBhR9gKDzVc4KQbG72pAGkDr51W2sZ Yf5QzGn+j9cZE/z1Cljp5n4oOE3Yw4xhV3dzujrtcaRxXEHnAi5iTvFRyDTs52zq c7Nkpv6rk81H0ONxm49jKlJEDl0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:in-reply-to:references :message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=dP1dowEGT0qdLIY6JtKfP+ BLruA=; b=jn8mdfUURCpu811VyWbPlardZqs1hiPQbbXBMhzZzSTqEVGzMMcAEb IDoe5LCzcRZ7zN41C2yg59GLPOT74njm5Ra2pfXNpha3mOBdDD9sVz3DIfWKDJL4 kqlLfgBQzSwEVXGzlcRuvM6B8T9oO0ia3B7oub1KitegywreMZgaI= Received: (qmail 88559 invoked by alias); 28 Nov 2019 13:01:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 87361 invoked by uid 89); 28 Nov 2019 13:01:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=UD:st, increased, 9987, 99114 X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574946097; 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=peujy89HbBzoJ+yY0maOfI+HCRO32lGSVD5hX5Ztzf0=; b=U4CAG6UjgLqFtF1DBX6T4aYURyw1Z+6/AQ7+0ZxJH7vX/Jjv0RfrmeCeyy/5mGIgj6OXkN 3lVnpCtcabrXBNQd/s7UcVayMBGjuTb9KeqYR8JUCOgcsU0pWW1isEXcNVlZ4wAYbOaQR+ XILaYS528RY+fA1HKlEfFIzlUzisX9E= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 3/3] Add --disable-major-minor-libraries configure option In-Reply-To: References: Message-Id: <6d6f77fc251774d14246de794eea86e1da291d1c.1574945909.git.fweimer@redhat.com> Date: Thu, 28 Nov 2019 14:01:31 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 This option can be used to increase compatibility with package managers. The name was choosen to avoid confusion with all the different versions (glibc release, soname versions, symbol versions). This patch makes all uses of -$(version).so conditional on the new $(major-minor-libraries) flag. The alternative install targets write the implementation DSOs directly to the locations determined by their sonames, skipping the creation of an intermediate symbolic link. install-symbolic-link in Makerules is updated not to require the $(symbolic-link-list) file because it may not exist in --disable-major-minor-libraries mode. I verified that by default, the install tree is the same as before on x86_64-linux-gnu except for the changes in the manual. --- INSTALL | 10 ++++++++++ Makefile | 4 +++- Makerules | 26 +++++++++++++++++++++++++- config.make.in | 1 + configure | 15 +++++++++++++++ configure.ac | 7 +++++++ elf/Makefile | 8 +++++++- manual/install.texi | 9 +++++++++ 8 files changed, 77 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 392537cc5c..6d61f396ac 100644 --- a/INSTALL +++ b/INSTALL @@ -181,6 +181,16 @@ if 'CFLAGS' is specified it must enable optimization. For example: RELRO and a read-only global offset table (GOT), at the cost of slightly increased program load times. +'--disable-major-minor-libraries' + Do not install shared objects under file names that contain the + major and minor version of the GNU C Library. By default, such + names are used, and the names defined by the ABI are provided as + symbolic links only. This causes problems with certain package + managers during library upgrades and (in particular) downgrades, so + this option can be used to install these shared objects directly + under their ABI-defined names, without an additional indirection + via symbolic links. + '--enable-pt_chown' The file 'pt_chown' is a helper binary for 'grantpt' (*note Pseudo-Terminals: Allocation.) that is installed setuid root to fix diff --git a/Makefile b/Makefile index fae71aa287..89b776d88c 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,9 @@ ifeq (yes,$(build-shared)) install: install-symbolic-link .PHONY: install-symbolic-link install-symbolic-link: subdir_install - $(symbolic-link-prog) $(symbolic-link-list) + if test -e $(symbolic-link-list) ; then \ + $(symbolic-link-prog) $(symbolic-link-list); \ + fi rm -f $(symbolic-link-list) install: diff --git a/Makerules b/Makerules index bf6ffee186..032e6441b2 100644 --- a/Makerules +++ b/Makerules @@ -991,6 +991,14 @@ versioned := $(strip $(foreach so,$(install-lib.so),\ install-lib.so-versioned := $(filter $(versioned), $(install-lib.so)) install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so)) +# $(install-major-minor-libraries) is used within install-lib-nosubdir +# to trigger installation of the actual implementation file. +ifeq (yes,$(major-minor-libraries)) +install-major-minor-libraries = $(inst_slibdir)/$(L:.so=)-$(version).so +else +install-major-minor-libraries = +endif + # For libraries whose soname have version numbers, we install three files: # $(inst_libdir)/libfoo.so -- for linking, symlink or ld script # $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink @@ -998,7 +1006,7 @@ install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so)) install-lib-nosubdir: $(install-lib.so-unversioned:%=$(inst_slibdir)/%) \ $(foreach L,$(install-lib.so-versioned),\ $(inst_libdir)/$L \ - $(inst_slibdir)/$(L:.so=)-$(version).so \ + $(install-major-minor-libraries) \ $(inst_slibdir)/$L$($L-version)) # Install all the unversioned shared libraries. @@ -1051,6 +1059,7 @@ endef endif ifdef libc.so-version +ifeq (yes,$(major-minor-libraries)) # For a library specified to be version N, install three files: # libc.so -> libc.so.N (e.g. libc.so.6) # libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so) @@ -1060,6 +1069,11 @@ $(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so \ $(make-shlib-link) $(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so $(+force) $(do-install-program) +else # !$(major-minor-libraries) +$(inst_slibdir)/libc.so$(libc.so-version): $(common-objpfx)libc.so $(+force) + $(do-install-program) +endif # !$(major-minor-libraries) + install: $(inst_slibdir)/libc.so$(libc.so-version) # This fragment of linker script gives the OUTPUT_FORMAT statement @@ -1134,6 +1148,7 @@ include $(o-iterator) generated += $(foreach o,$(versioned),$o$($o-version)) +ifeq (yes,$(major-minor-libraries)) define o-iterator-doit $(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so \ $(+force); @@ -1148,6 +1163,15 @@ $(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o $(+force); endef object-suffixes-left := $(versioned) include $(o-iterator) + +else # !$(major-minor-libraries) +define o-iterator-doit +$(inst_slibdir)/$o$($o-version): $(objpfx)$o $(+force); + $$(do-install-program) +endef +object-suffixes-left := $(versioned) +include $(o-iterator) +endif # !$(major-minor-libraries) endif # ifneq (,$(versioned)) define do-install-so diff --git a/config.make.in b/config.make.in index 2fed3da773..ad48e54754 100644 --- a/config.make.in +++ b/config.make.in @@ -71,6 +71,7 @@ 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@ +major-minor-libraries = @major_minor_libraries@ have-hash-style = @libc_cv_hashstyle@ use-default-link = @use_default_link@ output-format = @libc_cv_output_format@ diff --git a/configure b/configure index 2f44b66656..808fa8cd3d 100755 --- a/configure +++ b/configure @@ -682,6 +682,7 @@ experimental_malloc enable_werror all_warnings force_install +major_minor_libraries bindnow hardcoded_path_in_tests enable_timezone_tools @@ -776,6 +777,7 @@ enable_hidden_plt enable_bind_now enable_stack_protector enable_static_nss +enable_major_minor_libraries enable_force_install enable_maintainer_mode enable_kernel @@ -1441,6 +1443,10 @@ Optional Features: Use -fstack-protector[-all|-strong] to detect glibc buffer overflows --enable-static-nss build static NSS modules [default=no] + --enable-major-minor-libraries + install most shared objects under names based on the + glibc version, with symbolic links to them + [default=yes] --disable-force-install don't force installation of files from this package, even if they are older than the installed files --enable-maintainer-mode @@ -3463,6 +3469,15 @@ if test x"$static_nss" = xyes || test x"$shared" = xno; then fi +# Check whether --enable-major-minor-libraries was given. +if test "${enable_major_minor_libraries+set}" = set; then : + enableval=$enable_major_minor_libraries; major_minor_libraries=$enableval +else + major_minor_libraries=yes +fi + + + # Check whether --enable-force-install was given. if test "${enable_force_install+set}" = set; then : enableval=$enable_force_install; force_install=$enableval diff --git a/configure.ac b/configure.ac index e69c88c543..c374eea065 100644 --- a/configure.ac +++ b/configure.ac @@ -251,6 +251,13 @@ if test x"$static_nss" = xyes || test x"$shared" = xno; then AC_DEFINE(DO_STATIC_NSS) fi +AC_ARG_ENABLE([major-minor-libraries], + AC_HELP_STRING([--enable-major-minor-libraries], + [install most shared objects under names based on the glibc version, with symbolic links to them @<:@default=yes@:>@]), + [major_minor_libraries=$enableval], + [major_minor_libraries=yes]) +AC_SUBST(major_minor_libraries) + AC_ARG_ENABLE([force-install], AC_HELP_STRING([--disable-force-install], [don't force installation of files from this package, even if they are older than the installed files]), diff --git a/elf/Makefile b/elf/Makefile index 305bed2d38..e3e898b1cc 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -553,6 +553,7 @@ $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx). ifeq (yes,$(build-shared)) +ifeq (yes,$(major-minor-libraries)) $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) $(make-target-directory) $(do-install-program) @@ -562,11 +563,16 @@ $(inst_rtlddir)/$(rtld-installed-name): \ $(inst_slibdir)/libc-$(version).so $(make-target-directory) $(make-shlib-link) +else # !$(major-minor-libraries) +$(inst_slibdir)/$(rtld-installed-name): $(objpfx)ld.so $(+force) + $(make-target-directory) + $(do-install-program) +endif # !$(major-minor-libraries) # Special target called by parent to install just the dynamic linker. .PHONY: ldso_install ldso_install: $(inst_rtlddir)/$(rtld-installed-name) -endif +endif # $(build-shared) ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ diff --git a/manual/install.texi b/manual/install.texi index b2d569ac5a..d98f026f4a 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -209,6 +209,15 @@ provides additional security hardening because it enables full RELRO and a read-only global offset table (GOT), at the cost of slightly increased program load times. +@item --disable-major-minor-libraries +Do not install shared objects under file names that contain the major +and minor version of @theglibc. By default, such names are used, and +the names defined by the ABI are provided as symbolic links only. This +causes problems with certain package managers during library upgrades +and (in particular) downgrades, so this option can be used to install +these shared objects directly under their ABI-defined names, without an +additional indirection via symbolic links. + @pindex pt_chown @findex grantpt @item --enable-pt_chown