Bug 244459 - databases/sqlite3: undefined symbol pthread_create when compiling *without* THREADS
Summary: databases/sqlite3: undefined symbol pthread_create when compiling *without* T...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-27 01:22 UTC by Brian Haug
Modified: 2020-02-27 01:22 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (pavelivolkov)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Haug 2020-02-27 01:22:12 UTC
# uname -a
FreeBSD port-master 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 r357991 GENERIC  amd64

/etc/make.conf is an empty file

A scan of ports/UPDATING for sqlite didn't have anything that seemed related.

when building sqlite3 on system above the last several lines related to the build are:

libtool: link: cc -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong -o sqlite3 sqlite3-shell.o sqlite3-sqlite3.o  -L/usr/local/lib -lreadline -ltermcap -lz -lm
ld: error: undefined symbol: pthread_create
>>> referenced by sqlite3.c
>>>               sqlite3-sqlite3.o:(vdbeSorterFlushPMA)

ld: error: undefined symbol: pthread_create
>>> referenced by sqlite3.c
>>>               sqlite3-sqlite3.o:(vdbePmaReaderIncrInit)

ld: error: undefined symbol: pthread_create
>>> referenced by sqlite3.c
>>>               sqlite3-sqlite3.o:(vdbePmaReaderNext)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1



Seems like there are two relatively obvious options:
1.  Remove THREADS from the OPTIONS_DEFINE in the Makefile
2.  Add an appropriate #ifdef or similar around the threaded code.  Alas, I don't have enough experience at the moment to implement this and send a suggested patch.