From owner-freebsd-current@freebsd.org Tue Jan 2 14:34:38 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C81D5EA874A for ; Tue, 2 Jan 2018 14:34:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60124192B for ; Tue, 2 Jan 2018 14:34:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w02EYTeh022285 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 Jan 2018 16:34:33 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w02EYTeh022285 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w02EYT5I022284; Tue, 2 Jan 2018 16:34:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 Jan 2018 16:34:29 +0200 From: Konstantin Belousov To: Pierre DAVID Cc: freebsd-current@freebsd.org Subject: Re: Problem with C11 _Atomic Message-ID: <20180102143429.GK1684@kib.kiev.ua> References: <20180101204740.GA15590@vagabond> <20180101210907.GG1684@kib.kiev.ua> <20180102141714.GA16473@vagabond> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180102141714.GA16473@vagabond> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2018 14:34:38 -0000 On Tue, Jan 02, 2018 at 03:17:14PM +0100, Pierre DAVID wrote: > On Mon, Jan 01, 2018 at 11:09:07PM +0200, Konstantin Belousov wrote: > >clang issues a calls to libatomic, which we do not provide. > >As a workaround, use the following command to compile. The resulting > >binary works on all practically usable machines. > > $ cc -march=core2 source.c > >You might want to turn off sse3/4.1 if you are concerned about older pentium4. > > > > Thanks for your help. I wish that the C11 status of FreeBSD will soon > be complete out of the box, without the help of such a hack. This is not FreeBSD but clang. Also I looked at the generated reference, and the referenced symbol was absent in the gcc' 7.2.0 libatomic. Same common problem with i386 and same cmpxchg8b is popular because the default arch is i486. This is a clang way of operations.