From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5302 invoked by alias); 30 Jan 2017 18:53:33 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 4607 invoked by uid 89); 30 Jan 2017 18:53:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*pl X-HELO: smtpo46.poczta.onet.pl Received: from smtpo46.poczta.onet.pl (HELO smtpo46.poczta.onet.pl) (213.180.142.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Jan 2017 18:53:21 +0000 Received: from [192.168.2.253] (83-238-239-138.adsl.inetia.pl [83.238.239.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: freddie_chopin@op.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3vBz701KFKzTC4dS3 for ; Mon, 30 Jan 2017 19:53:15 +0100 (CET) Message-ID: <1485802394.1386.4.camel@op.pl> Subject: Re: [PATCH 2/2, newlib] Allow locking routine to be retargeted From: Freddie Chopin To: newlib@sourceware.org Date: Mon, 30 Jan 2017 18:53:00 -0000 In-Reply-To: <53697464-af87-8917-c5ec-b1a0d06cca00@foss.arm.com> References: <53697464-af87-8917-c5ec-b1a0d06cca00@foss.arm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00106.txt.bz2 OK, more strangeness... The idea that a linking error will be produced when you provide an incomplete retarteging implementation generally works correctly, with exception of two locks. If I remove the storage for most of the locks, linking indeed fails with "multiple definitions" error. But this does not apply to the lock for at_quick_exit() ("__atexit_mutex" or "__at_quick_exit_mutex") and telldir() ("__dd_hash_lock" or "__dd_hash_mutex"). 1. Why is the lock used by at_quick_exit() not required - I have no idea. The linking error (when I do not provide storage for this lock) about multiple definitions is visible only when I actually use the at_quick_exit() function. 2. It seems that the lock for dd_hash from posix/telldir.c is not really needed, at least with the newlib configuration which I'm using. Whole posix/ folder is not compiled at all, so no file from this path is included in libc.a. Sorry for the earlier confusion. Regards, FCh