Message ID | cover.1625591725.git.fweimer@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@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 BEE293890038 for <patchwork@sourceware.org>; Tue, 6 Jul 2021 17:22:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEE293890038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625592151; bh=o4QYDXUpzrd8sX1BfGWeLkfZC4yb7oz5SppeOp6QL50=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DiiJH9UR1ZdYBAN/jrOYYYRJmW45hhFcsW1u36Vx3Wb+PkPjQi0WBZJOWIqwMHwX7 o6TX7rrw8BSLnV9ORUpGkbwhNm715CVel1YZcfmn7TgDtuKOJIZBXZGsyRe6uw4pNY zPA9zYjxSLrqkbtrlMu52aNnmEpj86nfHc2d2EPk= 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 ESMTP id 652D23861035 for <libc-alpha@sourceware.org>; Tue, 6 Jul 2021 17:22:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 652D23861035 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-456-opsPfEQFOp6SFkGFGw2nrQ-1; Tue, 06 Jul 2021 13:22:04 -0400 X-MC-Unique: opsPfEQFOp6SFkGFGw2nrQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA350100C612 for <libc-alpha@sourceware.org>; Tue, 6 Jul 2021 17:22:03 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-115-5.ams2.redhat.com [10.36.115.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E30B5D9FC for <libc-alpha@sourceware.org>; Tue, 6 Jul 2021 17:22:02 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 0/4] GLIBC_PRIVATE ABI cleanups X-From-Line: 15a8064ccf12caf7ba1088de4b3022aae75610d2 Mon Sep 17 00:00:00 2001 Message-Id: <cover.1625591725.git.fweimer@redhat.com> Date: Tue, 06 Jul 2021 19:22:01 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 <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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series | GLIBC_PRIVATE ABI cleanups | |
Message
Florian Weimer
July 6, 2021, 5:22 p.m. UTC
This is a follow-up due to the libc integration work. I think using the libc locks is the right thing to do for now. In the future, we might migrate nss_db and nss_hesiod to plain pthread_mutex_lock (no __ prefix) and use pthread_mutex_t in them. For nss_files/nss_dns and without libc integration for them, there might be a minimal conformance issue here because there is (I think) a POSIX version which specifies NSS functions but not libpthread. __pthread_mutex_lock, __pthread_mutex_unlock are currently used by rr; I filed at ticket explaining why I think they don't need to that for glibc 2.34 anymore: glibc 2.34 enablement around pthread mutex handling <https://github.com/rr-debugger/rr/issues/2913> We kept the GLIBC_2.34 symbol versions for those initially because we could not migrate all internal uses off a __pthread_mutex_lock@@GLIBC_PRIVATE symbol, and the external users would have bound to a GLIBC_PRIVATE symbol, so GLIBC_2.34 seemed the better choice. Tested on i686-linux-gnu and x86_64-linux-gnu. Built with build-many-glibcs.py. Thanks, Florian Florian Weimer (4): nptl: Use internal low-level lock type for !IS_IN (libc) nptl: Remove GLIBC_2.34 versions of __pthread_mutex_lock, __pthread_mutex_unlock nptl: Reduce the GLIBC_PRIVATE ABI elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols dlfcn/dlerror.c | 1 - elf/Makefile | 16 +-- elf/Versions | 3 - elf/dl-addr.c | 1 - elf/dl-libc.c | 4 - elf/dl-sym.c | 2 - elf/tst-libc_dlvsym-dso.c | 25 ---- elf/tst-libc_dlvsym-static.c | 32 ----- elf/tst-libc_dlvsym.c | 34 ----- elf/tst-libc_dlvsym.h | 130 ------------------ include/dlfcn.h | 30 ++-- nptl/Versions | 44 ------ nptl/pthread_barrier_init.c | 5 +- nptl/pthread_barrier_wait.c | 5 +- nptl/pthread_cond_wait.c | 5 +- nptl/pthread_mutex_lock.c | 5 +- nptl/pthread_mutex_timedlock.c | 5 +- nptl/pthread_mutex_unlock.c | 5 +- nptl/pthread_testcancel.c | 5 +- sysdeps/nptl/libc-lockP.h | 51 +------ sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 - sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 - sysdeps/unix/sysv/linux/arc/libc.abilist | 2 - sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 - sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 - sysdeps/unix/sysv/linux/csky/libc.abilist | 2 - sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 - sysdeps/unix/sysv/linux/i386/libc.abilist | 2 - sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 - .../sysv/linux/m68k/coldfire/libc.abilist | 2 - .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 - .../sysv/linux/microblaze/be/libc.abilist | 2 - .../sysv/linux/microblaze/le/libc.abilist | 2 - .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 - .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 - .../sysv/linux/mips/mips64/n32/libc.abilist | 2 - .../sysv/linux/mips/mips64/n64/libc.abilist | 2 - sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 - .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 - .../powerpc/powerpc32/nofpu/libc.abilist | 2 - .../linux/powerpc/powerpc64/be/libc.abilist | 2 - .../linux/powerpc/powerpc64/le/libc.abilist | 2 - .../unix/sysv/linux/riscv/rv32/libc.abilist | 2 - .../unix/sysv/linux/riscv/rv64/libc.abilist | 2 - .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 - .../unix/sysv/linux/s390/s390-64/libc.abilist | 2 - sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 - sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 - .../sysv/linux/sparc/sparc32/libc.abilist | 2 - .../sysv/linux/sparc/sparc64/libc.abilist | 2 - .../unix/sysv/linux/x86_64/64/libc.abilist | 2 - .../unix/sysv/linux/x86_64/x32/libc.abilist | 2 - 52 files changed, 44 insertions(+), 428 deletions(-) delete mode 100644 elf/tst-libc_dlvsym-dso.c delete mode 100644 elf/tst-libc_dlvsym-static.c delete mode 100644 elf/tst-libc_dlvsym.c delete mode 100644 elf/tst-libc_dlvsym.h
Comments
The 07/06/2021 19:22, Florian Weimer via Libc-alpha wrote: > This is a follow-up due to the libc integration work. > > I think using the libc locks is the right thing to do for now. In the > future, we might migrate nss_db and nss_hesiod to plain > pthread_mutex_lock (no __ prefix) and use pthread_mutex_t in them. For > nss_files/nss_dns and without libc integration for them, there might be > a minimal conformance issue here because there is (I think) a POSIX > version which specifies NSS functions but not libpthread. > > __pthread_mutex_lock, __pthread_mutex_unlock are currently used by rr; I > filed at ticket explaining why I think they don't need to that for glibc > 2.34 anymore: > > glibc 2.34 enablement around pthread mutex handling > <https://github.com/rr-debugger/rr/issues/2913> > > We kept the GLIBC_2.34 symbol versions for those initially because we > could not migrate all internal uses off a > __pthread_mutex_lock@@GLIBC_PRIVATE symbol, and the external users would > have bound to a GLIBC_PRIVATE symbol, so GLIBC_2.34 seemed the better > choice. > > Tested on i686-linux-gnu and x86_64-linux-gnu. Built with > build-many-glibcs.py. > > Thanks, > Florian > > Florian Weimer (4): > nptl: Use internal low-level lock type for !IS_IN (libc) > nptl: Remove GLIBC_2.34 versions of __pthread_mutex_lock, > __pthread_mutex_unlock > nptl: Reduce the GLIBC_PRIVATE ABI > elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols after these commits on arm i see /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_unbind': /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:267: undefined reference to `__libc_do_syscall' /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_get_default_domain': /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:415: undefined reference to `__libc_do_syscall' /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `do_ypcall': /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:332: undefined reference to `__libc_do_syscall' /usr/bin/ld: /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:319: undefined reference to `__libc_do_syscall' /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os): in function `get_ckey': /work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: undefined reference to `__libc_do_syscall' /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os):/work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: more undefined references to `__libc_do_syscall' follow collect2: error: ld returned 1 exit status make[2]: *** [../Makerules:536: /work/glibc-armhf-linux/build/build/nis/libnsl.so] Error 1 make[2]: Target 'others' not remade because of errors. make[2]: Leaving directory '/work/glibc-armhf-linux/build/glibc/nis' make[1]: *** [Makefile:478: nis/others] Error 2
* Szabolcs Nagy: >> Florian Weimer (4): >> nptl: Use internal low-level lock type for !IS_IN (libc) >> nptl: Remove GLIBC_2.34 versions of __pthread_mutex_lock, >> __pthread_mutex_unlock >> nptl: Reduce the GLIBC_PRIVATE ABI >> elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols > > after these commits on arm i see > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_unbind': > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:267: undefined reference to `__libc_do_syscall' > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_get_default_domain': > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:415: undefined reference to `__libc_do_syscall' > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `do_ypcall': > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:332: undefined reference to `__libc_do_syscall' > /usr/bin/ld: /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:319: undefined reference to `__libc_do_syscall' > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os): in function `get_ckey': > /work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: undefined reference to `__libc_do_syscall' > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os):/work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: more undefined references to `__libc_do_syscall' follow > collect2: error: ld returned 1 exit status I did build this on arm-linux-gnueabihf with build-many-glibcs.py, so this is very surprising. Looking at sysdeps/unix/sysv/linux/arm/sysdep.h, I wonder if you are building in thumb mode, and if so, why this isn't covered by build-many-glibcs.py. Is the comment about the r7 register still accurate? Thanks, Florian
The 07/07/2021 13:04, Florian Weimer wrote: > * Szabolcs Nagy: > >> Florian Weimer (4): > >> nptl: Use internal low-level lock type for !IS_IN (libc) > >> nptl: Remove GLIBC_2.34 versions of __pthread_mutex_lock, > >> __pthread_mutex_unlock > >> nptl: Reduce the GLIBC_PRIVATE ABI > >> elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols > > > > after these commits on arm i see > > > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_unbind': > > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:267: undefined reference to `__libc_do_syscall' > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_get_default_domain': > > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:415: undefined reference to `__libc_do_syscall' > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `do_ypcall': > > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:332: undefined reference to `__libc_do_syscall' > > /usr/bin/ld: /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:319: undefined reference to `__libc_do_syscall' > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os): in function `get_ckey': > > /work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: undefined reference to `__libc_do_syscall' > > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os):/work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: more undefined references to `__libc_do_syscall' follow > > collect2: error: ld returned 1 exit status > > I did build this on arm-linux-gnueabihf with build-many-glibcs.py, so > this is very surprising. Looking at > sysdeps/unix/sysv/linux/arm/sysdep.h, I wonder if you are building in > thumb mode, and if so, why this isn't covered by build-many-glibcs.py. > > Is the comment about the r7 register still accurate? yes it seems the compiler defaults to thumb mode: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.2.0-7ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1) and yes i think the comment about r7 is accurate (the compiler won't allow using it) e.g. in thumb mode musl uses inline asm like "mov %1,r7 ; mov r7,%2 ; svc 0 ; mov r7,%1"
* Szabolcs Nagy: > The 07/07/2021 13:04, Florian Weimer wrote: >> * Szabolcs Nagy: >> >> Florian Weimer (4): >> >> nptl: Use internal low-level lock type for !IS_IN (libc) >> >> nptl: Remove GLIBC_2.34 versions of __pthread_mutex_lock, >> >> __pthread_mutex_unlock >> >> nptl: Reduce the GLIBC_PRIVATE ABI >> >> elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols >> > >> > after these commits on arm i see >> > >> > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_unbind': >> > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:267: undefined reference to `__libc_do_syscall' >> > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `__GI_yp_get_default_domain': >> > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:415: undefined reference to `__libc_do_syscall' >> > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(ypclnt.os): in function `do_ypcall': >> > /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:332: undefined reference to `__libc_do_syscall' >> > /usr/bin/ld: /work/glibc-armhf-linux/build/glibc/nis/ypclnt.c:319: undefined reference to `__libc_do_syscall' >> > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os): in function `get_ckey': >> > /work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: undefined reference to `__libc_do_syscall' >> > /usr/bin/ld: /work/glibc-armhf-linux/build/build/nis/libnsl_pic.a(nis_call.os):/work/glibc-armhf-linux/build/glibc/nis/nis_call.c:177: more undefined references to `__libc_do_syscall' follow >> > collect2: error: ld returned 1 exit status >> >> I did build this on arm-linux-gnueabihf with build-many-glibcs.py, so >> this is very surprising. Looking at >> sysdeps/unix/sysv/linux/arm/sysdep.h, I wonder if you are building in >> thumb mode, and if so, why this isn't covered by build-many-glibcs.py. >> >> Is the comment about the r7 register still accurate? > > yes it seems the compiler defaults to thumb mode: How would one select that in a glibc build? Configure with CC="gcc -mthumb" CXX="g++ -mthumb"? If yes, then we should change at least one of the Arm targets to use that. Thanks, Florian
The 07/07/2021 14:44, Florian Weimer wrote: > * Szabolcs Nagy: > > yes it seems the compiler defaults to thumb mode: > > How would one select that in a glibc build? Configure with > CC="gcc -mthumb" CXX="g++ -mthumb"? > > If yes, then we should change at least one of the Arm targets to use > that. yes that makes sense. adding -mthumb to CC should work.