From patchwork Fri Jun 24 19:06:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Lisovskiy X-Patchwork-Id: 640385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rbnnQ03jtz9s9Y for ; Sat, 25 Jun 2016 05:04:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=cmIKYQvo; dkim-atps=neutral Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id C817C10126; Fri, 24 Jun 2016 21:04:18 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by helium.openadk.org (Postfix) with ESMTPS id 5305610112; Fri, 24 Jun 2016 21:04:15 +0200 (CEST) Received: by mail-lf0-f67.google.com with SMTP id a2so22659724lfe.3; Fri, 24 Jun 2016 12:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AUJPhq1e16/+VDu07b3FBXmDqgW+H7vpf6RqHfkvj7I=; b=cmIKYQvoEdLf+Y7IhPgVnFhdTIc2prFiqgNxJNnlWZc2/K26RM61lzSCYSNI/ZVNMG bNtNRhcAvLKHIqAY5o+u7Y2cCZZgI5lsEvRj7tElm6wDUnC/7lFsmPhuOoQMNkHuBao7 WOGkCbudC7c2VZSKC+2cud0Bg6ZiaI5F4tD0x288rRjjHJOET8RGJcNnt5udjnNbUFb5 w6hd6TRfIdOgOeLRGi/bulG7IoXTeNe9VOsPZBbJaKeiyj75VuPdvUPNpT6ztKHaNzLf wXBxD1auGGPyQW9uHCkWPHVvYgcX6ZlIzxCbw28HsRG9wbg8TUzx+6b1AcoxOdzGpDnF Gliw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AUJPhq1e16/+VDu07b3FBXmDqgW+H7vpf6RqHfkvj7I=; b=h30GrHyncg6kVpuxCvq1oVlcilZnqoknrWXrwAM8OHytZ/AxND7oZWCt5ePkoFBoiN L7SIt1nOVCQdLw5HoL4AHUHkYbbH3cEwRNM5VSZilDRcz+yPtDCEr3j1584vJdmSGZsW 0wGr3AY3uwv7rvEd+gkJozx+o0XqNS6P9P93wNvLBzTpy2IiuZyCzD9zi7CfGBp2TV6t N76o0LX6bjKUQC3mGgC4cHRbtUwR2UyfsKnmxDHhlaG/jOu2d1n2hghPAwI2IjWW5noo J6mP5Jzf+sctGJxWboXcuzPw1PfoyLgi3YnvqyWyMJIZNezC7ncJyfAe5Xc8re95Wgoz mt3A== X-Gm-Message-State: ALyK8tLvCBUP2tM564Sw6uXJ2XMShdyoiuD3L2QIvKX+prwi+BReJ1MxoUzCndX1ZQd+3A== X-Received: by 10.25.18.90 with SMTP id h87mr1580589lfi.183.1466795054358; Fri, 24 Jun 2016 12:04:14 -0700 (PDT) Received: from daisy.hcn-strela.net (daisy.order.hcn-strela.ru. [91.192.71.110]) by smtp.gmail.com with ESMTPSA id g28sm1088823lji.45.2016.06.24.12.04.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 12:04:13 -0700 (PDT) From: Leonid Lisovskiy To: devel@uclibc-ng.org Date: Fri, 24 Jun 2016 22:06:32 +0300 Message-Id: <1466795192-4031-1-git-send-email-lly.dev@gmail.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <20160619174430.GD2584@waldemar-brodkorb.de> References: <20160619174430.GD2584@waldemar-brodkorb.de> Subject: [uclibc-ng-devel] [PATCH] bits/sigset.h: Fix _EXTERN_INLINE redefinition X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Commit 251a3c19cb "sleep: employ __USE_EXTERN_INLINES (with necessary fixes)" introduces following problems: 1. __USE_EXTERN_INLINES forcibly enabled build fails ... LD libuClibc-1.0.15.so libc/libc_so.a(cmsg_nxthdr.os): In function `__GI___cmsg_nxthdr': cmsg_nxthdr.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr' libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here libc/libc_so.a(creat.os): In function `__GI___cmsg_nxthdr': creat.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr' libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here ... 2. libuargp wrongly contains __cmsg_nxthdr/__sigismember/__sigdelset/__sigaddset global symbols on platforms which includes signal.h from sys/procfs.h As result, static linking will fail: TEST_LINK argp/ bug-argp1 /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigismember': sigsetops.c:(.text+0x0): multiple definition of `__sigismember' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x0): first defined here /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigaddset': sigsetops.c:(.text+0x28): multiple definition of `__sigaddset' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x28): first defined here /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigdelset': sigsetops.c:(.text+0x4c): multiple definition of `__sigdelset' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x4c): first defined here We have to partially revert 251a3c19cb to fix problems above. It is safe to do this after commit 162cfaea20 *: inline constant __sig{add,del}set and __sigismember since we are able to use new inlines from within libc and leave the rest of world(__USE_EXTERN_INLINES) equal to glibc now. Signed-off-by: Leonid Lisovskiy --- libc/signal/sigsetops.c | 2 +- libc/sysdeps/linux/common/bits/sigset.h | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/libc/signal/sigsetops.c b/libc/signal/sigsetops.c index fa5fe6a..da5803e 100644 --- a/libc/signal/sigsetops.c +++ b/libc/signal/sigsetops.c @@ -3,7 +3,7 @@ #include -#define __PROVIDE_OUT_OF_LINE_SIGSETFN +#define _EXTERN_INLINE #ifndef __USE_EXTERN_INLINES # define __USE_EXTERN_INLINES 1 #endif diff --git a/libc/sysdeps/linux/common/bits/sigset.h b/libc/sysdeps/linux/common/bits/sigset.h index f220e81..2c9fe74 100644 --- a/libc/sysdeps/linux/common/bits/sigset.h +++ b/libc/sysdeps/linux/common/bits/sigset.h @@ -52,6 +52,10 @@ typedef struct { #if !defined _SIGSET_H_fns && defined _SIGNAL_H # define _SIGSET_H_fns 1 +# ifndef _EXTERN_INLINE +# define _EXTERN_INLINE __extern_inline +# endif + /* Return a mask that includes the bit for SIG only. */ /* Unsigned cast ensures shift/mask insns are used. */ # define __sigmask(sig) \ @@ -151,24 +155,14 @@ typedef struct { /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ -# if !defined __USE_EXTERN_INLINES || defined __PROVIDE_OUT_OF_LINE_SIGSETFN extern int __sigismember (const __sigset_t *, int); libc_hidden_proto(__sigismember) extern void __sigaddset (__sigset_t *, int); libc_hidden_proto(__sigaddset) extern void __sigdelset (__sigset_t *, int); libc_hidden_proto(__sigdelset) -# endif # ifdef __USE_EXTERN_INLINES -# undef _EXTERN_INLINE -# ifdef __PROVIDE_OUT_OF_LINE_SIGSETFN -# define _EXTERN_INLINE -# else /* normal case */ - /* dropped extern below: otherwise every module with __USE_EXTERN_INLINES - * will have its own copy of out-of line function emitted. */ -# define _EXTERN_INLINE /*extern*/ __always_inline -# endif # define __SIGSETFN(RET_TYPE, NAME, BODY, CONST) \ _EXTERN_INLINE RET_TYPE \ NAME (CONST __sigset_t *__set, int __sig) \