All of lore.kernel.org
 help / color / mirror / Atom feed
* fix for strl functions in alsautils
@ 2009-01-26  7:49 Khem Raj
  2009-01-26  8:24 ` Phil Blundell
  0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2009-01-26  7:49 UTC (permalink / raw)
  To: openembedded-devel


        * These funtions are provided by C libraries like uclibc
        Declaring them static here causes static not static declaration
        issues reported by gcc.
---
 packages/alsa/alsa-utils_1.0.18.bb                 |    2 +
 .../files/alsa-utils-strl-funcs-non-static.patch   |   22
++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644
packages/alsa/files/alsa-utils-strl-funcs-non-static.patch

diff --git a/packages/alsa/alsa-utils_1.0.18.bb
b/packages/alsa/alsa-utils_1.0.18.bb
index 8f43982..4de9180 100644
--- a/packages/alsa/alsa-utils_1.0.18.bb
+++ b/packages/alsa/alsa-utils_1.0.18.bb
@@ -3,10 +3,12 @@ HOMEPAGE = "http://www.alsa-project.org"
 SECTION = "console/utils"
 LICENSE = "GPL"
 DEPENDS = "alsa-lib ncurses"
+PR = "r1"

 SRC_URI =
"ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
            file://alsa-utils-automake.patch;patch=1 \
           file://alsa-utils-remove-xmlto.patch;patch=1 \
+          file://alsa-utils-strl-funcs-non-static.patch;patch=1 \
          "

 inherit autotools
diff --git a/packages/alsa/files/alsa-utils-strl-funcs-non-static.patch
b/packages/alsa/files/alsa-utils-strl-funcs-non-static.patch
new file mode 100644
index 0000000..db6bacf
--- /dev/null
+++ b/packages/alsa/files/alsa-utils-strl-funcs-non-static.patch
@@ -0,0 +1,22 @@
+Index: alsa-utils-1.0.18/alsactl/init_sysdeps.c
+===================================================================
+--- alsa-utils-1.0.18.orig/alsactl/init_sysdeps.c      2009-01-25
21:12:40.000000000 -0800
++++ alsa-utils-1.0.18/alsactl/init_sysdeps.c   2009-01-25
21:12:56.000000000 -0800
+@@ -18,7 +18,7 @@
+  */
+
+ #ifdef __GLIBC__
+-static size_t strlcpy(char *dst, const char *src, size_t size)
++size_t strlcpy(char *dst, const char *src, size_t size)
+ {
+       size_t bytes = 0;
+       char *q = dst;
+@@ -37,7 +37,7 @@
+       return bytes;
+ }
+
+-static size_t strlcat(char *dst, const char *src, size_t size)
++size_t strlcat(char *dst, const char *src, size_t size)
+ {
+       size_t bytes = 0;
+       char *q = dst;
--
1.6.0.4




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: fix for strl functions in alsautils
  2009-01-26  7:49 fix for strl functions in alsautils Khem Raj
@ 2009-01-26  8:24 ` Phil Blundell
  2009-02-11  7:29   ` Khem Raj
                     ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Phil Blundell @ 2009-01-26  8:24 UTC (permalink / raw)
  To: openembedded-devel

On Sun, 2009-01-25 at 23:49 -0800, Khem Raj wrote:
> * These funtions are provided by C libraries like uclibc
>         Declaring them static here causes static not static declaration
>         issues reported by gcc.
> [...]
> + #ifdef __GLIBC__
> +-static size_t strlcpy(char *dst, const char *src, size_t size)
> ++size_t strlcpy(char *dst, const char *src, size_t size)
> + {

Wouldn't it be better to change that "#ifdef __GLIBC__" to something
more appropriate?  With your change it looks like you will still get
useless copies of these functions in the resulting binaries.

p.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fix for strl functions in alsautils
  2009-01-26  8:24 ` Phil Blundell
