[oe] [PATCH] sh: provide patch of __set_fpscr prototype

Khem Raj raj.khem at gmail.com
Wed Sep 15 17:53:21 UTC 2010


Nobuhiro-san

Patches look ok. Could you revise the patches and add increment PR for
the recipes you modified and also please rebase them
on latest master.

Thanks
-Khem

On Tue, Sep 14, 2010 at 12:42 AM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj at renesas.com> wrote:
> When we compile a program that used _FPU_SETCW in sh4 in C++,
> become the error.
> his provides a patch revising this problem.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
> ---
>  recipes/eglibc/eglibc_2.10.bb                 |    1 +
>  recipes/eglibc/eglibc_2.11.bb                 |    1 +
>  recipes/eglibc/eglibc_2.12.bb                 |    1 +
>  recipes/eglibc/eglibc_2.9.bb                  |    5 ++-
>  recipes/eglibc/files/sh4_set_fpscr.patch      |   23 +++++++++++++++++++
>  recipes/eglibc/files/sh4_set_fpscr_2.12.patch |   29 +++++++++++++++++++++++++
>  6 files changed, 58 insertions(+), 2 deletions(-)
>  create mode 100644 recipes/eglibc/files/sh4_set_fpscr.patch
>  create mode 100644 recipes/eglibc/files/sh4_set_fpscr_2.12.patch
>
> diff --git a/recipes/eglibc/eglibc_2.10.bb b/recipes/eglibc/eglibc_2.10.bb
> index c2ed435..1f7ec02 100644
> --- a/recipes/eglibc/eglibc_2.10.bb
> +++ b/recipes/eglibc/eglibc_2.10.bb
> @@ -12,6 +12,7 @@ SRC_URI =
> "svn://svn.eglibc.org/branches;module=${EGLIBC_BRANCH};proto=svn \
>            file://armv4t-interworking.patch \
>            file://IO-acquire-lock-fix.patch \
>            file://shorten-build-commands.patch \
> +           file://sh4_set_fpscr.patch \
>            file://etc/ld.so.conf \
>            file://generate-supported.mk"
>  S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
> diff --git a/recipes/eglibc/eglibc_2.11.bb b/recipes/eglibc/eglibc_2.11.bb
> index 5d9b8e2..c65bf22 100644
> --- a/recipes/eglibc/eglibc_2.11.bb
> +++ b/recipes/eglibc/eglibc_2.11.bb
> @@ -12,6 +12,7 @@ SRC_URI =
> "svn://svn.eglibc.org/branches;module=${EGLIBC_BRANCH};proto=svn \
>            file://eglibc-svn-arm-lowlevellock-include-tls.patch \
>            file://IO-acquire-lock-fix.patch \
>            file://shorten-build-commands.patch \
> +           file://sh4_set_fpscr.patch \
>            file://etc/ld.so.conf \
>            file://generate-supported.mk"
>  S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
> diff --git a/recipes/eglibc/eglibc_2.12.bb b/recipes/eglibc/eglibc_2.12.bb
> index c6b0131..8dbcde0 100644
> --- a/recipes/eglibc/eglibc_2.12.bb
> +++ b/recipes/eglibc/eglibc_2.12.bb
> @@ -12,6 +12,7 @@ SRC_URI =
> "svn://svn.eglibc.org/branches;module=${EGLIBC_BRANCH};proto=svn \
>            file://eglibc-svn-arm-lowlevellock-include-tls.patch \
>            file://IO-acquire-lock-fix.patch \
>            file://shorten-build-commands.patch \
> +           file://sh4_set_fpscr_2.12.patch \
>            file://etc/ld.so.conf \
>            file://generate-supported.mk"
>  S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
> diff --git a/recipes/eglibc/eglibc_2.9.bb b/recipes/eglibc/eglibc_2.9.bb
> index a7d9aed..5df7eb8 100644
> --- a/recipes/eglibc/eglibc_2.9.bb
> +++ b/recipes/eglibc/eglibc_2.9.bb
> @@ -9,9 +9,10 @@ SRCREV="10153"
>  EGLIBC_BRANCH="eglibc-2_9"
>  SRC_URI = "svn://svn.eglibc.org/branches;module=${EGLIBC_BRANCH};proto=svn \
>            file://eglibc-svn-arm-lowlevellock-include-tls.patch \
> -          file://armv4t-interworking.patch \
> -          file://IO-acquire-lock-fix.patch \
> +           file://armv4t-interworking.patch \
> +           file://IO-acquire-lock-fix.patch \
>            file://shorten-build-commands.patch \
> +           file://sh4_set_fpscr.patch \
>            file://etc/ld.so.conf \
>            file://generate-supported.mk"
>  S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
> diff --git a/recipes/eglibc/files/sh4_set_fpscr.patch
> b/recipes/eglibc/files/sh4_set_fpscr.patch
> new file mode 100644
> index 0000000..f3fd5c1
> --- /dev/null
> +++ b/recipes/eglibc/files/sh4_set_fpscr.patch
> @@ -0,0 +1,23 @@
> +# http://sourceware.org/ml/libc-alpha/2009-12/msg00009.html
> +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565369
> +---
> + sysdeps/sh/sh4/fpu/fpu_control.h |    8 ++++++++
> + 1 file changed, 8 insertions(+)
> +
> +--- a/sysdeps/sh/sh4/fpu/fpu_control.h
> ++++ b/sysdeps/sh/sh4/fpu/fpu_control.h
> +@@ -45,6 +45,14 @@
> + #define _FPU_GETCW(cw) __asm__ ("sts fpscr,%0" : "=r" (cw))
> +
> + #if defined __GNUC__
> ++/* Allow the use in C++ code.  */
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> ++extern void __set_fpscr (unsigned long);
> ++#ifdef __cplusplus
> ++}
> ++#endif  /* C++ */
> + #define _FPU_SETCW(cw) __set_fpscr ((cw))
> + #else
> + #define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
> diff --git a/recipes/eglibc/files/sh4_set_fpscr_2.12.patch
> b/recipes/eglibc/files/sh4_set_fpscr_2.12.patch
> new file mode 100644
> index 0000000..19cccc0
> --- /dev/null
> +++ b/recipes/eglibc/files/sh4_set_fpscr_2.12.patch
> @@ -0,0 +1,29 @@
> +diff --git a/sysdeps/sh/sh4/fpu/fpu_control.h
> b/sysdeps/sh/sh4/fpu/fpu_control.h
> +index d1be46d..3ea37d3 100644
> +--- a/sysdeps/sh/sh4/fpu/fpu_control.h
> ++++ b/sysdeps/sh/sh4/fpu/fpu_control.h
> +@@ -1,5 +1,5 @@
> + /* FPU control word definitions.  SH version.
> +-   Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc.
> ++   Copyright (C) 1999, 2000, 2009, 2010 Free Software Foundation, Inc.
> +    This file is part of the GNU C Library.
> +
> +    The GNU C Library is free software; you can redistribute it and/or
> +@@ -46,7 +46,14 @@ typedef unsigned int fpu_control_t;
> +
> + #if defined __GNUC__
> + /* GCC provides this function.  */
> ++/* Allow the use in C++ code.  */
> ++#ifdef __cplusplus
> ++extern "C" {
> ++#endif
> + extern void __set_fpscr (unsigned long);
> ++#ifdef __cplusplus
> ++}
> ++#endif  /* C++ */
> + #define _FPU_SETCW(cw) __set_fpscr ((cw))
> + #else
> + #define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
> +--
> +1.7.1
> +
> --
> 1.7.1
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



-- 
-Khem




More information about the Openembedded-devel mailing list