Message ID | 87y2f5wdy5.fsf@oldenburg.str.redhat.com |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC4BE3850418; Tue, 2 Mar 2021 19:30:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC4BE3850418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614713445; bh=wlo/OuilrTAHoyxybCCzZxcjTrB3bmOeRzdPtWlCnBs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l2Ep6Ia0cVWJnZ6XYrBNQ6AUHmlpwpU+Unzfv7XoEzSitVeETiMuSB5JGeQKXmxdK DwLWCtjoG1A2uVu6CUMUeX101sBNe9ucuPZIWZKpi3ot2Au5T5Kn9p/Xv4iBfgc46U W5yvVwmj0Z66mjyUAE1z/77bJZ/9uy1YfFjM5sPs= 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 [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 0B6CF3851C2A for <libc-alpha@sourceware.org>; Tue, 2 Mar 2021 19:30:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B6CF3851C2A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-jBxMNq8pMUGIFxjCuxUVvQ-1; Tue, 02 Mar 2021 14:30:40 -0500 X-MC-Unique: jBxMNq8pMUGIFxjCuxUVvQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 404C918B6144 for <libc-alpha@sourceware.org>; Tue, 2 Mar 2021 19:30:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9883860BFA for <libc-alpha@sourceware.org>; Tue, 2 Mar 2021 19:30:38 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v2] <shlib-compat.h>: Support compat_symbol_reference for _ISOMAC Date: Tue, 02 Mar 2021 20:30:42 +0100 Message-ID: <87y2f5wdy5.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.4 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, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Florian Weimer <fweimer@redhat.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
[v2] <shlib-compat.h>: Support compat_symbol_reference for _ISOMAC
|
|
Commit Message
Florian Weimer
March 2, 2021, 7:30 p.m. UTC
This is helpful for testing compat symbols in cases where _ISOMAC is activated implicitly due to -DMODULE_NAME=testsuite and cannot be disabled easily. --- v2: Now actually tested in the situation where I need it. include/libc-symbols.h | 28 ++++++++++++++-------------- include/shlib-compat.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-)
Comments
On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> wrote: > > This is helpful for testing compat symbols in cases where _ISOMAC > is activated implicitly due to -DMODULE_NAME=testsuite and cannot > be disabled easily. > > --- > v2: Now actually tested in the situation where I need it. > Any particular tests which need this?
* H. J. Lu: > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha > <libc-alpha@sourceware.org> wrote: >> >> This is helpful for testing compat symbols in cases where _ISOMAC >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot >> be disabled easily. >> >> --- >> v2: Now actually tested in the situation where I need it. >> > > Any particular tests which need this? nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, _pthread_cleanup_pop are compatibility symbols. Thanks, Florian
On Tue, Mar 2, 2021 at 1:02 PM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha > > <libc-alpha@sourceware.org> wrote: > >> > >> This is helpful for testing compat symbols in cases where _ISOMAC > >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot > >> be disabled easily. > >> > >> --- > >> v2: Now actually tested in the situation where I need it. > >> > > > > Any particular tests which need this? > > nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, > _pthread_cleanup_pop are compatibility symbols. > Do you just want to link against the older version and nothing else?
On Tue, Mar 2, 2021 at 1:18 PM H.J. Lu <hjl.tools@gmail.com> wrote: > > On Tue, Mar 2, 2021 at 1:02 PM Florian Weimer <fweimer@redhat.com> wrote: > > > > * H. J. Lu: > > > > > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha > > > <libc-alpha@sourceware.org> wrote: > > >> > > >> This is helpful for testing compat symbols in cases where _ISOMAC > > >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot > > >> be disabled easily. > > >> > > >> --- > > >> v2: Now actually tested in the situation where I need it. > > >> > > > > > > Any particular tests which need this? > > > > nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, > > _pthread_cleanup_pop are compatibility symbols. > > > > Do you just want to link against the older version and nothing else? > Why are these tests OK without your patch? malloc/tst-mallocstate.c:compat_symbol_reference (libc, malloc_get_state, malloc_get_state, GLIBC_2_0); malloc/tst-mallocstate.c:compat_symbol_reference (libc, malloc_set_state, malloc_set_state, GLIBC_2_0); posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, glob, GLIBC_2_1); posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, glob, GLIBC_2_0); posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawn, posix_spawn, GLIBC_2_2); posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawnp, posix_spawnp, GLIBC_2_2); resolv/tst-p_secstodate.c:compat_symbol_reference (libresolv, __p_secstodate, __p_secstodate, GLIBC_2_0); sunrpc/tst-svc_register.c:compat_symbol_reference (libc, xdr_pmap, xdr_pmap, GLIBC_2_0); sunrpc/tst-svc_register.c:compat_symbol_reference (libc, svc_unregister, svc_unregister, GLIBC_2_0); sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c:compat_symbol_reference (libc, fcntl, fcntl, GLIBC_2_0); sysdeps/unix/sysv/linux/tst-readdir64-compat.c:compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
* H. J. Lu: > On Tue, Mar 2, 2021 at 1:02 PM Florian Weimer <fweimer@redhat.com> wrote: >> >> * H. J. Lu: >> >> > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha >> > <libc-alpha@sourceware.org> wrote: >> >> >> >> This is helpful for testing compat symbols in cases where _ISOMAC >> >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot >> >> be disabled easily. >> >> >> >> --- >> >> v2: Now actually tested in the situation where I need it. >> >> >> > >> > Any particular tests which need this? >> >> nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, >> _pthread_cleanup_pop are compatibility symbols. > Do you just want to link against the older version and nothing else? It's the only version, but yes. Thanks, Florian
* H. J. Lu: > On Tue, Mar 2, 2021 at 1:18 PM H.J. Lu <hjl.tools@gmail.com> wrote: >> >> On Tue, Mar 2, 2021 at 1:02 PM Florian Weimer <fweimer@redhat.com> wrote: >> > >> > * H. J. Lu: >> > >> > > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha >> > > <libc-alpha@sourceware.org> wrote: >> > >> >> > >> This is helpful for testing compat symbols in cases where _ISOMAC >> > >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot >> > >> be disabled easily. >> > >> >> > >> --- >> > >> v2: Now actually tested in the situation where I need it. >> > >> >> > > >> > > Any particular tests which need this? >> > >> > nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, >> > _pthread_cleanup_pop are compatibility symbols. >> > >> >> Do you just want to link against the older version and nothing else? >> > > Why are these tests OK without your patch? > > malloc/tst-mallocstate.c:compat_symbol_reference (libc, > malloc_get_state, malloc_get_state, GLIBC_2_0); > malloc/tst-mallocstate.c:compat_symbol_reference (libc, > malloc_set_state, malloc_set_state, GLIBC_2_0); tests-internal := tst-mallocstate tst-scratch_buffer > posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, > glob, GLIBC_2_1); > posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, > glob, GLIBC_2_0); > posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawn, > posix_spawn, GLIBC_2_2); > posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawnp, > posix_spawnp, GLIBC_2_2); tests-internal := bug-regex5 bug-regex20 bug-regex33 \ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \ tst-glob_lstat_compat tst-spawn4-compat And so on. tests-internal changes -DMODULE_NAME=. I can't easily do that for nptl/tst-cleanup4aux.c. Maybe we could move some of these other tests from tests-internal to tests because they do not test internals anymore. Thanks, Florian
On Tue, Mar 2, 2021 at 1:28 PM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Tue, Mar 2, 2021 at 1:18 PM H.J. Lu <hjl.tools@gmail.com> wrote: > >> > >> On Tue, Mar 2, 2021 at 1:02 PM Florian Weimer <fweimer@redhat.com> wrote: > >> > > >> > * H. J. Lu: > >> > > >> > > On Tue, Mar 2, 2021 at 12:10 PM Florian Weimer via Libc-alpha > >> > > <libc-alpha@sourceware.org> wrote: > >> > >> > >> > >> This is helpful for testing compat symbols in cases where _ISOMAC > >> > >> is activated implicitly due to -DMODULE_NAME=testsuite and cannot > >> > >> be disabled easily. > >> > >> > >> > >> --- > >> > >> v2: Now actually tested in the situation where I need it. > >> > >> > >> > > > >> > > Any particular tests which need this? > >> > > >> > nptl/tst-cleanup4aux.c will need this once _pthread_cleanup_push, > >> > _pthread_cleanup_pop are compatibility symbols. > >> > > >> > >> Do you just want to link against the older version and nothing else? > >> > > > > Why are these tests OK without your patch? > > > > malloc/tst-mallocstate.c:compat_symbol_reference (libc, > > malloc_get_state, malloc_get_state, GLIBC_2_0); > > malloc/tst-mallocstate.c:compat_symbol_reference (libc, > > malloc_set_state, malloc_set_state, GLIBC_2_0); > > tests-internal := tst-mallocstate tst-scratch_buffer > > > posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, > > glob, GLIBC_2_1); > > posix/tst-glob_lstat_compat.c:compat_symbol_reference (libc, glob, > > glob, GLIBC_2_0); > > posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawn, > > posix_spawn, GLIBC_2_2); > > posix/tst-spawn4-compat.c:compat_symbol_reference (libc, posix_spawnp, > > posix_spawnp, GLIBC_2_2); > > tests-internal := bug-regex5 bug-regex20 bug-regex33 \ > tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \ > tst-glob_lstat_compat tst-spawn4-compat > > And so on. > > tests-internal changes -DMODULE_NAME=. I can't easily do that for > nptl/tst-cleanup4aux.c. > > Maybe we could move some of these other tests from tests-internal to > tests because they do not test internals anymore. Can you submit a patch set to clean up these "internal" tests together with your patch? Thanks.
* H. J. Lu: >> tests-internal := bug-regex5 bug-regex20 bug-regex33 \ >> tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \ >> tst-glob_lstat_compat tst-spawn4-compat >> >> And so on. >> >> tests-internal changes -DMODULE_NAME=. I can't easily do that for >> nptl/tst-cleanup4aux.c. >> >> Maybe we could move some of these other tests from tests-internal to >> tests because they do not test internals anymore. > > Can you submit a patch set to clean up these "internal" tests together > with your patch? I can try and see if they still build as regular tests. Thanks, Florian
On Mär 02 2021, Florian Weimer via Libc-alpha wrote: > diff --git a/include/libc-symbols.h b/include/libc-symbols.h > index ea126ae70c..6e59050da7 100644 > --- a/include/libc-symbols.h > +++ b/include/libc-symbols.h > @@ -59,6 +59,19 @@ > # define IN_MODULE (-1) > #endif > > +/* Use __symbol_version_reference to specify the version a symbol > + reference should link to. Use symbol_version or > + default_symbol_version for the definition of a versioned symbol. > + The difference is that the latter is a no-op in non-shared > + builds. */ > +#ifdef __ASSEMBLER__ > +# define __symbol_version_reference(real, name, version) \ > + .symver real, name##@##version > +#else /* !__ASSEMBLER__ */ > +# define __symbol_version_reference(real, name, version) \ > + __asm__ (".symver " #real "," #name "@" #version) > +#endif Why is the underscore mangling needed? Andreas.
* Andreas Schwab: > On Mär 02 2021, Florian Weimer via Libc-alpha wrote: > >> diff --git a/include/libc-symbols.h b/include/libc-symbols.h >> index ea126ae70c..6e59050da7 100644 >> --- a/include/libc-symbols.h >> +++ b/include/libc-symbols.h >> @@ -59,6 +59,19 @@ >> # define IN_MODULE (-1) >> #endif >> >> +/* Use __symbol_version_reference to specify the version a symbol >> + reference should link to. Use symbol_version or >> + default_symbol_version for the definition of a versioned symbol. >> + The difference is that the latter is a no-op in non-shared >> + builds. */ >> +#ifdef __ASSEMBLER__ >> +# define __symbol_version_reference(real, name, version) \ >> + .symver real, name##@##version >> +#else /* !__ASSEMBLER__ */ >> +# define __symbol_version_reference(real, name, version) \ >> + __asm__ (".symver " #real "," #name "@" #version) >> +#endif > > Why is the underscore mangling needed? I expected many conform test failures because the comment says the file is implicitly included everywhere. But apparently that is not the case, so using a non-mangled name is fine. A few macros (like IS_IN) are already unconditionally defined. Thanks, Florian
* Florian Weimer via Libc-alpha: > * H. J. Lu: > >>> tests-internal := bug-regex5 bug-regex20 bug-regex33 \ >>> tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \ >>> tst-glob_lstat_compat tst-spawn4-compat >>> >>> And so on. >>> >>> tests-internal changes -DMODULE_NAME=. I can't easily do that for >>> nptl/tst-cleanup4aux.c. >>> >>> Maybe we could move some of these other tests from tests-internal to >>> tests because they do not test internals anymore. >> >> Can you submit a patch set to clean up these "internal" tests together >> with your patch? > > I can try and see if they still build as regular tests. So there are some more cleanups that would make sense. I don't think we should use TEST_COMPAT to disable tests, but rather the make macros in Versions.mk (which came later). But that probably needs some discussion, so I want to do these cleanups in a separate patch. Thanks, Florian
* H. J. Lu: > Can you submit a patch set to clean up these "internal" tests together > with your patch? I've posted the cleanup patches now. Thanks, Florian
diff --git a/include/libc-symbols.h b/include/libc-symbols.h index ea126ae70c..6e59050da7 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -59,6 +59,19 @@ # define IN_MODULE (-1) #endif +/* Use __symbol_version_reference to specify the version a symbol + reference should link to. Use symbol_version or + default_symbol_version for the definition of a versioned symbol. + The difference is that the latter is a no-op in non-shared + builds. */ +#ifdef __ASSEMBLER__ +# define __symbol_version_reference(real, name, version) \ + .symver real, name##@##version +#else /* !__ASSEMBLER__ */ +# define __symbol_version_reference(real, name, version) \ + __asm__ (".symver " #real "," #name "@" #version) +#endif + #ifndef _ISOMAC /* This is defined for the compilation of all C library code. features.h @@ -396,22 +409,9 @@ for linking") past the last element in SET. */ #define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set) -/* Use symbol_version_reference to specify the version a symbol - reference should link to. Use symbol_version or - default_symbol_version for the definition of a versioned symbol. - The difference is that the latter is a no-op in non-shared - builds. */ -#ifdef __ASSEMBLER__ -# define symbol_version_reference(real, name, version) \ - .symver real, name##@##version -#else /* !__ASSEMBLER__ */ -# define symbol_version_reference(real, name, version) \ - __asm__ (".symver " #real "," #name "@" #version) -#endif - #ifdef SHARED # define symbol_version(real, name, version) \ - symbol_version_reference(real, name, version) + __symbol_version_reference(real, name, version) # define default_symbol_version(real, name, version) \ _default_symbol_version(real, name, version) # ifdef __ASSEMBLER__ diff --git a/include/shlib-compat.h b/include/shlib-compat.h index 28baef1ea4..e8adef71bf 100644 --- a/include/shlib-compat.h +++ b/include/shlib-compat.h @@ -130,7 +130,7 @@ #define compat_symbol_reference_1(lib, local, symbol, version) \ compat_symbol_reference_2 (local, symbol, VERSION_##lib##_##version) #define compat_symbol_reference_2(local, symbol, name) \ - symbol_version_reference (local, symbol, name) + __symbol_version_reference (local, symbol, name) /* Export the symbol only for shared-library compatibility. */ #define libc_sunrpc_symbol(name, aliasname, version) \