@ 2009-02-11  7:29   ` Khem Raj
  2009-02-11 19:36   ` Khem Raj
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2009-02-11  7:29 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On (26/01/09 08:24), Phil Blundell wrote:
> On Sun, 2009-01-25 at 23:49 -0800, Khem Raj wrote:
> > * These funtions are provided by C libraries like uclibc
> >         Declaring them static here causes static not static declaration
> >         issues reported by gcc.
> > [...]
> > + #ifdef __GLIBC__
> > +-static size_t strlcpy(char *dst, const char *src, size_t size)
> > ++size_t strlcpy(char *dst, const char *src, size_t size)
> > + {
> 
> Wouldn't it be better to change that "#ifdef __GLIBC__" to something
> more appropriate?  With your change it looks like you will still get
> useless copies of these functions in the resulting binaries.

Phil and all

Attached patch checks for these functions during configure time.
it will also cover the uclibc kconfig time case.

Thx

-Khem

[-- Attachment #2: alsa-utils-autoconf-strl-funcs.patch --]
[-- Type: text/x-diff, Size: 1208 bytes --]

Index: alsa-utils-1.0.18/alsactl/init_sysdeps.c
===================================================================
--- alsa-utils-1.0.18.orig/alsactl/init_sysdeps.c	2008-10-29 05:42:11.000000000 -0700
+++ alsa-utils-1.0.18/alsactl/init_sysdeps.c	2009-02-10 23:17:47.000000000 -0800
@@ -17,7 +17,7 @@
  *
  */
 
-#ifdef __GLIBC__
+#if !HAVE_STRLCPY
 static size_t strlcpy(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -36,7 +36,10 @@
 		*q = '\0';
 	return bytes;
 }
+#endif /* !HAVE_STRLCPY */
 
+
+#if !HAVE_STRLCAT
 static size_t strlcat(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -60,4 +63,4 @@
 	*q = '\0';
 	return bytes;
 }
-#endif /* __GLIBC__ */
+#endif /* !HAVE_STRLCAT */
Index: alsa-utils-1.0.18/configure.in
===================================================================
--- alsa-utils-1.0.18.orig/configure.in	2008-10-29 05:48:01.000000000 -0700
+++ alsa-utils-1.0.18/configure.in	2009-02-10 23:02:07.000000000 -0800
@@ -6,7 +6,7 @@
 
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.15])
-
+AC_CHECK_FUNCS(strlcat strlcpy)
 dnl Checks for programs.
 
 dnl try to gues cross-compiler if not set

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fix for strl functions in alsautils
  2009-01-26  8:24 ` Phil Blundell
  2009-02-11  7:29   ` Khem Raj
@ 2009-02-11 19:36   ` Khem Raj
  2009-02-12  0:40   ` Khem Raj
  2009-02-12  5:28   ` Khem Raj
  3 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2009-02-11 19:36 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On (26/01/09 08:24), Phil Blundell wrote:
> On Sun, 2009-01-25 at 23:49 -0800, Khem Raj wrote:
> > * These funtions are provided by C libraries like uclibc
> >         Declaring them static here causes static not static declaration
> >         issues reported by gcc.
> > [...]
> > + #ifdef __GLIBC__
> > +-static size_t strlcpy(char *dst, const char *src, size_t size)
> > ++size_t strlcpy(char *dst, const char *src, size_t size)
> > + {
> 
> Wouldn't it be better to change that "#ifdef __GLIBC__" to something
> more appropriate?  With your change it looks like you will still get
> useless copies of these functions in the resulting binaries.

Attached patch detects these functions during configure and
includes/excludes them accordingly.

> 
> p.
> 
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

[-- Attachment #2: alsa-utils-autoconf-strl-funcs.patch --]
[-- Type: text/x-diff, Size: 1208 bytes --]

Index: alsa-utils-1.0.18/alsactl/init_sysdeps.c
===================================================================
--- alsa-utils-1.0.18.orig/alsactl/init_sysdeps.c	2008-10-29 05:42:11.000000000 -0700
+++ alsa-utils-1.0.18/alsactl/init_sysdeps.c	2009-02-10 23:17:47.000000000 -0800
@@ -17,7 +17,7 @@
  *
  */
 
-#ifdef __GLIBC__
+#if !HAVE_STRLCPY
 static size_t strlcpy(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -36,7 +36,10 @@
 		*q = '\0';
 	return bytes;
 }
+#endif /* !HAVE_STRLCPY */
 
+
+#if !HAVE_STRLCAT
 static size_t strlcat(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -60,4 +63,4 @@
 	*q = '\0';
 	return bytes;
 }
-#endif /* __GLIBC__ */
+#endif /* !HAVE_STRLCAT */
Index: alsa-utils-1.0.18/configure.in
===================================================================
--- alsa-utils-1.0.18.orig/configure.in	2008-10-29 05:48:01.000000000 -0700
+++ alsa-utils-1.0.18/configure.in	2009-02-10 23:02:07.000000000 -0800
@@ -6,7 +6,7 @@
 
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.15])
-
+AC_CHECK_FUNCS(strlcat strlcpy)
 dnl Checks for programs.
 
 dnl try to gues cross-compiler if not set

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fix for strl functions in alsautils
  2009-01-26  8:24 ` Phil Blundell
  2009-02-11  7:29   ` Khem Raj
  2009-02-11 19:36   ` Khem Raj
@ 2009-02-12  0:40   ` Khem Raj
  2009-02-12  5:28   ` Khem Raj
  3 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2009-02-12  0:40 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

