From patchwork Fri Aug 29 15:19:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 384280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 0C58814011E for ; Sat, 30 Aug 2014 01:19:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 09F029163D; Fri, 29 Aug 2014 15:19:24 +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 yzGm80-EALIY; Fri, 29 Aug 2014 15:19:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6151A8F94B; Fri, 29 Aug 2014 15:19:22 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 303281C43FC for ; Fri, 29 Aug 2014 15:19:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2DBA194CB7 for ; Fri, 29 Aug 2014 15:19:21 +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 CA3u0dcBefJH for ; Fri, 29 Aug 2014 15:19:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by hemlock.osuosl.org (Postfix) with ESMTPS id 06FA394CB5 for ; Fri, 29 Aug 2014 15:19:19 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id p9so2805466lbv.33 for ; Fri, 29 Aug 2014 08:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Sfhy3IBk+97rpDTbQwqzJqsIHntwU4y8SN3qK2Ntuug=; b=McFBeV5JGqtL5vGmPfAOK8fze39c5XaUBwD/DDDULuIKSquTFAQq1nf33GntkOgGkk 2hWaUsoUpvBmvUj4i69pa0rL8I6ouC/KUU0C/wyQBoimtVfLQO1MexYC+5DQxE4l1a/R ANtj66WB898jcL4dggBTWHymFgRM0y4E7+7sg82jNDkRp/iAt313icb/vi14YTyig9q7 cTz3/L5c0EiBQ0eiZX9HG6IM666N3UHmehLxiBmkP1OPPxkiT8oVITj2WoPLTr8dPaD7 Ck++lU7vftusIb+/Ps4gCiF2qKv1DA6UZuMv+dBsIJn7Y4Nf7QWrBOiEmdZ5iTrVwxz0 2fMg== MIME-Version: 1.0 X-Received: by 10.152.245.171 with SMTP id xp11mr11946806lac.61.1409325557897; Fri, 29 Aug 2014 08:19:17 -0700 (PDT) Received: by 10.114.74.226 with HTTP; Fri, 29 Aug 2014 08:19:17 -0700 (PDT) In-Reply-To: <1409282490-11632-1-git-send-email-yangyingliang@huawei.com> References: <1409282490-11632-1-git-send-email-yangyingliang@huawei.com> Date: Fri, 29 Aug 2014 17:19:17 +0200 Message-ID: Subject: Re: [PATCH] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced From: Bernhard Reutner-Fischer To: Yang Yingliang Cc: uClibc 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 On 29 August 2014 05:21, Yang Yingliang wrote: > 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. yea, but the other parts of libpthread.{so,a} suffer from the same problem, don't they? I.e. We should rather do something like: $(libpthread_libc_OBJS:.o=.c)), $(libc-shared-routines-y)) libc-static-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-static-routines-y)) @@ -62,6 +64,8 @@ else librt-a-y += $(librt_OBJS) endif librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS) +$(librt_OBJS) $(librt_OBJS:.o=.os): CFLAGS += -DNOT_IN_libc -DIS_IN_librt + ifeq ($(UCLIBC_CTOR_DTOR),y) START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crti.o (and check LT and LT.old if they need the same; and remove the now redundant spots-on). What do you think? TIA, > > 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 > -- > 1.8.0 > > > _______________________________________________ > uClibc mailing list > uClibc@uclibc.org > http://lists.busybox.net/mailman/listinfo/uclibc diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in index 0008822..228afe0 100644 --- a/libpthread/nptl/Makefile.in +++ b/libpthread/nptl/Makefile.in @@ -41,6 +41,8 @@ libpthread-a-y := $(libpthread-static-y:.o=.os) else libpthread-a-y := $(libpthread-static-y) endif +$(libpthread-so-y) $(libpthread-nonshared-y) $(libpthread-static-y) $(libpthread-a-y) : \ + CFLAGS += -DNOT_IN_libc -DIS_IN_libpthread libc-shared-routines-y := $(filter-out $(notdir