public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlite/files/, dev-db/sqlite/
Date: Sat, 25 Jan 2025 12:49:28 +0000 (UTC)	[thread overview]
Message-ID: <1737809336.2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1.sam@gentoo> (raw)

commit:     2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 25 12:12:48 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> 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 <sam@gentoo.org>
+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 <sam@gentoo.org>
+--- 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}"


             reply	other threads:[~2025-01-25 12:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-25 12:49 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-28 17:32 [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlite/files/, dev-db/sqlite/ Jakov Smolić
2025-02-26 23:57 Jakov Smolić
2025-02-14 11:35 Sam James
2025-02-09 12:23 Jakov Smolić
2024-12-05 11:39 Jakov Smolić
2024-11-10 22:44 Sam James
2024-11-06 11:03 Sam James
2024-03-21  3:46 Sam James
2024-01-07  8:12 Sam James
2023-12-12  5:43 Sam James
2022-02-02 12:15 Jakov Smolić
2022-01-16 18:33 Jakov Smolić
2021-12-12 23:42 Sam James
2020-09-15 18:34 Mike Gilbert
2020-07-29 18:46 Mike Gilbert
2020-03-09 19:29 Mike Gilbert
2019-08-16 17:03 Mike Gilbert
2019-08-09 18:39 Mike Gilbert
2019-05-05 19:05 Mike Gilbert
2019-02-27 22:35 Mike Gilbert
2019-02-27 22:35 Mike Gilbert
2018-04-26 15:14 Mike Gilbert
2017-09-28 17:18 Mike Gilbert
2017-04-04 19:50 Mike Gilbert
2017-01-27 17:34 Mike Gilbert
2016-11-29  9:16 Lars Wendler
2016-05-30 21:01 Mike Gilbert
2016-04-28 21:07 Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1737809336.2b5e0d06d46241cc2d8c58b7e4a32527534cb4b1.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox