[OE-core] [PATCH] db: disable the ARM assembler mutex code

Zhou, Li li.zhou at windriver.com
Fri Nov 4 09:43:06 UTC 2016


Some more explanations:

Berkeley DB's assembly mutex code for arm is related with arm arch version.

The old version DB code uses old arm instruction (such as swpb), which 
isn't supported by new arm arch (such as armv7).

The new version DB (maybe from 6.1.29 or 6.1.26) uses new arm 
instruction (such as ldrex/strex), which isn't supported by old arm arch 
(such as armv5).

To support all the arm arches, and consider that the Berkeley DB code 
will upgrade in the future, I suggest disable the ARM assembler mutex 
code, and use the default pthreads mutex.

Thanks.
Zhou Li

On 11/04/2016 05:07 PM, Li Zhou wrote:
> The swpb in macro MUTEX_SET will cause "undefined instruction" error
> on the new arm arches which don't support this assembly instruction
> any more. If use ldrex/strex to replace swpb, the old arm arches don't
> support them. So to avoid this issue, just disable the ARM assembler
> mutex code, and use the default pthreads mutex.
>
> Signed-off-by: Li Zhou <li.zhou at windriver.com>
> ---
>   meta/recipes-support/db/db_6.0.30.bb | 9 ---------
>   1 file changed, 9 deletions(-)
>
> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
> index 50a469b..2d08b5e 100644
> --- a/meta/recipes-support/db/db_6.0.30.bb
> +++ b/meta/recipes-support/db/db_6.0.30.bb
> @@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
>   
>   EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
>   
> -# Override the MUTEX setting here, the POSIX library is
> -# the default - "POSIX/pthreads/library".
> -# Don't ignore the nice SWP instruction on the ARM:
> -# These enable the ARM assembler mutex code
> -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
> -MUTEX = ""
> -MUTEX_arm = "${ARM_MUTEX}"
> -MUTEX_armeb = "${ARM_MUTEX}"
> -EXTRA_OECONF += "${MUTEX}"
>   EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
>   
>   # Cancel the site stuff - it's set for db3 and destroys the

-- 
Best Regards!
Zhou Li
Phone number: 86-10-84778511




More information about the Openembedded-core mailing list