From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 23F001581F0 for ; Sat, 25 Jan 2025 12:49:31 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 0BC5C3434F7 for ; Sat, 25 Jan 2025 12:49:31 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 0899111042D; Sat, 25 Jan 2025 12:49:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 029D711042D for ; Sat, 25 Jan 2025 12:49:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A36FE34337E for ; Sat, 25 Jan 2025 12:49:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 39F16EE8 for ; Sat, 25 Jan 2025 12:49:28 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1737809336.2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlite/files/, dev-db/sqlite/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-db/sqlite/files/sqlite-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch dev-db/sqlite/sqlite-3.47.2-r1.ebuild dev-db/sqlite/sqlite-3.47.2.ebuild dev-db/sqlite/sqlite-3.48.0-r1.ebuild dev-db/sqlite/sqlite-3.48.0.ebuild dev-db/sqlite/sqlite-9999.ebuild X-VCS-Directories: dev-db/sqlite/ dev-db/sqlite/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1 X-VCS-Branch: master Date: Sat, 25 Jan 2025 12:49:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 44e981e6-462a-4794-855e-37b8b47cfc1c X-Archives-Hash: bc95abe4292bbe23a340a3e9407ceef8 commit: 2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1 Author: Sam James gentoo org> AuthorDate: Sat Jan 25 12:12:48 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jan 25 12:48:56 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b5e0d06 dev-db/sqlite: Don't use rdtsc on i486 If -DSQLITE_ENABLE_STMT_SCANSTATUS is passed, rdtsc is used for profiling purposes, but that's not available on i486 CPUs (e.g. Soekris 4501 / AMD Elan in the linked bug). Just look for i586 instead of i386. For the i386/i486 case, it's fine if we use the stub implementation. This feels cleaner than toggling functionality in the ebuild, even if it's unlikely anyone on i486 is going to use that. Thanks to amonakov who found the problem quickly and the relevant part of SQLite. SQLITE_ENABLE_STMT_SCANSTATUS was first enabled with 6d8922b1541e86d62546808b1edca6fe422fc560 (grafted from migration), but I suspect the reason nobody noticed this before is (apart from i486 being rare) that only fairly recent gnupg-2.4.x starts to use SQLite (and we default-enable USE=tofu in-line with some upstream reocmmendations). Bug: https://bugs.gentoo.org/948671 Signed-off-by: Sam James gentoo.org> ...e-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch | 31 ++++++++++++++++++++++ ...qlite-3.47.2.ebuild => sqlite-3.47.2-r1.ebuild} | 1 + ...qlite-3.48.0.ebuild => sqlite-3.48.0-r1.ebuild} | 4 +++ dev-db/sqlite/sqlite-9999.ebuild | 6 ++++- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/dev-db/sqlite/files/sqlite-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch b/dev-db/sqlite/files/sqlite-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch new file mode 100644 index 000000000000..b1f1b6a3aa81 --- /dev/null +++ b/dev-db/sqlite/files/sqlite-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch @@ -0,0 +1,31 @@ +From 0f2389e42ec65fd925e1bce608f382f3b35ee0f6 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Sat, 25 Jan 2025 12:10:24 +0000 +Subject: [PATCH] hwtime.h: Don't use rdtsc on i486 + +If -DSQLITE_ENABLE_STMT_SCANSTATUS is passed, rdtsc is used for profiling +purposes, but that's not available on i486 CPUs (e.g. Soekris 4501 / AMD Elan +in the linked bug). + +Just look for i586 instead of i386. For the i386/i486 case, it's fine if we +use the stub implementation. This feels cleaner than toggling functionality +in the ebuild, even if it's unlikely anyone on i486 is going to use that. + +Thanks to amonakov who found the problem quickly and the relevant part of SQLite. + +Bug: https://bugs.gentoo.org/948671 +Signed-off-by: Sam James +--- a/src/hwtime.h ++++ b/src/hwtime.h +@@ -24,7 +24,7 @@ + */ + #if !defined(__STRICT_ANSI__) && \ + (defined(__GNUC__) || defined(_MSC_VER)) && \ +- (defined(i386) || defined(__i386__) || defined(_M_IX86)) ++ (defined(i586) || defined(__i586__) || defined(_M_IX86)) + + #if defined(__GNUC__) + +-- +2.48.1 + diff --git a/dev-db/sqlite/sqlite-3.47.2.ebuild b/dev-db/sqlite/sqlite-3.47.2-r1.ebuild similarity index 99% rename from dev-db/sqlite/sqlite-3.47.2.ebuild rename to dev-db/sqlite/sqlite-3.47.2-r1.ebuild index ca490c5917e3..044a48ee68f5 100644 --- a/dev-db/sqlite/sqlite-3.47.2.ebuild +++ b/dev-db/sqlite/sqlite-3.47.2-r1.ebuild @@ -53,6 +53,7 @@ fi PATCHES=( "${FILESDIR}"/${PN}-3.45.1-ppc64-ptr.patch "${FILESDIR}"/${PN}-3.47.1-buildtclext.patch + "${FILESDIR}"/${PN}-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch ) _fossil_fetch() { diff --git a/dev-db/sqlite/sqlite-3.48.0.ebuild b/dev-db/sqlite/sqlite-3.48.0-r1.ebuild similarity index 99% rename from dev-db/sqlite/sqlite-3.48.0.ebuild rename to dev-db/sqlite/sqlite-3.48.0-r1.ebuild index d5b15dc53f6c..ffb79ecc5f1d 100644 --- a/dev-db/sqlite/sqlite-3.48.0.ebuild +++ b/dev-db/sqlite/sqlite-3.48.0-r1.ebuild @@ -49,6 +49,10 @@ else BDEPEND+=" app-arch/unzip" fi +PATCHES=( + "${FILESDIR}"/${PN}-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch +) + _fossil_fetch() { local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}" local repo_id="${1}" diff --git a/dev-db/sqlite/sqlite-9999.ebuild b/dev-db/sqlite/sqlite-9999.ebuild index 53686a767f9b..e0fe683ea625 100644 --- a/dev-db/sqlite/sqlite-9999.ebuild +++ b/dev-db/sqlite/sqlite-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -50,6 +50,10 @@ else BDEPEND+=" app-arch/unzip" fi +PATCHES=( + "${FILESDIR}"/${PN}-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch +) + _fossil_fetch() { local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}" local repo_id="${1}"