From owner-freebsd-current@freebsd.org Mon Nov 25 14:06:22 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFBED1AD84A for ; Mon, 25 Nov 2019 14:06:22 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47M8314kjtz4SGN for ; Mon, 25 Nov 2019 14:06:21 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: by mail-lj1-x243.google.com with SMTP id k15so16024037lja.3 for ; Mon, 25 Nov 2019 06:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=xET3eZVyqXcbuGcTFi9PibYck/vB3i51OWlYxv0mMQM=; b=Hg8hblOoRlwaj5YisQYYVWTr4WQ6BW2aJJcdT76YkEffycMsGZ+SSwxtw1fM4mQBPI bpFX8UTUMz6B+0NTJmgrmQUMyivVIXMgcrm6xaxlVNCqYm9D8uhrbhBPTJWtdZ1RVCas e+NvwinKWihWMQK33uoFd3Lox7ZtOvvfeS7WAxyeOdCslXmUVQ9MuKFT/oJsnAyiekmW GVMJw7J7M+svTrDS+HdtbHLiNRP3vtYh8znnXN4i3RLNBS1obaUrCO56lNKHUZKkagE/ Hwsw9u+il3irDgh9K/b1M6x99RHkHgAiuYvBObBbAoG2fs7b2rnqjJMWCYaWnMsOVG8s rTjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=xET3eZVyqXcbuGcTFi9PibYck/vB3i51OWlYxv0mMQM=; b=YkMBuCQG3144AA8kvUW5MCG1p7vg5eXBFaugD3iL6AxEjI6Osf7SRFRSnppNRcMBpk doWxuKfJQRfKHDc1qNX7wuBuBrA+c8d8nvuNDxsfXl4bxl4mRLkVzmCNtUvIpSpAFS9z FZuEzDwlcqzXun38/YNx5JA+BcgR0nYAt9DxHd2xs5apsL7tgy+QRDCI1bv6v13dt+2J 0pOXeFI81wKp3mnn0XX0ui3o3jYoUSU5vwl7EaBC/NUv3c2aIgdeGJaTuLCnouCafALH 3sr8bK4ecvMQeaIMzjaaXQXRyzpgPprdlCdz4+8eaHMX2gXGvog66Mfzabdk+lmZ11uM bc/A== X-Gm-Message-State: APjAAAVUkZCxzSjueOtA6vyOuIWY9I206oAQ6oNgvwz8KURgyR+a0/aH W7WO1gEpSEli4mLldEdchBBjow8gq1M= X-Google-Smtp-Source: APXvYqx5XFCYfNN9xpAvz0/DiPvUIBFbe5Tyd2esuYhpqPSd9d8MNrCjRSmS9TbGo0Tszi/tDvRnzw== X-Received: by 2002:a2e:99c2:: with SMTP id l2mr22497563ljj.145.1574690777559; Mon, 25 Nov 2019 06:06:17 -0800 (PST) Received: from [192.168.1.2] ([46.48.69.183]) by smtp.gmail.com with ESMTPSA id 144sm3726947lfi.67.2019.11.25.06.06.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Nov 2019 06:06:15 -0800 (PST) To: freebsd-current@freebsd.org From: Ruslan Garipov Subject: buildworld on CPU-A, installworld on CPU-B ends up with SIGILL Message-ID: <5596338e-134c-9849-de9e-710d3106687f@gmail.com> Date: Mon, 25 Nov 2019 19:06:11 +0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47M8314kjtz4SGN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Hg8hblOo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ruslanngaripov@gmail.com designates 2a00:1450:4864:20::243 as permitted sender) smtp.mailfrom=ruslanngaripov@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (2.75), ipnet: 2a00:1450::/32(-2.70), asn: 15169(-1.96), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[3.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 14:06:22 -0000 Hello. I want to build kernel and world (of FreeBSD 13.0-CURRENT) on a fast virtual machine for other ones (all the virtual machines are hosted on VMware EXSi hypervisors, which have different physical CPUs). After `make -j16 buildworld` has finished successfully on the build machine, I get there, for example, /usr/obj/usr/src/amd64.amd64/tmp/legacy/bin/install program having the shlxq instruction (one from the BMI2 instruction set extensions). This eventually causes make installkernel and make installworld to fail with SIGILL on a virtual machine which must consume built world and kernel, and which is hosted on another ESXi instance, with older physical CPU (read: with CPU not implementing shlxq). The build machine (FreeBSD 13.0-CURRENT r354802) builds (x)install using the following commands (a part of buildworld): $ cc -O2 -pipe -O2 -march=x86-64 -pipe -I/usr/src/contrib/mtree -I/usr/src/lib/libnetbsd -DHAVE_STRUCT_STAT_ST_FLAGS=1 -MD -MF.depend.xinstall.o -MTxinstall.o -std=gnu99 -Wno-format-zero-length -Qunused-arguments -I/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include -c /usr/src/usr.bin/xinstall/xinstall.c -o xinstall.o $ cc -O2 -pipe -O2 -march=x86-64 -pipe -I/usr/src/contrib/mtree -I/usr/src/lib/libnetbsd -DHAVE_STRUCT_STAT_ST_FLAGS=1 -MD -MF.depend.getid.o -MTgetid.o -std=gnu99 -Wno-format-zero-length -Qunused-arguments -I/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include -c /usr/src/contrib/mtree/getid.c -o getid.o $ cc -O2 -pipe -O2 -march=x86-64 -pipe -I/usr/src/contrib/mtree -I/usr/src/lib/libnetbsd -DHAVE_STRUCT_STAT_ST_FLAGS=1 -std=gnu99 -Wno-format-zero-length -Qunused-arguments -I/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include -static -L/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/lib -o xinstall xinstall.o getid.o -L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libmd -lmd -legacy This produces xintstall with `shlxq`s: $ llvm-objdump --disassemble xinstall | grep -c shlxq 135 I believe statically linked /usr/lib/libmd.a is a stuff which brings `shlxq`s into the xinstall. I didn't examine it further, sorry... My question is: is it possible to buildworld without issuing instructions which are native for the host CPU? I have neither /etc/make.conf, nor /etc/src.conf on the build machine. Is it possible at all for FreeBSD CURRENT to be built outside a host and installed on the host later? Just as a reference: My build machine has Intel(R) Xeon(R) Gold 6150 CPU that supports BMI2: # cpucontrol -i 7 /dev/cpuctl0 cpuid level 0x7: 0x00000000 0xd19f6ffb 0x00000018 0xbc000000 (Bit 08 in EBX is set) , and a consuming machine has Intel(R) Xeon(R) CPU E5-4617 CPU that doesn't support BMI2: # cpucontrol -i 7 /dev/cpuctl0 cpuid level 0x7: 0x00000000 0x00000002 0x00000000 0xbc000000 (Bit 08 in EBX is unset). Both machines install kernel and world without any problem, if they were built locally. Thanks! -- Yours truly, Ruslan Garipov . ---------------------------------------------- MinGW-w64 developer, with write after approval GEDKeeper collaborator