From owner-freebsd-toolchain@FreeBSD.ORG Mon Jan 31 21:02:53 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7802B106564A; Mon, 31 Jan 2011 21:02:53 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 03D698FC15; Mon, 31 Jan 2011 21:02:52 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 16DDA9CB0C3; Mon, 31 Jan 2011 22:02:52 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FK2HeXZ37UCC; Mon, 31 Jan 2011 22:02:51 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 18CCC9CB883; Mon, 31 Jan 2011 22:02:51 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0VL2p1e070290; Mon, 31 Jan 2011 22:02:51 +0100 (CET) (envelope-from rdivacky) Date: Mon, 31 Jan 2011 22:02:51 +0100 From: Roman Divacky To: Alexander Best Message-ID: <20110131210251.GA70081@freebsd.org> References: <20101230201848.GA92145@freebsd.org> <20101231012002.GA73736@freebsd.org> <20101231151554.GA29782@freebsd.org> <20101231180054.GA77781@freebsd.org> <20101231190838.GA85678@freebsd.org> <20110101153430.GA98411@freebsd.org> <20110101195823.GA41161@freebsd.org> <20110131162755.GA54255@freebsd.org> <20110131202426.GA64245@freebsd.org> <20110131210041.GA89926@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110131210041.GA89926@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-toolchain@freebsd.org Subject: Re: issue with clang and CPUTYPE native X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 21:02:53 -0000 On Mon, Jan 31, 2011 at 09:00:41PM +0000, Alexander Best wrote: > On Mon Jan 31 11, Roman Divacky wrote: > > On Mon, Jan 31, 2011 at 04:27:55PM +0000, Alexander Best wrote: > > > On Sat Jan 1 11, Alexander Best wrote: > > > > On Sat Jan 1 11, Roman Divacky wrote: > > > > > > > clang -O2 -pipe -march=native -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -g -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/subversion-src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/mulvti3.c > > > > > > > detected CPU = core2 > > > > > > > Assertion failed: (getMinSignedBits() <= 64 && "Too many bits for int64_t"), function getSExtValue, file /usr/subversion-src/lib/clang/libclangcodegen/../../../contrib/llvm/include/llvm/ADT/APInt.h, line 1149. > > > > > > > Stack dump: > > > > > > > 0. Program arguments: /usr/obj/usr/subversion-src/tmp/usr/bin/clang -cc1 -triple x86_64-undermydesk-freebsd9.0 -S -disable-free -main-file-name mulvti3.c -pic-level 1 -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu core2 -g -resource-dir /usr/obj/usr/subversion-src/tmp/usr/lib/clang/2.8 -D VISIBILITY_HIDDEN -O2 -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -std=gnu99 -ferror-limit 19 -fmessage-length 275 -fvisibility hidden -stack-protector 1 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-G6mPQL.s -x c /usr/subversion-src/lib/libcompiler_rt/../../contrib/compiler-rt/lib/mulvti3.c > > > > > > > 1. parser at end of file > > > > > > > 2. Code generation > > > > > > > clang: error: clang frontend command failed due to signal 6 (use -v to see invocation) > > > > > > > *** Error code 250 > > > > > > > > > > > > > > > this is a genuine llvm bug it may have been (or may have been not) fixed in recent llvm. > > > > > > > > > > if you feel like it - install llvm/clang from subversion and check if it compiles this > > > > > ok. if it does not I think it's worth filing a bug in llvm bugzilla.. > > > > > > i just wanted to report that the latest clang version doesn't trigger the > > > assert any longer: > > > > > > clang version 2.9 (trunk 124571) > > > Target: x86_64-unknown-freebsd9.0 > > > Thread model: posix > > > > > > is there a way to have the local "-fformat-extensions" clang additions pushed > > > upstream? maybe that mght be sufficient to compile the freebsd source with > > > clang 2.9+. > > > > no, it makes no sense to push the printf patches upstream. it's freebsd kernel > > only. > > > > for compiling freebsd kernel you are supposed to use /usr/bin/clang (or just > > ignore the warnings from upstream clang) > > you should be able to reproduce the issue on arch=amd64 and the following in > /etc by doing 'make' in lib/libcompiler_rt: > > otaku% cat /etc/make.conf /etc/src.conf > cat: /etc/make.conf: No such file or directory > # CLANG options > .if !defined(CC) || ${CC} == "cc" > CC=clang > .endif > .if !defined(CXX) || ${CXX} == "c++" > CXX=clang++ > .endif > # Don't die on warnings > #NO_WERROR= > #WERROR= > > # Enable debugging symbols for world > DEBUG_FLAGS = -g > > ... removing the "-g" switch from DEBUG_FLAGS solves the issue. > > using the 2.9-development branch, lib/libcompiler_rt compiles fine even with > the -g switch. new import of clang/llvm will happen really soon now, bringing quite a few improvements (mature integrated asm, some fbsd specific fixes etc.) roman