All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: fix for strl functions in alsautils
Date: Wed, 11 Feb 2009 11:36:57 -0800	[thread overview]
Message-ID: <20090211193657.GB16064@gmail.com> (raw)
In-Reply-To: <1232958250.4890.104.camel@lenovo.internal.reciva.com>

[-- 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

  parent reply	other threads:[~2009-02-11 19:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-02-12  0:40   ` Khem Raj
2009-02-12  5:28   ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090211193657.GB16064@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.