From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95564 invoked by alias); 13 Jan 2017 18:16:46 -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 95547 invoked by uid 89); 13 Jan 2017 18:16:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*f:sk:2fb85b2, H*f:sk:1484330, timezone, mktime X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 18:16:45 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCA7E152D; Fri, 13 Jan 2017 10:16:43 -0800 (PST) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FAB23F242 for ; Fri, 13 Jan 2017 10:16:43 -0800 (PST) Subject: Re: [PATCH, newlib] Allow locking routine to be retargeted To: newlib@sourceware.org References: <34e2c2ad-be0f-44ed-201e-a6f294814f4e@foss.arm.com> <5851557A.4080707@embedded-brains.de> <800fa569-cd83-bd61-95e3-7ad83e053d6c@foss.arm.com> <4409ff03-7c2f-550d-a57a-6b6503bd5933@foss.arm.com> <1483987769.1304.2.camel@op.pl> <6e978ca7-e90e-5fa9-84c4-19c24a993e4a@foss.arm.com> <1484068006.1266.1.camel@op.pl> <89891529-77aa-48af-50bf-aede537a5f1d@LGSInnovations.com> <37230278-6fc6-b0f0-6254-c6e6882f5a99@foss.arm.com> <1484162070.1261.1.camel@op.pl> <1484238035.1122.3.camel@op.pl> <62aaa2d2-f8f7-4c00-7954-f62b47a798b4@foss.arm.com> <2fb85b24-a2e6-4e8b-1a2c-11faeb01d33d@foss.arm.com> <1484330715.2096.1.camel@op.pl> From: Thomas Preudhomme Message-ID: <51d83e39-7d6d-90f1-b61b-5a5af0a0825e@foss.arm.com> Date: Fri, 13 Jan 2017 18:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1484330715.2096.1.camel@op.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00057.txt.bz2 On 13/01/17 18:05, Freddie Chopin wrote: > On Fri, 2017-01-13 at 13:24 +0000, Thomas Preudhomme wrote: >> And here's the patch. Tested with full and partial retargeting as >> well as no >> retargeting. > > I confirm - if I provide just some of the functions/objects, the > linking will fail with "multiple definition" error. Great! > > Any chance for adding all locks used by newlib internally? These 4 are > missing from what I've seen: > newlib/libc/posix/telldir.c:__LOCK_INIT(static, dd_hash_lock); > newlib/libc/time/tzlock.c:__LOCK_INIT(static, __tz_lock_object); > newlib/libc/stdlib/quick_exit.c:__LOCK_INIT(static, atexit_mutex); > newlib/libc/stdlib/envlock.c:__LOCK_INIT_RECURSIVE(static, __env_lock_object); > > I know these are not "popular", but nevertheless required. For example > time-zone locking is pulled by any function dealing with "local" time, > like a very useful mktime(). 4 bytes here or there is not such a big > deal (; Oh yes absolutely. I forgot that I added the lock only based on testing rather than analysis of the code. Thanks for pointing that out. Best regards, Thomas