From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id A9E623838006 for ; Tue, 1 Jun 2021 19:31:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9E623838006 Received: by mail-qk1-x731.google.com with SMTP id k4so17182qkd.0 for ; Tue, 01 Jun 2021 12:31:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LxEAh9ko381HkmNwZ0cNfUz9TmTlOxPDItCZTYVMGek=; b=eyFyLhxapSJdT/aKKya5XyBZUo1ndZfaICGCx5Q48PGhj6TFIom7Or/KkGe4eLLNdD 5D1ltmbSF5br6jgJM0f6nwAc1Tgo8L3cUIcsybjDtwYqmGlBSRsKHq7IlitHo6FMuqWH xEGu72JLQdb91Z4qJMoBz5nN+AoufqCKIyTXclBTHF/WL7ddB/IpgjhZZme1HEQalERy eRUhhpS50tDgdBtW6JRE4KwQKD2D97VpsxoYjlbw/9aRm4JB1ko+raSQHNfgK2Y1eVUL FkosVht1CNbVYpIE6+x2C11EG4hcFnzRiGwpQkvjrvB8E1XenFl66zva0APOiWggbdFp NrVg== X-Gm-Message-State: AOAM532B19RLW53QK+fR7hEtx9FL+vtDx6S+PpPQEmIzUIT3LI15eBOW ZUGvJF/P1Gvw45xRL4c6CX2o34LgD7lKDw== X-Google-Smtp-Source: ABdhPJy+EwU7Sl+2QzQ96MsBXm/tYzGo2xqXjilJ2bfRcr21r3g13LaBecWoIyxWAKLDgAMZQ6oCwA== X-Received: by 2002:a05:620a:14b7:: with SMTP id x23mr23389814qkj.323.1622575894145; Tue, 01 Jun 2021 12:31:34 -0700 (PDT) Received: from [192.168.1.4] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id c11sm10573587qth.29.2021.06.01.12.31.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Jun 2021 12:31:33 -0700 (PDT) Subject: Re: [PATCH v2 04/16] Add libc ABI extension kludge for baseline-violating libdl symbols To: Florian Weimer , libc-alpha@sourceware.org References: <84f59adc6d3b0b84d2ce8ab94e91e1a08a33989e.1622469908.git.fweimer@redhat.com> From: Adhemerval Zanella Message-ID: <9ee84b83-978a-603f-38d9-a8c32c3f86fa@linaro.org> Date: Tue, 1 Jun 2021 16:31:31 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <84f59adc6d3b0b84d2ce8ab94e91e1a08a33989e.1622469908.git.fweimer@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 01 Jun 2021 19:31:36 -0000 On 31/05/2021 11:11, Florian Weimer via Libc-alpha wrote: > Some targets have a GLIBC_2.0 baseline for libdl, while using > GLIBC_2.2 for libc. This means that the generated libc.map file > does not have any version nodes for GLIBC_2.0 or GLIBC_2.1. However, > moving symbols from libdl into libc needs such version nodes. > (Future symbol moves from librt will need this as well.) > > This kludge is only necessary for symbols predating GLIBC_2.2 because > the affected targets use GLIBC_2.2 as the baseline for libc. Given > the small number and fixexd set of affected architectures, no generic Typo 'fixexd' > mechanism is implemented, and instead the map file fragment is > hard-coded in scripts/versions.mk. > > The compat_symbol macro already emits the appropriate version strings, > so no adjustments are needed there. I guess this quite specific mismatched version issue justify this ad-hoc solution. LGTM, thanks. There is only a small nit regarding the version tag name used. Reviewed-by: Adhemerval Zanella > --- > scripts/versions.awk | 26 ++++++++++++++++++- > sysdeps/unix/sysv/linux/hppa/Versions | 1 + > sysdeps/unix/sysv/linux/ia64/Versions | 1 + > sysdeps/unix/sysv/linux/sh/Versions | 1 + > .../unix/sysv/linux/sparc/sparc64/Versions | 1 + > 5 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/scripts/versions.awk b/scripts/versions.awk > index a7154480e3..1e8d8e4dc5 100644 > --- a/scripts/versions.awk > +++ b/scripts/versions.awk > @@ -93,6 +93,26 @@ function ord(c) { > printf("%s %s %s\n", actlib, sortver, $0) | sort; > } > > +# Some targets do not set the ABI baseline for libdl. As a result, > +# symbols originally in libdl need to be moved under historic symbol > +# versions, without altering the baseline version for libc itself. > +/^ *!libc_abi_extension/ { Maybe use a different name like 'libc_compat_versions', the 'extension' wording does not really fits in what it is providing. > + libc_abi_extension_active = 1; > +} > + > +function libc_abi_extension() { > + # No local: * here, so that we do not have to update this script > + # if symbols are moved into libc. The abilist files and the other > + # targets (with a real GLIBC_2.0 baseline) provide testing > + # coverage. > + printf("\ > +GLIBC_2.0 {\n\ > +};\n\ > +GLIBC_2.1 {\n\ > +} GLIBC_2.0;\n\ > +") > outfile; > + return "GLIBC_2.1"; > +} > > function closeversion(name, oldname) { > printf(" local:\n *;\n") > outfile; > @@ -154,7 +174,11 @@ END { > oldlib = $1; > real_outfile = buildroot oldlib ".map"; > outfile = real_outfile "T"; > - veryoldver = ""; > + if ($1 == "libc" && libc_abi_extension_active) { > + veryoldver = libc_abi_extension(); > + } else { > + veryoldver = ""; > + } > printf(" %s.map", oldlib); > } > if ($2 != oldver) { Ok. > diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions > index 9532d207fc..8969fc08af 100644 > --- a/sysdeps/unix/sysv/linux/hppa/Versions > +++ b/sysdeps/unix/sysv/linux/hppa/Versions > @@ -1,3 +1,4 @@ > +!libc_abi_extension > libc { > GLIBC_2.1 { > _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; > diff --git a/sysdeps/unix/sysv/linux/ia64/Versions b/sysdeps/unix/sysv/linux/ia64/Versions > index f6994151aa..7cac57a8e1 100644 > --- a/sysdeps/unix/sysv/linux/ia64/Versions > +++ b/sysdeps/unix/sysv/linux/ia64/Versions > @@ -1,3 +1,4 @@ > +!libc_abi_extension > libc { > GLIBC_2.2 { > ioperm; iopl; > diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions > index 19ba1d8d91..fc89ff1c18 100644 > --- a/sysdeps/unix/sysv/linux/sh/Versions > +++ b/sysdeps/unix/sysv/linux/sh/Versions > @@ -1,3 +1,4 @@ > +!libc_abi_extension > libc { > GLIBC_2.2 { > # functions used in other libraries > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/Versions b/sysdeps/unix/sysv/linux/sparc/sparc64/Versions > index fbea1bb2ef..3059d56f80 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/Versions > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Versions > @@ -1,3 +1,4 @@ > +!libc_abi_extension > libc { > GLIBC_2.0 { > # Exception handling support functions from libgcc >