From owner-freebsd-stable@freebsd.org Tue Apr 23 20:43:52 2019 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36D7E158222F for ; Tue, 23 Apr 2019 20:43:52 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.protonmail.ch", Issuer "SwissSign Server Silver CA 2014 - G22" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 611DD8A6D8 for ; Tue, 23 Apr 2019 20:43:50 +0000 (UTC) (envelope-from phascolarctos@protonmail.ch) Date: Tue, 23 Apr 2019 20:43:34 +0000 To: "freebsd-stable@freebsd.org" From: Lorenzo Salvadore Reply-To: Lorenzo Salvadore Subject: Re: 12.0 installworld core dumping on me Message-ID: In-Reply-To: <20190423183604.GL6607@rancor.immure.com> References: <20190423125133.GG3392@rancor.immure.com> <20190423183604.GL6607@rancor.immure.com> Feedback-ID: X6az_D2smWSR8MT5MHqXnWF0upxehDyHia7Id1cbayHNBUkRu3CIeusDsZHiivIIjmaKB1_OofpALrRUYjNz3w==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch X-Rspamd-Queue-Id: 611DD8A6D8 X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.76 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[phascolarctos@protonmail.ch]; R_DKIM_ALLOW(-0.20)[protonmail.ch:s=default]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-3.68)[ip: (-9.52), ipnet: 185.70.40.0/24(-4.91), asn: 19905(-3.92), country: US(-0.06)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; DKIM_TRACE(0.00)[protonmail.ch:+]; MX_GOOD(-0.01)[mailsec.protonmail.ch,mail.protonmail.ch]; DMARC_POLICY_ALLOW(-0.50)[protonmail.ch,quarantine]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; RCVD_IN_DNSWL_LOW(-0.10)[18.40.70.185.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:19905, ipnet:185.70.40.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[protonmail.ch.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2019 20:43:52 -0000 =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Tuesday 23 April 2019 20:36, Bob Willcox wrote: > On Tue, Apr 23, 2019 at 07:51:34AM -0500, Bob Willcox wrote: > > > I installed the 20190418 12.0-STABLE snapshot and then checking out the= latest 12.0-STABLE source code > > and performing a 'make buildworld' when I attempt to do a 'make install= world' I get this: > > root@darth:3 /usr/src> make installworld > > make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: U= sing cached toolchain metadata from build at darth.immure.com on Mon Apr 22= 19:54:57 CDT 2019 > > Illegal instruction (core dumped) > > rescue/sh check failed, installation aborted > > *** Error code 1 > > Stop. > > make[1]: stopped in /usr/src > > *** Error code 1 > > Stop. > > make: stopped in /usr/src > > This leaves me with a rescue.core file in the /usr/obj/usr/src/amd64.am= d64 directory. > > The toolchain-metadata.mk file contains this: > > .info Using cached toolchain metadata from build at darth.immure.com on= Mon Apr 22 19:54:57 CDT 2019 > > _LOADED_TOOLCHAIN_METADATA=3Dt > > COMPILER_VERSION=3D80000 > > X_COMPILER_VERSION=3D80000 > > COMPILER_TYPE=3Dclang > > X_COMPILER_TYPE=3Dclang > > COMPILER_FEATURES=3D c++11 retpoline > > X_COMPILER_FEATURES=3D c++11 retpoline > > COMPILER_FREEBSD_VERSION=3D1200018 > > X_COMPILER_FREEBSD_VERSION=3D1200018 > > LINKER_VERSION=3D80000 > > X_LINKER_VERSION=3D80000 > > LINKER_FEATURES=3D build-id ifunc filter retpoline > > X_LINKER_FEATURES=3D build-id ifunc filter retpoline > > LINKER_TYPE=3Dlld > > X_LINKER_TYPE=3Dlld > > LINKER_FREEBSD_VERSION=3D356365-1200007 > > X_LINKER_FREEBSD_VERSION=3D356365-1200007 > > .export COMPILER_VERSION COMPILER_TYPE COMPILER_FEATURES COMPILER_FREEB= SD_VERSION LINKER_VERSION LINKER_FEATURES LINKER_TYPE LINKER_FREEBSD_VERSIO= N > > .export X_COMPILER_VERSION X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPIL= ER_FREEBSD_VERSION X_LINKER_VERSION X_LINKER_FEATURES X_LINKER_TYPE X_LINKE= R_FREEBSD_VERSION > > Anyone have any idea on what might be the cause or how best to proceed = with debugging this? > > Thanks, > > Bob > > Well, it turns out that the following line that I placed in the system's > make.conf file was the culprit: > > CPUTYPE?=3D skx > > Removing it and rebuilding world allowed 'make installworld' to run. I ha= d > just tried that on a lark since the CPU is an I7-9700k which is a Coffee = Lake > processor and is newaer than Skylake so I thought...what the heck, give i= t a > try. Bad idea. > > The compiler must be generating instructions that aren't compatible with = my > CPU. Removal of that line in make.conf seems to have gotten me fixed. :) > > Bob I am playing too with CPUTYPE in these days. I think I will soon write a wi= ki page about that. Here is a short description of what I have found out. What I suggest you to do, if you still want to play with CPU_TYPE (I do not= recommend it: I cannot see any real improvement), is to set CPUTYPE?=3D native. Then look= into /usr/share/mk/bsd.cpu.mk what feature you can enable or disable for your pr= ocessor: avx, sse3 etc. Compare this list with the feature supported by your process= or (run "dmesg | head -n 25" to get them) and define MACHINE_CPU+=3D with what you = need (some features probably are already set: check them with "make -V MACHINE_C= PU"). Reading /usr/share/mk/bsd.cpu.mk you will see some values you can give to C= PUTYPE that will set automatically MACHINE_CPU to the right value. However I disco= urage you from using them: in my case, I should set CPU_TYPE?=3Divybridge, however bs= d.cpu.mk, clang and gcc all believe that ivybridge support avx, but this is wrong at = least for my cpu, thus I get invalid instructions (even if I correct bsd.cpu.mk), while = everything is fine by setting CPU_TYPE?=3Dnative. If, however, you still want to set your specific model instead of native in= to CPU_TYPE, you can get the supposed right value running "cc -v -x c -E -march=3Dnative /dev/null -o /dev/null" or "llvm-tblgen -ver= sion". If you happen to encounter some invalid instructions with some port, recomp= ile it with NO_CPU_CFLAGS=3Dyes: this will avoid setting -march=3D in your CFLAGS. I had to do that with ports involving rust. Lorenzo Salvadore.