Undefined reference to txn_abort/txn_begin/txn_commit
Russ Allbery
rra at stanford.edu
Sun Jan 25 22:03:30 UTC 2004
Toon van der Pas <toon at hout.vanvergehaald.nl> writes:
> I'm trying to build INN-2.4.1 with Berkeley DB, and keep getting the
> error in $SUBJECT. Could someone please help me? Thanks in advance.
Hm. Well, this is the error that I fixed for Berkeley DB 4.1 and later in
CURRENT, because 4.2 at least doesn't have the txn_abort etc. functions as
separate functions (they're just attributes of transactions). But I
thought 4.0 and 4.1 still included the functions, and poking about with
the older shared libraries that I have installed, this does appear to be
the case.
Could you try the following patch and see if it fixes your problem?
Please let me know if it does, and I'll add it to STABLE and the next
patch release. Although it really *shouldn't* based on the output that
you showed, unless you somehow have 4.2 headers with your 4.0 library.
I'm very tempted to just drop support for all versions of Berkeley DB
prior to 4.2 in INN 2.5 to simplify our code considerably. By the time
that INN 2.5 comes out, that should be fairly widespread.
--- inn-2.4/storage/ovdb/ovdb-private.h 2003-03-13 01:22:47.000000000 -0800
+++ inn/storage/ovdb/ovdb-private.h 2003-10-20 00:00:45.000000000 -0700
@@ -188,8 +188,8 @@
#define TRYAGAIN EAGAIN
-#else
-/* version 3 */
+#elif DB_VERSION_MAJOR < 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 1)
+/* version 3 and 4.0 */
#define TXN_START(label, tid) \
label: { \
@@ -209,6 +209,27 @@
#define TRYAGAIN DB_LOCK_DEADLOCK
+#else
+/* version 4.1 and later */
+
+#define TXN_START(label, tid) \
+label: { \
+ int txn_ret; \
+ txn_ret = OVDBenv->txn_begin(OVDBenv, NULL, &tid, 0); \
+ if (txn_ret != 0) { \
+ syslog(L_ERROR, "OVDB: " #label " txn_begin: %s", db_strerror(ret)); \
+ tid = NULL; \
+ } \
+}
+
+#define TXN_RETRY(label, tid) \
+{ (tid)->abort(tid); goto label; }
+
+#define TXN_ABORT(label, tid) (tid)->abort(tid)
+#define TXN_COMMIT(label, tid) (tid)->commit(tid, 0)
+
+#define TRYAGAIN DB_LOCK_DEADLOCK
+
#endif /* DB_VERSION_MAJOR == 2 */
#endif /* USE_BERKELEY_DB */
> Here are the last lines of the compile:
The interesting bits are probably the compilation lines for ovdb.c.
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
More information about the inn-workers
mailing list