From owner-freebsd-arm@FreeBSD.ORG Tue Sep 10 23:23:34 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CD5D3C3 for ; Tue, 10 Sep 2013 23:23:34 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id E3A622630 for ; Tue, 10 Sep 2013 23:23:33 +0000 (UTC) Received: from bender.Home (97e5e46b.skybroadband.com [151.229.228.107]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id EF8865E305; Tue, 10 Sep 2013 23:23:26 +0000 (UTC) Date: Wed, 11 Sep 2013 00:23:20 +0100 From: Andrew Turner To: Ed Schouten Subject: Re: Failure compiling glib20 on ARM Message-ID: <20130911002320.0f05b836@bender.Home> In-Reply-To: References: <522C592C.5010800@m5p.com> <20130909231720.5b2c4823@bender.Home> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-arm@freebsd.org" , George Mitchell X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2013 23:23:34 -0000 On Tue, 10 Sep 2013 22:24:47 +0200 Ed Schouten wrote: > Hi Andrew, > > 2013/9/10 Andrew Turner : > > I don't see support for it in our stdatomic functions. It shouldn't > > be too hard to support, a simple would be something like: > > > > int __sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t expected, > > uint32_t new) > > { > > return (__sync_val_compare_and_swap_4(mem, expected, new) == > > expected); > > } > > My initial goal was to just add the atomic intrinsics to make the C11 > standards atomic interface work (). That's why I am > personally not that interested in adding all sorts of extra `bloat'; > code should just use instead. > > Still, if there is a strong interest in adding this function as well, > be sure to send me a patch for sys/*/*/stdatomic.c and I would be more > than willing to review it. It looks like clang handles these gcc builtins by generating the appropriate code without calling an external function. The version of gcc we have in the tree will generate a call. If nobody wishes to support our version of gcc on ARM then the only solutions are to use clang to build glib, or fix the port to use the __sync_val_compare_and_swap builtin. Andrew