On (26/01/09 08:24), Phil Blundell wrote:
> On Sun, 2009-01-25 at 23:49 -0800, Khem Raj wrote:
> > * These funtions are provided by C libraries like uclibc
> >         Declaring them static here causes static not static declaration
> >         issues reported by gcc.
> > [...]
> > + #ifdef __GLIBC__
> > +-static size_t strlcpy(char *dst, const char *src, size_t size)
> > ++size_t strlcpy(char *dst, const char *src, size_t size)
> > + {
> 
> Wouldn't it be better to change that "#ifdef __GLIBC__" to something
> more appropriate?  With your change it looks like you will still get
> useless copies of these functions in the resulting binaries.

here is a different patch.

[-- Attachment #2: alsa-utils-autoconf-strl-funcs.patch --]
[-- Type: text/x-diff, Size: 1208 bytes --]

Index: alsa-utils-1.0.18/alsactl/init_sysdeps.c
===================================================================
--- alsa-utils-1.0.18.orig/alsactl/init_sysdeps.c	2008-10-29 05:42:11.000000000 -0700
+++ alsa-utils-1.0.18/alsactl/init_sysdeps.c	2009-02-10 23:17:47.000000000 -0800
@@ -17,7 +17,7 @@
  *
  */
 
-#ifdef __GLIBC__
+#if !HAVE_STRLCPY
 static size_t strlcpy(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -36,7 +36,10 @@
 		*q = '\0';
 	return bytes;
 }
+#endif /* !HAVE_STRLCPY */
 
+
+#if !HAVE_STRLCAT
 static size_t strlcat(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -60,4 +63,4 @@
 	*q = '\0';
 	return bytes;
 }
-#endif /* __GLIBC__ */
+#endif /* !HAVE_STRLCAT */
Index: alsa-utils-1.0.18/configure.in
===================================================================
--- alsa-utils-1.0.18.orig/configure.in	2008-10-29 05:48:01.000000000 -0700
+++ alsa-utils-1.0.18/configure.in	2009-02-10 23:02:07.000000000 -0800
@@ -6,7 +6,7 @@
 
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.15])
-
+AC_CHECK_FUNCS(strlcat strlcpy)
 dnl Checks for programs.
 
 dnl try to gues cross-compiler if not set

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fix for strl functions in alsautils
  2009-01-26  8:24 ` Phil Blundell
                     ` (2 preceding siblings ...)
  2009-02-12  0:40   ` Khem Raj
@ 2009-02-12  5:28   ` Khem Raj
  3 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2009-02-12  5:28 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On Mon, Jan 26, 2009 at 12:24 AM, Phil Blundell <pb@reciva.com> wrote:
> On Sun, 2009-01-25 at 23:49 -0800, Khem Raj wrote:
>> * These funtions are provided by C libraries like uclibc
>>         Declaring them static here causes static not static declaration
>>         issues reported by gcc.
>> [...]
>> + #ifdef __GLIBC__
>> +-static size_t strlcpy(char *dst, const char *src, size_t size)
>> ++size_t strlcpy(char *dst, const char *src, size_t size)
>> + {
>
> Wouldn't it be better to change that "#ifdef __GLIBC__" to something
> more appropriate?  With your change it looks like you will still get
> useless copies of these functions in the resulting binaries.

Here is alternative patch. Somehow I am having problem sending emails.


Thanks

-Khem

[-- Attachment #2: alsa-utils-autoconf-strl-funcs.patch --]
[-- Type: text/x-patch, Size: 1165 bytes --]

Index: alsa-utils-1.0.18/alsactl/init_sysdeps.c
===================================================================
--- alsa-utils-1.0.18.orig/alsactl/init_sysdeps.c	2008-10-29 05:42:11.000000000 -0700
+++ alsa-utils-1.0.18/alsactl/init_sysdeps.c	2009-02-10 23:17:47.000000000 -0800
@@ -17,7 +17,7 @@
  *
  */
 
-#ifdef __GLIBC__
+#if !HAVE_STRLCPY
 static size_t strlcpy(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -36,7 +36,10 @@
 		*q = '\0';
 	return bytes;
 }
+#endif /* !HAVE_STRLCPY */
 
+
+#if !HAVE_STRLCAT
 static size_t strlcat(char *dst, const char *src, size_t size)
 {
 	size_t bytes = 0;
@@ -60,4 +63,4 @@
 	*q = '\0';
 	return bytes;
 }
-#endif /* __GLIBC__ */
+#endif /* !HAVE_STRLCAT */
Index: alsa-utils-1.0.18/configure.in
===================================================================
--- alsa-utils-1.0.18.orig/configure.in	2008-10-29 05:48:01.000000000 -0700
+++ alsa-utils-1.0.18/configure.in	2009-02-10 23:02:07.000000000 -0800
@@ -6,7 +6,7 @@
 
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.15])
-
+AC_CHECK_FUNCS(strlcat strlcpy)
 dnl Checks for programs.
 
 dnl try to gues cross-compiler if not set

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-12  5:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26  7:49 fix for strl functions in alsautils Khem Raj
2009-01-26  8:24 ` Phil Blundell
2009-02-11  7:29   ` Khem Raj
2009-02-11 19:36   ` Khem Raj
2009-02-12  0:40   ` Khem Raj
2009-02-12  5:28   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.