From: Stephen Hemminger <stephen@networkplumber.org>
To: Baruch Siach <baruch@tkos.co.il>
Cc: netdev@vger.kernel.org, Phil Sutter <phil@nwl.cc>
Subject: Re: [PATCH v2] lib: fix multiple strlcpy definition
Date: Fri, 29 Sep 2017 11:58:58 -0700 [thread overview]
Message-ID: <20170929115858.275217b8@xeon-e3> (raw)
In-Reply-To: <6910008ec8db3f63c8120b1624a08328cd203e92.1506621731.git.baruch@tkos.co.il>
On Thu, 28 Sep 2017 21:02:11 +0300
Baruch Siach <baruch@tkos.co.il> wrote:
> Some C libraries, like uClibc and musl, provide BSD compatible
> strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy
> and strlcat when the C library provides them.
>
> This fixes the following static link error with uClibc-ng:
>
> .../sysroot/usr/lib/libc.a(strlcpy.os): In function `strlcpy':
> strlcpy.c:(.text+0x0): multiple definition of `strlcpy'
> ../lib/libutil.a(utils.o):utils.c:(.text+0x1ddc): first defined here
> collect2: error: ld returned 1 exit status
>
> Acked-by: Phil Sutter <phil@nwl.cc>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
This is OK because it doesn't impact normal glibc too much.
> diff --git a/lib/Makefile b/lib/Makefile
> index 0fbdf4c31f50..132ad00c3335 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -1,5 +1,9 @@
> include ../config.mk
>
> +ifeq ($(NEED_STRLCPY),y)
> + CFLAGS += -DNEED_STRLCPY
> +endif
> +
>
I just removed all the conditional CFLAGS out of subdirectory Makefiles
and moved them into the generated config.mk. Please do that for this
as well and resubmit.
next prev parent reply other threads:[~2017-09-29 18:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 18:02 [PATCH v2] lib: fix multiple strlcpy definition Baruch Siach
2017-09-29 18:58 ` Stephen Hemminger [this message]
2017-09-30 20:29 ` Baruch Siach
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=20170929115858.275217b8@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=baruch@tkos.co.il \
--cc=netdev@vger.kernel.org \
--cc=phil@nwl.cc \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox