From owner-freebsd-toolchain@FreeBSD.ORG Thu Dec 30 18:40:48 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 7E5061065670; Thu, 30 Dec 2010 18:40:48 +0000 (UTC) Date: Thu, 30 Dec 2010 18:40:48 +0000 From: Alexander Best To: Roman Divacky Message-ID: <20101230184048.GA34628@freebsd.org> References: <20101227213559.GA53178@freebsd.org> <20101228142203.GA69674@freebsd.org> <20101230002033.GA23583@freebsd.org> <20101230081445.GA99446@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101230081445.GA99446@freebsd.org> 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: Thu, 30 Dec 2010 18:40:48 -0000 On Thu Dec 30 10, Roman Divacky wrote: > On Thu, Dec 30, 2010 at 12:20:33AM +0000, Alexander Best wrote: > > On Tue Dec 28 10, Roman Divacky wrote: > > > -march=native in clang works by detecting CPU name > > > and passing it (if found) to llvm. if the CPU is not > > > detected nothing is passed. > > > > > > nocona is supported > > > > > > ie. leaving the CPUNAME empty or specifying it to "nocona" should > > > be equivalent to setting it to "native". > > > > > > > > > can you apply this patch: > > > > > > Index: Driver/Tools.cpp > > > =================================================================== > > > --- Driver/Tools.cpp (revision 122591) > > > +++ Driver/Tools.cpp (working copy) > > > @@ -684,6 +684,7 @@ > > > // FIXME: We should also incorporate the detected target features for use > > > // with -native. > > > std::string CPU = llvm::sys::getHostCPUName(); > > > + llvm::outs() << "detected CPU = " << CPU << "\n"; > > > if (!CPU.empty()) > > > CPUName = Args.MakeArgString(CPU); > > > } else > > > > thanks a lot for the patch. i've applied it, but am not sure how to only > > compile clang. 'make' in usr.bin/clang fails. do i have to run target > > buildworld or is there a way to only build clang? > > I would guess that cd lib/clang && make && cd ../../usr.bin/clang && make > should work, if not - full buildworld is necessary I guess thanks. that worked. this is what clang detects as my cpu: -march=native this the dmesg output: CPU: Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz (2394.05-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x6fd Family = 6 Model = f Stepping = 13 Features=0xbfebfbff Features2=0xe39d AMD Features=0x20100800 AMD Features2=0x1 TSC: P-state invariant cheers. alex -- a13x