From nobody Wed Aug 2 20:06:25 2023 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RGNKN3HnwzZkDY for ; Wed, 2 Aug 2023 20:06:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RGNKH6vZsz3CnP for ; Wed, 2 Aug 2023 20:06:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691006788; a=rsa-sha256; cv=none; b=mZmLtifTGUxO7BJXKsskBiHCX/7ntu0rZ1vwaEfVf0hhoOXEzdQSn18FFsr7MbCr8a+mrl PSaepvc2jJMuhyrcAb3HRX+wSB93/HI0ti0dNwmfI2shUjq6mJLpiklywgkR/tlP7Rh3Bz 8dxLiDyOQLhJ64V5ORrPdIuVV/M5yZyyKZFlzIGTbwmAdJnmdldGAr+zQVDhR9omyKyduE LiQSSttNoYa3OSV6R1FYAhCnM0fJINaroCcSwIY9F2ehZJ0VBXwzLlmVRGokFXuC41XZ/m CvvJd3mbPXMV3nEk6irFsldXNWKODHI1OiN/l1xaiwdy8hK7WW440upEQtVeXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691006788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Em3SuQ6LbGgSbdQkrbhHXaO9qEu4i2oSqXFECewrPQ=; b=FcJEp4rIFn07iJ0Xna6pN9SNQrbv50ndYn21+C7pxI8LGoUCY3iQ4SIeFDMN8Zamvor3Ty tdfCMuiV5tb6sUnTvlq1I7uFfQkgxda3+bFvR1Er2EAjot1ZtmhkbxYVURS2/H4PnEwe12 ADJNp1gSnhHsKoZJtGBA/0w6I/Bv6rG/aYCcSy8t4A/SXDOl4VWVI/TlsP6uxTzYBlBcH9 Fai7/M41dsn/VeBZ8hLg6e6kCHRxA8mD59iVW26WtYu7WY3jKTV8PCjTzUMokgw8fxskmK irNJcWHUjs3oxRmSqB9NDVq3K8ZHGfDvJXBv0i4o7WKOwJ+MVwvFVZBXV4+aHw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RGNKG1xkwzXJy for ; Wed, 2 Aug 2023 20:06:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 372K6P7F093757 for ; Wed, 2 Aug 2023 20:06:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 372K6Psb093756 for ports-bugs@FreeBSD.org; Wed, 2 Aug 2023 20:06:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 272900] Mk/Uses/cpufeatures.mk - Framework helper for detecting CPU features/instructions Date: Wed, 02 Aug 2023 20:06:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Ports Framework X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: diizzy@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: portmgr@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272900 Bug ID: 272900 Summary: Mk/Uses/cpufeatures.mk - Framework helper for detecting CPU features/instructions Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Ports Framework Assignee: portmgr@FreeBSD.org Reporter: diizzy@FreeBSD.org CC: fuz@FreeBSD.org, ports-bugs@FreeBSD.org, yuri@freebsd.org, zirias@freebsd.org Some upstream projects have specific optimized code paths which is great for peformance however many times they're are not detected during run-time but instead hardcoded and selected during configure/build stage. Currently we h= ave no way of detecting features but instead need to rely on OPTIONS which is a pain and can lead to incorrect choices and/or broken binaries if wrong opti= ons are selected. Having a quick look grep returns the following and I'm quite sure we have m= ore potential users however maintainers haven't bothered because lack of framew= ork functionality. grep -ir AVX --include Makefile /usr/ports/ | grep OPTIONS_DEFINE | wc -l 23 grep -ir SSE --include Makefile /usr/ports/ | grep OPTIONS_DEFINE | wc -l 63 grep -ir NEON --include Makefile /usr/ports/ | grep OPTIONS_DEFINE | wc -l 7 grep -ir VSX --include Makefile /usr/ports/ | grep OPTIONS_DEFINE | wc -l 2 There are at least two way of getting what features the compiler defines: clang -v -march=3Dnative -E - crc32 would be CPU_FEAT_CRC32 and fma4 not initialized at all since it's being disabled etc Any ideas and/or input? --=20 You are receiving this mail because: You are on the CC list for the bug.=