Mark van Dijk
2012-Dec-29 11:53 UTC
FreeBSD 9 (amd64) buildworld stage 4.2 fails with clang: unknown target cpu i686
Hello everyone, I'm running FreeBSD 9.1-PRERELEASE and today I synchronised my /usr/src directory with the svn_stable_9 branch on gitorious [1]. I am using ccache. My /etc/make.conf contains the following: -------------------------8<------------------------- CPUTYPE?=native CFLAGS=-O3 -pipe COPTFLAGS=-O -fno-strict-aliasing -pipe MAKE_JOBS_NUMBER=4 CC=clang CXX=clang++ CPP=clang-cpp NO_WERRORWERRORMAKE_SHELL?=sh INSTALL=install -C # from ccache-howto-freebsd.txt .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) .if !defined(NOCCACHE) CC:=${CC:C,^clang,/usr/local/libexec/ccache/world/clang,1} CXX:=${CXX:C,^clang\+\+,/usr/local/libexec/ccache/world/clang++,1} CCACHE_DIR:=/usr/sysccache .endif .endif .if ${CC:T} == "clang" CFLAGS+= -Qunused-arguments .endif -------------------------8<------------------------- The output from make is too long to post inline so you can find the relevant portion here: http://sprunge.us/BfWJ I suspect that the error is caused by -march=native, my CPU is an Intel Core i5. I'll admit that I did modify my make.conf right before building. It already *did* contain the CC/CXX/CPP lines for clang but the ccache portion was slightly different. It used to contain the literal contents of ccache-howto-freebsd.txt: CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1} CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1} Today I re-read that howto and it states: "You can replace cc and c++ with the compilers of your choice. (remember that only GCC and Clang can build world and kernel)" So I updated those two lines and replaced cc/c++ with clang/clang++. I didn't get the make errors before. So I moved those two lines back, did rm -rf /usr/obj/* and started another make buildworld which is still running. I always thought that specifying 'CPUTYPE?=' in the Makefile is the right way to prevent issues like this. So did I do something wrong, or is this some kind of ccache issue, or is this a legitimate bug? Please shed some light on this, thanks. Mark van Dijk the Netherlands [1] git://gitorious.org/freebsd/freebsd.git
Mark van Dijk
2012-Dec-29 12:15 UTC
FreeBSD 9 (amd64) buildworld stage 4.2 fails with clang: unknown target cpu i686
On 29-12-12 12:53, Mark van Dijk wrote:> (...) > I'll admit that I did modify my make.conf right before building. It > already *did* contain the CC/CXX/CPP lines for clang but the ccache > portion was slightly different. It used to contain the literal contents > of ccache-howto-freebsd.txt: > > CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1} > CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1} > > Today I re-read that howto and it states: > "You can replace cc and c++ with the compilers of your choice. > (remember that only GCC and Clang can build world and kernel)" > > So I updated those two lines and replaced cc/c++ with clang/clang++. I > didn't get the make errors before. So I moved those two lines back, did > rm -rf /usr/obj/* and started another make buildworld which is still > running.Scratch the above, I received the same error again just now.
Mark van Dijk
2012-Dec-29 14:34 UTC
FreeBSD 9 (amd64) buildworld stage 4.2 fails with clang: unknown target cpu i686
On 29-12-12 12:53, Mark van Dijk wrote:> I suspect that the error is caused by -march=native, my CPU is an Intel > Core i5.Looks like I was correct. CPUTYPE?=core2 will build world fine so perhaps 'native' does not know about my processor yet. Apparently it falls back to assuming it's a i686. Mark
Ronald Klop
2012-Dec-30 14:03 UTC
FreeBSD 9 (amd64) buildworld stage 4.2 fails with clang: unknown target cpu i686
Just some kind of me-too-message. I had weird things with clang like top crashing as root (but not as another user) and various ports failing to run with 'illegal instruction' errors until I removed CPUTYPE?=native. CPU: Pentium(R) Dual-Core CPU E5200 I did not investigate further, but never had this problem with gcc. This all was on 9-STABLE/amd64. Ronald. On Sat, 29 Dec 2012 12:53:30 +0100, Mark van Dijk <lists at internecto.net> wrote:> Hello everyone, > > I'm running FreeBSD 9.1-PRERELEASE and today I synchronised my /usr/src > directory with the svn_stable_9 branch on gitorious [1]. I am using > ccache. > > My /etc/make.conf contains the following: > > -------------------------8<------------------------- > CPUTYPE?=native > CFLAGS=-O3 -pipe > COPTFLAGS=-O -fno-strict-aliasing -pipe > MAKE_JOBS_NUMBER=4 > CC=clang > CXX=clang++ > CPP=clang-cpp > NO_WERROR> WERROR> MAKE_SHELL?=sh > INSTALL=install -C > # from ccache-howto-freebsd.txt > .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) > .if !defined(NOCCACHE) > CC:=${CC:C,^clang,/usr/local/libexec/ccache/world/clang,1} > CXX:=${CXX:C,^clang\+\+,/usr/local/libexec/ccache/world/clang++,1} > CCACHE_DIR:=/usr/sysccache > .endif > .endif > .if ${CC:T} == "clang" > CFLAGS+= -Qunused-arguments > .endif > -------------------------8<------------------------- > > The output from make is too long to post inline so you can find the > relevant portion here: > http://sprunge.us/BfWJ > > I suspect that the error is caused by -march=native, my CPU is an Intel > Core i5. > > I'll admit that I did modify my make.conf right before building. It > already *did* contain the CC/CXX/CPP lines for clang but the ccache > portion was slightly different. It used to contain the literal contents > of ccache-howto-freebsd.txt: > > CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1} > CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1} > > Today I re-read that howto and it states: > "You can replace cc and c++ with the compilers of your choice. > (remember that only GCC and Clang can build world and kernel)" > > So I updated those two lines and replaced cc/c++ with clang/clang++. I > didn't get the make errors before. So I moved those two lines back, did > rm -rf /usr/obj/* and started another make buildworld which is still > running. > > I always thought that specifying 'CPUTYPE?=' in the Makefile is the > right way to prevent issues like this. So did I do something wrong, or > is this some kind of ccache issue, or is this a legitimate bug? > > Please shed some light on this, thanks. > > Mark van Dijk > the Netherlands > > [1] git://gitorious.org/freebsd/freebsd.git > > _______________________________________________ > freebsd-stable at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
Jakub Lach
2012-Dec-30 16:02 UTC
FreeBSD 9 (amd64) buildworld stage 4.2 fails with clang: unknown target cpu i686
I have no problems with CPUTYPE?=native with clang and 9-STABLE, on Penryn but I only use it for base. There is no correct CPUTYPE which would correspond to my CPU anyway. -- View this message in context: http://freebsd.1045724.n5.nabble.com/FreeBSD-9-amd64-buildworld-stage-4-2-fails-with-clang-unknown-target-cpu-i686-tp5773068p5773336.html Sent from the freebsd-stable mailing list archive at Nabble.com.