From owner-freebsd-office@freebsd.org Wed Feb 15 18:30:31 2017 Return-Path: Delivered-To: freebsd-office@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 1BD0CCE0A1A for ; Wed, 15 Feb 2017 18:30:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 051361554 for ; Wed, 15 Feb 2017 18:30:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 01881CE0A19; Wed, 15 Feb 2017 18:30:31 +0000 (UTC) Delivered-To: office@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 F3A71CE0A18 for ; Wed, 15 Feb 2017 18:30:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 BBFB61551 for ; Wed, 15 Feb 2017 18:30:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FIUT97021954 for ; Wed, 15 Feb 2017 18:30:30 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: office@FreeBSD.org Subject: [Bug 216745] devel/boost-libs: atomics are broken with clang 4.0 on i386 Date: Wed, 15 Feb 2017 18:30:29 +0000 X-Bugzilla-Reason: AssignedTo CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: office@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-office@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Office applications on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 18:30:31 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216745 --- Comment #10 from Dimitry Andric --- Created attachment 180022 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D180022&action= =3Dedit Don't use implied zero displacements in boost's inline asm I would like to propose a two-pronged solution to this. 1) Let clang default to i586 on 32-bit x86, supporting cmpxchg8b and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8, since in reality we have been doing this for years already. That is, since clang was introduced in the tree, it has always generated cmpxchg8b opcodes for 64-bit atomic operations, even thoug= h it didn't set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8. We have also never had __atomic_xxx_8() functions for 32-bit x86 in our libc, or in a libatomic support library, and that is the reason for the link error in comment 0. 2) Apply the attached patch, so boost stops using the "movl 4+(%%edx), %%ea= x" inline assembly syntax, which does not work with clang. The code path using this inline assembly is activated when __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 is defined. (Note that this so-called "implied zero displacement" syntax also didn't work with GNU as from the binutils port, but when gcc processes the inline assembly, it might add some additional offset, making it valid). Alternatively, we can try to find some sort of other workaround in the boost headers themselves, since it appears to emit some sort of mutex locking when you compile it with gcc 4.2.1, or other very old compilers. This is rather ugly, though, and pessimizes all post i486 processors for the sake of real i486's. --=20 You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.=