Re: CURRENT: build failure with clang 3.7.0

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 07 Oct 2015 11:03 -0700
On Wednesday, October 07, 2015 01:33:23 PM O. Hartmann wrote:
> On Wed, 7 Oct 2015 13:23:48 +0200
> Dimitry Andric <dim_at_FreeBSD.org> wrote:
> 
> > On 07 Oct 2015, at 09:37, O. Hartmann <ohartman_at_zedat.fu-berlin.de> wrote:
> > > 
> > > I hit on a box this nasty/sticky error when performing buildworld.
> > > 
> > > /usr/src is on r288980
> > ...
> > > --- ieee802_11_common.o ---
> > ...
> > > -c /usr/src/usr.sbin/wpa/wpa_supplicant/../../../contrib/wpa//src/common/ieee802_11_common.c
> > > -o ieee802_11_common.o Cannot emit physreg copy instruction UNREACHABLE
> > > executed
> > > at /usr/src/lib/clang/libllvmx86codegen/../../../contrib/llvm/lib/Target/X86/X86InstrInfo.cpp:3935!
> > 
> > Somebody else reported the same to me yesterday.  This is an upstream
> > bug with AVX (which is still present in llvm trunk), so for now you need
> > to set your CPUTYPE to something that doesn't have AVX, or simply unset
> > your CPUTYPE.
> > 
> > The bug has been reported upstream, and once there is a fix, I will
> > import it ASAP.
> > 
> > -Dimitry
> > 
> 
> Funny, I have several other boxes, definitely having AVX aboard:
> 
> [... from dmesg]
> Jul 29 07:05:52 freyja kernel: CPU: Intel(R) Xeon(R) CPU E5-1650 v3 _at_ 3.50GHz
> (3491.98-MHz K8-class CPU)
> Jul 29 07:05:52 freyja kernel: Origin="GenuineIntel"  Id=0x306f2  Family=0x6
> Model=0x3f  Stepping=2
> Jul 29 07:05:52 freyja kernel:
> Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
> Jul 29 07:05:52 freyja kernel:
> Features2=0x7dfefbff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
> Jul 29 07:05:52 freyja kernel: AMD
> Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
> Jul 29 07:05:52 freyja kernel: AMD Features2=0x21<LAHF,ABM>
> Jul 29 07:05:52 freyja kernel: Structured Extended
> Features=0x37ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,NFPUSG>
> 
> [...]
> 
> which is a most recent Haswell XEON and builds world fine. My personal failing
> box is a i3-32XX, IvyBridge, but the IvyBridge E3-124XX XEON builds well.

It's not about whether your CPU supports it, it is about whether or not you have
asked the compiler to use it.  Normally by setting 'CPUTYPE' in /etc/make.conf
or the like.  (I also was bitten by this yesterday on my sandbridge laptop
where I have 'CPUTYPE=corei7-avx' in /etc/src.conf.)  The workaround is to not
set CPUTYPE (or set it to something without AVX like just 'corei7').

-- 
John Baldwin
Received on Wed Oct 07 2015 - 16:42:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:00 UTC