From patchwork Fri Aug 29 03:21:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 384045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 923B314011E for ; Fri, 29 Aug 2014 13:21:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ED0C3931B7; Fri, 29 Aug 2014 03:21:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e1zIRDoZWJCY; Fri, 29 Aug 2014 03:21:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5FCFE939CA; Fri, 29 Aug 2014 03:21:42 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9C2221C1EA6 for ; Fri, 29 Aug 2014 03:21:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 96EF48C72F for ; Fri, 29 Aug 2014 03:21:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3HPtKega+7rA for ; Fri, 29 Aug 2014 03:21:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id E117C8C638 for ; Fri, 29 Aug 2014 03:21:37 +0000 (UTC) Received: from 172.24.2.119 (EHLO szxeml410-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ATQ94005; Fri, 29 Aug 2014 11:21:34 +0800 (CST) Received: from localhost (10.177.18.231) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Fri, 29 Aug 2014 11:21:30 +0800 From: Yang Yingliang To: Subject: [PATCH] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced Date: Fri, 29 Aug 2014 11:21:30 +0800 Message-ID: <1409282490-11632-1-git-send-email-yangyingliang@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.177.18.231] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.53FFF1BE.00B6,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 45cf6342fa1ae6a77b23339d222c81ea X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org I use uclibc in arch arm. The CFLAGS-pthread_once.c has been set to -DNOT_IN_libc -DIS_IN_libpthread in libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch. But it will be replaced by -fexceptions -fasynchronous-unwind-tables in libpthread/nptl/Makefile.in. If CFLAGS-pthread_once.c has no -DIS_IN_libpthread the testcase tst-once3 in test/nptl/ will be failed. The reason is pthread_once calls another pthread_cleanup_push() which is not under IS_IN_libpthread so that clear_once_control do not be called when the thread is canceled. So pthread_once will hang up when it's called second time. Signed-off-by: Yang Yingliang --- libpthread/nptl/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in index 0008822..1b9ba8c 100644 --- a/libpthread/nptl/Makefile.in +++ b/libpthread/nptl/Makefile.in @@ -186,7 +186,7 @@ CFLAGS-forward.c = -fexceptions CFLAGS-pthread_testcancel.c = -fexceptions CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables -CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \ +CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \ -fasynchronous-unwind-tables CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables