From patchwork Wed Sep 3 06:55:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 385412 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 A9E0314021A for ; Wed, 3 Sep 2014 16:56:03 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 08B2B8B36D; Wed, 3 Sep 2014 06:56:01 +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 kwce++ThRUTF; Wed, 3 Sep 2014 06:55:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8E1C393CC7; Wed, 3 Sep 2014 06:55:58 +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 7AFB21C2B9E for ; Wed, 3 Sep 2014 06:55:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 770458FE68 for ; Wed, 3 Sep 2014 06:55:57 +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 Ns7-xZapkaZW for ; Wed, 3 Sep 2014 06:55:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0E60E9057C for ; Wed, 3 Sep 2014 06:55:54 +0000 (UTC) Received: from 172.24.2.119 (EHLO szxeml408-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBE23604; Wed, 03 Sep 2014 14:55:50 +0800 (CST) Received: from [127.0.0.1] (10.177.18.231) by szxeml408-hub.china.huawei.com (10.82.67.95) with Microsoft SMTP Server id 14.3.158.1; Wed, 3 Sep 2014 14:55:45 +0800 Message-ID: <5406BB72.60907@huawei.com> Date: Wed, 3 Sep 2014 14:55:46 +0800 From: Yang Yingliang User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Subject: [PATCH v2] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced References: <1409282490-11632-1-git-send-email-yangyingliang@huawei.com> <20140831084037.GJ30210@waldemar-brodkorb.de> In-Reply-To: <20140831084037.GJ30210@waldemar-brodkorb.de> X-Originating-IP: [10.177.18.231] X-CFilter-Loop: Reflected 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 From: Yang Yingliang 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. Other parts don't have this problem, because IS_IN_libpthread is defined by CFLAGS-nptl = -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS), CFLAGS-pthread = $(SSP_ALL_CFLAGS) -DNOT_IN_libc -DIS_IN_libpthread, CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread and CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread. Cc: Waldemar Brodkorb Cc: Bernhard Reutner-Fischer Tested-by: Waldemar Brodkorb Signed-off-by: Yang Yingliang --- Change note: Update changelog to describe other parts' IS_IN_libpthread. Add Tested-by: Waldemar Brodkorb . --- libpthread/nptl/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.0 . 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