Notice: We have migrated to GitLab launching 2024-05-01 see here:

#3927 closed defect (fixed)

tclsh required to build sqlite -- makes all BSP bsets fail

Reported by: Joel Sherrill Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: tool/rsb Version:
Severity: normal Keywords:
Cc: Blocked By:


I'm not sure what to do about this. If building sqlite is a requirement, then host setup instructions, sb-check, etc are impacted. But dtc is a required component for a few things and the RSB deals with it. It is also possible to say that sqlite should not be in the BSP bsets.

This is IMO a blocker at some level for the 5.1 release because it impacts building all bsets.

+ make -j 8 sqlite3.h
tclsh /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite- /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite- >sqlite3.h
gcc  -g -o mkkeywordhash -DSQLITE_OMIT_WAL=1 -DSQLITE_ENABLE_COLUMN_METADATA=1  /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-
gcc  -g -o lemon /home/joel/rtems-cron-5/rtems-source-builder/rtems/build/sqlite-
/bin/sh: tclsh: command not found

Change History (2)

comment:1 Changed on 04/02/20 at 19:09:55 by Joel Sherrill

Advice from Jonathan Brandmeyer (

We just copied the amalgamation's single .c and .h file into our repository and built it as a single object into our application. So the following recommendations come only from an amateur reading of the sources on current rtems-source-builder master.

3.8.8 is pretty old. I'd just jump straight to 3.30.1, the current release.

Instead of downloading the sqlite-src zip, download sqlite-amalgamation or sqlite-autoconf and use that as a base. I think the bset's configuration invocation is OK, except that I would set different CFLAGS as described in the next couple of paragraphs. See also

By default, the SQLite write-ahead-log relies on mmap to share some of its index structures between multiple processes. It looks like the current RTEMS bset disables the WAL entirely. Using the WAL gives much better performance than the rollback journal for write-intensive use cases. We used SQLite to reliably buffer up and stitch together segments of our field software update process, which fits the WAL very well. We set -DSQLITE_MAX_MMAP_SIZE=0 -DSQLITE_DEFAULT_LOCKING_MODE=1 at compile time to avoid mmap's use since RTEMS has neither a VMM nor multiple address spaces. It is still up to the application to choose either the WAL or the rollback journal. See also

We also added -DSQLITE_ENABLE_MEMSYS5 to our build, and used it to give SQLite its own memory spaces to operate on distinct from the rest of our application. We explicitly provided it with its own MEMSYS5 heap, page cache, and lookaside pools. RTEMS just needs to add the correct compile-time option to support this functionality. It is still up to the application to configure and monitor those memory pools at runtime. See also

comment:2 Changed on 04/03/20 at 00:22:16 by Jonathan Brandmeyer <jbrandmeyer@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"113c65cb56d04c59a0e145f85864fb431419dfa9/rtems-source-builder" 113c65c/rtems-source-builder]:

databases/sqlite: Update to 3.31.1

closes #3927.

Note: See TracTickets for help on using tickets.