Fossil Forum

fossil + see no longer compiles
Login

fossil + see no longer compiles

fossil + see no longer compiles

(1) By anonymous on 2022-07-25 15:27:04 [source]

I'm trying to build fossil + see on both arm64 os x and x86 linux with the following steps (repurposed from the official build steps and have worked in the past):

cd fossil/version-2.19
cp ../sqlite-see/version-3.39.2/sqlite3-see-cccrypt.c extsrc/sqlite3-see.c  # sqlite3-see-aes256-ofb.c for linux
cp ../sqlite-see/version-3.39.2/shell.c extsrc/shell-see.c
# ensure the versions match
cp ../sqlite-see/version-3.39.2/sqlite3.c extsrc/sqlite3.c
cp ../sqlite-see/version-3.39.2/sqlite3.h extsrc/sqlite3.h

curl -O https://www.openssl.org/source/openssl-3.0.5.tar.gz
tar -C compat -xzf openssl-3.0.5.tar.gz
mv compat/openssl-3.0.5 compat/openssl
cd compat/openssl
./config no-ssl3 no-weak-ssl-ciphers no-shared no-threads no-asm --openssldir=/etc/ssl
CFLAGS=-Os make -e -j8

cd ../..
mkdir bld 
./configure --with-see --with-openssl=tree --disable-fusefs --json
CFLAGS="-Os" make -e -j8 clean fossil

On Mac arm64 I get:

Undefined symbols for architecture arm64:
  "_sqlite3_aggregate_context", referenced from:
      _decimalSumStep in shell.o
      _decimalSumFinalize in shell.o
      _decimalSumValue in shell.o
      _decimalSumInverse in shell.o
      _zipfileStep in shell.o
      _zipfileFinal in shell.o
      _capability_union_step in capabilities.o
      ...
  "_sqlite3_auto_extension", referenced from:
      _sqlcmd_init_proc in sqlcmd.o
  "_sqlite3_backup_finish", referenced from:
      _do_meta_command in shell.o
  "_sqlite3_backup_init", referenced from:
      _do_meta_command in shell.o
  "_sqlite3_backup_step", referenced from:
      _do_meta_command in shell.o
[...snip...]
  "_sqlite3_wal_checkpoint", referenced from:
      _db_close in db.o
      _db_close_config in db.o
      _db_panic_close in db.o
ld: symbol(s) not found for architecture arm64

Linux x86 produces similar errors:

/usr/bin/ld: bld/main.o: in function `fossil_sqlite_log': main_.c:(.text+0x322): undefined reference to `sqlite3_snprintf' /usr/bin/ld: main_.c:(.text+0x493): undefined reference to `sqlite3_next_stmt' /usr/bin/ld: main_.c:(.text+0x4a3): undefined reference to `sqlite3_stmt_busy' /usr/bin/ld: main_.c:(.text+0x4af): undefined reference to `sqlite3_sql' /usr/bin/ld: main_.c:(.text+0x4d3): undefined reference to `sqlite3_next_stmt' /usr/bin/ld: bld/main.o: in function `expand_args_option': main_.c:(.text+0x6ad): undefined reference to `sqlite3_initialize' /usr/bin/ld: bld/main.o: in function `fossil_main': main_.c:(.text+0xbdd): undefined reference to `sqlite3_libversion_number' /usr/bin/ld: main_.c:(.text+0xbe9): undefined reference to `sqlite3_libversion' /usr/bin/ld: main_.c:(.text+0xbff): undefined reference to `sqlite3_sourceid' /usr/bin/ld: main_.c:(.text+0xc23): undefined reference to `sqlite3_config' /usr/bin/ld: main_.c:(.text+0xc38): undefined reference to `sqlite3_config' /usr/bin/ld: main_.c:(.text+0xcfa): undefined reference to `sqlite3_vfs_find' /usr/bin/ld: main_.c:(.text+0xd0c): undefined reference to `sqlite3_vfs_register' /usr/bin/ld: bld/main.o: in function `fossil_version_blob': main_.c:(.text+0x16f0): undefined reference to `sqlite3_sourceid' /usr/bin/ld: main_.c:(.text+0x16f8): undefined reference to `sqlite3_libversion' /usr/bin/ld: main_.c:(.text+0x172c): undefined reference to `sqlite3_open' /usr/bin/ld: bld/main.o: in function `process_one_web_page': [...snip...] /usr/bin/ld: bld/zip.o: in function `zip_add_file': zip_.c:(.text+0x7e9): undefined reference to `sqlite3_vfs_register' /usr/bin/ld: zip_.c:(.text+0x802): undefined reference to `sqlite3_open_v2' /usr/bin/ld: zip_.c:(.text+0x848): undefined reference to `sqlite3_exec' /usr/bin/ld: zip_.c:(.text+0x862): undefined reference to `sqlite3_prepare' /usr/bin/ld: zip_.c:(.text+0x898): undefined reference to `sqlite3_bind_int64' /usr/bin/ld: zip_.c:(.text+0x8d5): undefined reference to `sqlite3_bind_text' /usr/bin/ld: zip_.c:(.text+0x8e8): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x8f8): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x906): undefined reference to `sqlite3_bind_null' /usr/bin/ld: zip_.c:(.text+0x91e): undefined reference to `sqlite3_bind_text' /usr/bin/ld: zip_.c:(.text+0x937): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x948): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x960): undefined reference to `sqlite3_bind_text' /usr/bin/ld: zip_.c:(.text+0x987): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x998): undefined reference to `sqlite3_bind_int' /usr/bin/ld: zip_.c:(.text+0x9e7): undefined reference to `sqlite3_bind_blob' /usr/bin/ld: zip_.c:(.text+0x9f0): undefined reference to `sqlite3_step' /usr/bin/ld: zip_.c:(.text+0xa17): undefined reference to `sqlite3_reset' collect2: error: ld returned 1 exit status make: *** [src/main.mk:744: fossil] Error 1 `

