aboutsummaryrefslogtreecommitdiffstats
path: root/packages/db
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2005-11-15 17:16:26 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-11-15 17:16:26 +0000
commit46a0af08c57518f16c489588caa93bff791ad74e (patch)
tree8b9bb67339470fa74898a103951588c33c4d1b61 /packages/db
parent788c17586397848cf645faf2b280e302faa47306 (diff)
downloadopenembedded-46a0af08c57518f16c489588caa93bff791ad74e.tar.gz
db: fix thumb uclibc operation in 4.3.29
- uclibc thumb builds were using libpthread to implement mutexes, the - uclibc version seems to be a stub (at least on thumb). This commit - fixes the ARM/gcc-assembly mutex implementation so that it has thumb - support and the resultant db4 works (tested on LE Thumb uclibc)
Diffstat (limited to 'packages/db')
-rw-r--r--packages/db/db-4.3.29/.mtn2git_empty0
-rw-r--r--packages/db/db-4.3.29/arm-thumb-mutex.patch36
-rw-r--r--packages/db/db_4.3.29.bb4
3 files changed, 38 insertions, 2 deletions
diff --git a/packages/db/db-4.3.29/.mtn2git_empty b/packages/db/db-4.3.29/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/db/db-4.3.29/.mtn2git_empty
diff --git a/packages/db/db-4.3.29/arm-thumb-mutex.patch b/packages/db/db-4.3.29/arm-thumb-mutex.patch
new file mode 100644
index 0000000000..acd446fcd8
--- /dev/null
+++ b/packages/db/db-4.3.29/arm-thumb-mutex.patch
@@ -0,0 +1,36 @@
+--- db-4.3.29-dist/../dbinc/mutex.h 2005-11-15 07:33:27.761042518 -0800
++++ db-4.3.29-dist/../dbinc/mutex.h 2005-11-15 07:55:24.823920060 -0800
+@@ -470,6 +470,25 @@
+ #ifdef LOAD_ACTUAL_MUTEX_CODE
+ #define MUTEX_SET_TEST 1 /* gcc/arm: 0 is clear, 1 is set. */
+
++#if defined __thumb__
++#define MUTEX_SET(tsl) ({ \
++ int __r, __p; \
++ asm volatile( \
++ ".align 2\n\t" \
++ "bx pc\n\t" \
++ "nop\n\t" \
++ ".arm\n\t" \
++ "swpb %0, %2, [%3]\n\t" \
++ "eor %0, %0, #1\n\t" \
++ "orr %1, pc, #1\n\t" \
++ "bx %1\n\t" \
++ ".force_thumb" \
++ : "=&r" (__r), "=r" (__p) \
++ : "r" (1), "r" (tsl) \
++ ); \
++ __r & 1; \
++})
++#else
+ #define MUTEX_SET(tsl) ({ \
+ int __r; \
+ asm volatile( \
+@@ -480,6 +499,7 @@
+ ); \
+ __r & 1; \
+ })
++#endif
+
+ #define MUTEX_UNSET(tsl) (*(volatile tsl_t *)(tsl) = 0)
+ #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
diff --git a/packages/db/db_4.3.29.bb b/packages/db/db_4.3.29.bb
index ba11e12901..31b0b91367 100644
--- a/packages/db/db_4.3.29.bb
+++ b/packages/db/db_4.3.29.bb
@@ -14,10 +14,11 @@ HOMEPAGE = "http://www.sleepycat.com"
LICENSE = "BSD Sleepycat"
VIRTUAL_NAME ?= "virtual/db"
CONFLICTS = "db3"
-PR = "r0"
+PR = "r1"
SRC_URI = "http://downloads.sleepycat.com/db-${PV}.tar.gz"
#SRC_URI_MD5 = "http://downloads.sleepycat.com/db-${PV}.tar.gz.md5"
+SRC_URI += "file://arm-thumb-mutex.patch;patch=1"
inherit autotools
@@ -60,7 +61,6 @@ EXTRA_OECONF = "${DB4_CONFIG}"
# These enable the ARM assembler mutex code, this won't
# work with thumb compilation...
ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
-ARM_MUTEX_thumb = ""
MUTEX = ""
MUTEX_arm = "${ARM_MUTEX}"
MUTEX_armeb = "${ARM_MUTEX}"