From patchwork Thu Aug 4 09:19:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 655710 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3s4ktH3LpBz9sBR for ; Thu, 4 Aug 2016 19:20:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=UV1JBHyr; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=AQf6BzNv3YqC4RWuw8b9qg7nMD85y 9PVJFch0LAWiLVo6iN2bANYtIEvAnjd1ZthLBctMK9uKv+hg5CtaeNd0ypDUP+3p DZKPT2UitX0ijCgUvjxi0OX3pgNOcnzxvIa85Vi8/zzGgd/+HGkfZMVtbBShmKJR LWEA2+WhqzErE8= 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:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=Vrs6Onv68wyAUey5t6196xCFgLw=; b=UV1 JBHyrMn09mmC5LRIVcvRhw79SzocFic7fnJkQLx2SCB6Hip3FLOgsff8xXn7iA/x gT1udnRRAmiLoD0XOZ4huI3KnW6e4x0uoCKiKs2QziLTCk+/WzsHoVvWiJZYgK0/ /XIgg5BHnzI65wGHRxJT/phlnMLcb1PmVpCdUb4E= Received: (qmail 101118 invoked by alias); 4 Aug 2016 09:19:59 -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 101106 invoked by uid 89); 4 Aug 2016 09:19:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hjltoolsgmailcom, hjl.tools@gmail.com, libc.a, libca X-HELO: mx1.redhat.com To: GNU C Library , "H.J. Lu" From: Florian Weimer Subject: [PATCH] x86: Use sysdep.o from libc.a in static libraries Message-ID: Date: Thu, 4 Aug 2016 11:19:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Fedora needs to relink libpthread.a into a single object file to support some application needs. Starting with commit fb1cf108115f7e2e4510859693431b3473657d77 Author: H.J. Lu Date: Tue Oct 13 11:58:53 2015 -0700 Add INLINE_SYSCALL_ERROR_RETURN_VALUE this prevents static linking due to multiple copies of the functions from sysdep.o. The attached patch skips adding sysdep.o for static libraries. Okay to commit? (No bug filed because this is a downstream bug only, but dropping the additional copy of sysdep.o seems to make sense upstream as well.) Thanks, Florian x86: Use sysdep.o from libc.a in static libraries Static libraries can use the sysdep.o copy in libc.a without a performance penalty. This results in a visible difference if libpthread.a is relinked into a single object file (which is needed to support libraries which check for the presence of certain symbols to enable threading support, which generally fails with static linking unless libpthread.a is relinked). 2016-08-04 Florian Weimer Use sysdep.o from libc.a in static libraries. * sysdeps/unix/sysv/linux/i386/Makefile (libpthread-shared-only-routines): Add sysdep. (librt-shared-only-routines): Likewise. diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index 71ba61e..b015ff7 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -48,9 +48,11 @@ endif ifeq ($(subdir),nptl) # pull in __syscall_error routine libpthread-routines += sysdep +libpthread-shared-only-routines += sysdep endif ifeq ($(subdir),rt) # pull in __syscall_error routine librt-routines += sysdep +librt-shared-only-routines += sysdep endif