Both compile and function without the see extension.

Am I doing something wrong when building these?

(2) By Stephan Beal (stephan) on 2022-07-25 16:20:31 in reply to 1 [link] [source]

./configure --with-see --with-openssl=tree --disable-fusefs --json

Can you confirm whether it worked with fossil 2.18? Late last year we overhauled how fossil's configure process deals with sqlite3.c/h and it's possible we broke it back then and nobody noticed. It would be helpful to know whether 2.18 gives you the same problem.

2.18 is currently still available on the downloads page.

Preliminary testing shows that sqlite3(-see).o is not being included in the linker flags in that build configuration. The "it got broken last December" hypothesis is sounding more plausible. i'm looking into a fix now.

(3) By anonymous on 2022-07-25 16:34:18 in reply to 2 [link] [source]

Can you confirm whether it worked with fossil 2.18?

I get same/similar linking errors on fossil 2.18 with see 3.39.2.

2.17 was the last working version.

(4) By Stephan Beal (stephan) on 2022-07-25 16:35:55 in reply to 3 [link] [source]

I get same/similar linking errors on fossil 2.18 with see 3.39.2.

Thank you for the confirmation. The build problem has been identified and a fix has been applied, it just needs some more testing before checking it in.

(5) By Stephan Beal (stephan) on 2022-07-25 16:49:48 in reply to 3 [link] [source]

A fix has been checked in. With that in place, the SEE build "works for me":

$ cp /path/to/see/shell.c extsrc/shell-see.c
$ cp /path/to/see/sqlite3-see-aes256-ofb.c extsrc/sqlite3-see.c
$ cp /path/to/see/sqlite3.h extsrc/.
# ^^^^ Without this, shell-see.c warns of SEE-specific symbols not declared in
# ^^^^ the standard sqlite3.h.
$ ./configure --with-see --disable-fusefs --json
$ make -j4
$ ./fossil version -v -v | grep -i see
USE_SEE
SQLITE_CODEC=see-aes256-ofb

# And let's ensure that the non-SEE build still works...
$ make distclean
$ ./configure --disable-fusefs --json
$ make -j4
$ ./fossil version -v -v | grep -i see
(no ouputput)

Thank you for the problem report.

(6) By anonymous on 2022-07-25 17:06:42 in reply to 5 [link] [source]

A fix has been checked in. With that in place, the SEE build "works for me":

Confirmed as also working for me on OSX arm64 and Linux x86.

Thanks for the quick fix.