From owner-freebsd-toolchain@freebsd.org Mon Jul 6 09:00:06 2020 Return-Path: Delivered-To: freebsd-toolchain@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 D2D22360A42; Mon, 6 Jul 2020 09:00:06 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from smtp.triumf.ca (smtp.triumf.ca [142.90.100.195]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0ffC0Wj5z3VmZ; Mon, 6 Jul 2020 09:00:02 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from mscad14 (mscad14.triumf.ca [142.90.115.36]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.triumf.ca (Postfix) with ESMTP id 6C024F80C; Mon, 6 Jul 2020 02:00:01 -0700 (PDT) Date: Mon, 6 Jul 2020 02:00:00 -0700 From: To: , , , Subject: Clang fails to detect CPU features Message-ID: <20200706020000.6b602c3f@mscad14> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; amd64-portbld-freebsd9.3) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B0ffC0Wj5z3VmZ X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=neutral (mx1.freebsd.org: 142.90.100.195 is neither permitted nor denied by domain of soralx@cydem.org) smtp.mailfrom=soralx@cydem.org X-Spamd-Result: default: False [1.14 / 15.00]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_NEUTRAL(0.00)[?all]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.30)[0.303]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[cydem.org]; NEURAL_SPAM_MEDIUM(0.46)[0.455]; RCVD_IN_DNSWL_MED(-0.20)[142.90.100.195:from]; NEURAL_SPAM_LONG(0.08)[0.082]; FROM_NO_DN(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:36391, ipnet:142.90.64.0/18, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 09:00:06 -0000 Greetings! Just a quick heads-up that clang fails to detect CPU features correctly in some cases when compiling with -march=native; this affects at least the following ports: -- graphics/opencv: when built on a Xeon E3120, fails to execute [0]. Workaround: add '-mno-popcnt' to CFLAGS, CPPFLAGS, CXXFLAGS in /etc/make.conf, mess with the source to make it compile. This might be purely a bug in opencv, but I recall that there are problems with other ports as well if I don't keep "-mno-popcnt" in FLAGS. -- devel/cargo-c, multimedia/librav1e: fail to build on Pentium G3220 [1]. Workaround: change CPUTYPE to 'westmere' in /etc/make.conf to disable AVX ('-mno-avx' alone does not help). Could someone please have a look to see if this is easily fixable, and/or forward the bug report upstream? [0] # opencv_version ****************************************************************** * FATAL ERROR: * * This OpenCV build doesn't support current CPU/HW configuration * * * * Use OPENCV_DUMP_CONFIG=1 environment variable for details * ****************************************************************** Required baseline features: SSE - OK SSE - OK SSE2 - OK SSE2 - OK SSE3 - OK SSE3 - OK SSSE3 - OK SSSE3 - OK SSE4.1 - OK SSE4.1 - OK POPCNT - NOT AVAILABLE POPCNT - NOT AVAILABLE [1] /usr/ports/devel/cargo-c Compiling hex v0.4.2 Running `/usr/local/bin/rustc --crate-name hex --edition=2018 /usr/ports/devel/cargo-c/work/cargo-c-0.6.7/cargo-crates/hex-0.4.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=5d66a3cbee41d9cd -C extra-filename=-5d66a3cbee41d9cd --out-dir /usr/ports/devel/cargo-c/work/target/release/deps -L dependency=/usr/ports/devel/cargo-c/work/target/release/deps --cap-lints allow -C target-cpu=native -C target-feature=-avx -C target-feature=-avx2 -C target-feature=-sse-unaligned-mem -C linker=cc -C link-arg=-fstack-protector-strong` Running `/usr/ports/devel/cargo-c/work/target/release/build/libc-ea90492b731ea9bd/build-script-build` error: failed to run custom build command for `libc v0.2.71` Caused by: process didn't exit successfully: `/usr/ports/devel/cargo-c/work/target/release/build/libc-ea90492b731ea9bd/build-script-build` (signal: 4, SIGILL: illegal instruction) *** Error code 101 -- [SorAlx] ridin' VN2000 Classic LT