Skip to content

Disable the use of intrinsic high-precision multiplies on riscv32 - #44

Closed
bkuhls wants to merge 1 commit into
sqlite:masterfrom
bkuhls:fix_riscv32
Closed

Disable the use of intrinsic high-precision multiplies on riscv32#44
bkuhls wants to merge 1 commit into
sqlite:masterfrom
bkuhls:fix_riscv32

Conversation

@bkuhls

@bkuhls bkuhls commented Apr 26, 2026

Copy link
Copy Markdown

Build is broken in riscv32:

/home/vincent/autobuild/instance-3/output-1/build/sqlite-3.53.0/sqlite3.c:
 In function 'sqlite3Multiply128':
/home/vincent/autobuild/instance-3/output-1/build/sqlite-3.53.0/sqlite3.c:36804:3:
 error: unknown type name '__uint128_t'; did you mean '__uint32_t'?
36804 |   __uint128_t r = (__uint128_t)a * b;

as reported by the buildroot autobuilders:
https://autobuild.buildroot.net/results/a6e/a6e4f391081c8059d93fb5b7bd33e08c57b27dcf//build-end.log

For a discussion about the preprocessor definitions see: riscv-android-src/platform-bionic#10

Quoting some defines from the buildroot compiler that reported the build error:

$ echo | output/per-package/sqlite/host/bin/riscv32-buildroot-linux-gnu-gcc -dM -E - | grep "riscv \|xlen"
#define __riscv 1
#define __riscv_xlen 32

Build is broken in riscv32:

/home/vincent/autobuild/instance-3/output-1/build/sqlite-3.53.0/sqlite3.c:
 In function 'sqlite3Multiply128':
/home/vincent/autobuild/instance-3/output-1/build/sqlite-3.53.0/sqlite3.c:36804:3:
 error: unknown type name '__uint128_t'; did you mean '__uint32_t'?
36804 |   __uint128_t r = (__uint128_t)a * b;

as reported by the buildroot autobuilders:
https://autobuild.buildroot.net/results/a6e/a6e4f391081c8059d93fb5b7bd33e08c57b27dcf//build-end.log

For a discussion about the preprocessor definitions see:
riscv-android-src/platform-bionic#10

Quoting some defines from the buildroot compiler:
$ echo | buildroot/output/per-package/sqlite/host/bin/riscv32-buildroot-linux-gnu-gcc -dM -E - | grep "riscv \|xlen"

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
@bkuhls

bkuhls commented Apr 26, 2026

Copy link
Copy Markdown
Author

Reported the PR on the forum: https://www.sqlite.org/forum/forumpost/f8d1417ce8

@bkuhls

bkuhls commented Apr 27, 2026

Copy link
Copy Markdown
Author

@bkuhls bkuhls closed this Apr 27, 2026
@bkuhls
bkuhls deleted the fix_riscv32 branch April 27, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant