From owner-freebsd-bugs@freebsd.org Sun Jan 3 02:30:29 2016 Return-Path: Delivered-To: freebsd-bugs@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 F0E63A53936 for ; Sun, 3 Jan 2016 02:30:28 +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 E0BF11117 for ; Sun, 3 Jan 2016 02:30:28 +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 u032USfh028929 for ; Sun, 3 Jan 2016 02:30:28 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 205663] clang++ 3.7.1 gets Bus Errors during compilation on arm that has SCTLR bit[1]==1 (alignment required) Date: Sun, 03 Jan 2016 02:30:29 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 02:30:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205663 --- Comment #5 from Mark Millard --- I reported the following information on the llvm bugzilla: To get a quick handle on the size of the investigation effort for alignment= s of reinterpret_casts to pointer types in llvm/clang I've tried to get *approximations* of: A) count of reinterpret_cast's to pointer types that do not involve base ty= pes with "char" or "int8" text (on the same line). and B) How many files have such reinterpret_cast's. # pwd /usr/src/contrib/llvm # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*\*" {} \; | grep -v = char | grep -v int8 | wc 789 3453 51918 # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*(char|int8)[^>]*\*" = {} \; | wc 171 854 11326 (Some files may have a mix of both with and without char/int8.) # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*\*" {} \; -print | g= rep "^\.\/" | wc 264 264 10517 # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*(char|int8)[^>]*\*" = {} \; -print | grep "^\.\/" | wc 71 71 2781 (So 264-71=3D=3D193 to 264 files.) And also: C) How many reinterpret_cast's directly involve the text "this" (on the same line): # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*\*.*this" {} \; | gr= ep -v char | grep -v int8 | wc 132 739 8443 D) How many files is that? # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*\*.*this" {} \; -pri= nt | grep "^\.\/" | wc 47 47 1914 # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*(char|int8)[^>]*\*.*this" {} \; -print | grep "^\.\/" | wc 5 5 185 (So 47-5=3D=3D42 to 47 files.) E) How many reinterpret_cast's do not mention "this", "char", or "int8" (on= the same line): # find -s . -exec grep -E "reinterpret_cast[ \t]*<[^>]*\*" {} \; | grep -v = this | grep -v char | grep -v int8 | wc 647 2663 42647 This is the majority of the reinterpret_cast's, by far. It looks non-trivial to find and adjust the llvm/clang source so that all t= he places that do not currently deal with proper alignment for SCTLR bit[1]=3D= =3D1 contexts instead do so. So it is not likely to be happen time soon, much less finish any time soon. This will limit FreeBSD 11.0's "self hosting on arm" c++ support via the system/clang++ tool chain greatly based on the CTLR bit[1]=3D=3D1 status: c= ross builds required from a host not requiring alignment, such as from amd64. (O= nce some other C++ tool chain is in place on an arm more native work may then be possible.) The C part of clang does appear to compile okay for buildkernel use in the SCTRL bit[1]=3D=3D1 context. So far all the misalignments have happened in compiling-c++ contexts, which is involved for buildworld and for building m= any ports. --=20 You are receiving this mail because: You are the assignee for the bug.=