Using master (919e6d01e93a57d991ed456bc67c43605583ada8) and doing something like:
make -C depends/ HOST=aarch64-unknown-freebsd CC=clang CXX=clang++ CFLAGS="--sysroot=/path/to/sysroot/ " CXXFLAGS="--sysroot=/path/to/sysroot/ -stdlib=libc++" LDFLAGS="-fuse-ld=lld" AR=llvm-ar STRIP=llvm-strip NM=llvm-nm RANLIB=llvm-ranlib NO_QT=1
Results in:
libtool: compile: clang -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.46.1\" "-DPACKAGE_STRING=\"sqlite 3.46.1\"" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.46.1\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_POSIX_FALLOCATE=1 -DHAVE_ZLIB_H=1 -I. -I/bitcoin/depends/aarch64-unknown-freebsd/include -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_HAVE_ZLIB --sysroot=/opt/cross-freebsd-14/ -pipe -std=c11 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -fPIC -DPIC -o sqlite3.o
sqlite3.c:38913:42: error: use of undeclared identifier 'mremap'
38913 | { "mremap", (sqlite3_syscall_ptr)mremap, 0 },
| ^
sqlite3.c:38988:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall[]'
38988 | for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
| ^~~~~~~~~~
sqlite3.c:38997:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall[]'
38997 | for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
| ^~~~~~~~~~
sqlite3.c:39024:20: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall[]'
39024 | for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
| ^~~~~~~~~~
sqlite3.c:39041:16: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall[]'
39041 | for(i=0; i<ArraySize(aSyscall)-1; i++){
| ^~~~~~~~~~~~~~~~~~~
sqlite3.c:15273:38: note: expanded from macro 'ArraySize'
15273 | #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0])))
| ^~~
sqlite3.c:39045:14: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall[]'
39045 | for(i++; i<ArraySize(aSyscall); i++){
| ^~~~~~~~~~~~~~~~~~~
sqlite3.c:15273:38: note: expanded from macro 'ArraySize'
15273 | #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0])))
| ^~~
sqlite3.c:43706:42: error: use of undeclared identifier 'MREMAP_MAYMOVE'
43706 | pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
| ^
7 errors generated.
make[1]: *** [Makefile:542: sqlite3.lo] Error 1