Date: Thu, 30 Dec 2010 00:20:33 +0000 From: Alexander Best <arundel@freebsd.org> To: Roman Divacky <rdivacky@freebsd.org> Cc: freebsd-toolchain@freebsd.org Subject: Re: issue with clang and CPUTYPE native Message-ID: <20101230002033.GA23583@freebsd.org> In-Reply-To: <20101228142203.GA69674@freebsd.org> References: <20101227213559.GA53178@freebsd.org> <20101228142203.GA69674@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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? cheers. alex > > > and try to > > clang -march=native hello_world.c > > ? I wonder what cpu (if any) is detected. > > > On Mon, Dec 27, 2010 at 09:35:59PM +0000, Alexander Best wrote: > > hi there, > > > > i've been experiencing the following problems with clang during TARGET > > buildworld for quite a while now: > > > > **** CODE **** > > clang++ -O2 -pipe -march=native -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcclibs/include -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++ -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcc -I/usr/subversion-src/gnu/lib/libsupc++/../libstdc++ -I. -frandom-seed=RepeatabilityConsideredGood -DNDEBUG -g -fstack-protector -fno-implicit-templates -ffunction-sections -fdata-sections -c /usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++/tinfo2.cc > > clang++: warning: argument unused during compilation: '-fno-implicit-templates' > > clang++ -O2 -pipe -march=native -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcclibs/include -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++ -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcc -I/usr/subversion-src/gnu/lib/libsupc++/../libstdc++ -I. -frandom-seed=RepeatabilityConsideredGood -DNDEBUG -g -fstack-protector -fno-implicit-templates -ffunction-sections -fdata-sections -c /usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++/vec.cc > > clang++: warning: argument unused during compilation: '-fno-implicit-templates' > > clang++ -O2 -pipe -march=native -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcclibs/include -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++ -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcc -I/usr/subversion-src/gnu/lib/libsupc++/../libstdc++ -I. -frandom-seed=RepeatabilityConsideredGood -DNDEBUG -g -fstack-protector -fno-implicit-templates -ffunction-sections -fdata-sections -c /usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++/vterminate.cc > > clang++: warning: argument unused during compilation: '-fno-implicit-templates' > > clang -O2 -pipe -march=native -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcclibs/include -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/libstdc++/libsupc++ -I/usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcc -I/usr/subversion-src/gnu/lib/libsupc++/../libstdc++ -I. -frandom-seed=RepeatabilityConsideredGood -DNDEBUG -g -std=gnu99 -fstack-protector -c /usr/subversion-src/gnu/lib/libsupc++/../../../contrib/gcclibs/libiberty/cp-demangle.c > > building static supc++ library > > ranlib libsupc++.a > > ===> gnu/lib/libobjc (all) > > gcc -O2 -pipe -march=native -DHAVE_GTHR_DEFAULT -DIN_GCC -DIN_TARGET_LIBS -I. -I/usr/subversion-src/gnu/lib/libobjc/../../usr.bin/cc/cc_tools -I/usr/subversion-src/gnu/lib/libobjc/../../../contrib/libobjc/objc -I/usr/subversion-src/gnu/lib/libobjc/../../../contrib/libobjc -I/usr/subversion-src/gnu/lib/libobjc/../../../contrib/gcc/config -I/usr/subversion-src/gnu/lib/libobjc/../../../contrib/gcc -I/usr/subversion-src/gnu/lib/libobjc/../../../contrib/gcclibs/include -fexceptions -frandom-seed=RepeatabilityConsideredGood -DNDEBUG -g -std=gnu99 -fstack-protector -c /usr/subversion-src/gnu/lib/libobjc/../../../contrib/libobjc/archive.c > > *** Signal 11 > > > > Stop in /usr/subversion-src/gnu/lib/libobjc. > > *** Error code 1 > > > > Stop in /usr/subversion-src/gnu/lib. > > *** Error code 1 > > > > Stop in /usr/subversion-src. > > *** Error code 1 > > > > Stop in /usr/subversion-src. > > *** Error code 1 > > > > Stop in /usr/subversion-src. > > *** Error code 1 > > > > Stop in /usr/subversion-src. > > **** CODE **** > > > > i've finally figured out that the following line in make.conf is causing the > > problem: > > > > CPUTYPE ?= native > > > > if i remove it or change it to CPUTYPE ?= nocona everything works fine. if i'm > > using gcc as compiler, having CPUTYPE ?= native in my make.conf causes no harm. > > > > this is on amd64 and a very recent HEAD snapshot. > > > > can somebody verify this issue? > > > > cheers. > > alex > > > > -- > > a13x > > _______________________________________________ > > freebsd-toolchain@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > > To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org" -- a13x
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101230002033.GA23583>