All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junling Zheng <zhengjunling@huawei.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
Date: Thu, 2 Apr 2015 14:34:02 +0800	[thread overview]
Message-ID: <551CE2DA.70409@huawei.com> (raw)
In-Reply-To: <1427882425-19536-1-git-send-email-zhengjunling@huawei.com>

Cc Saul Wold <sgw@linux.intel.com>, who is the maintainer of uclibc's recipe.

On 2015/4/1 18:00, Junling Zheng wrote:
> The orign_path.patch introduced '_dl_strchr' into ldso/ldso/dl-elf.c, and
> caused the following undefined referencing compiling error:
> 
>   | .../libdl.a(libdl.os): In function `search_for_named_library':
>   | .../dl-elf.c:156: undefined reference to `_dl_strchr'
>   | collect2: error: ld returned 1 exit status
> 
> I found this problem when compiling gdb in static mode using uclibc.
> 
> Add the definition of '_dl_strchr' to fix it. The '_dl_strstr' is added
> as well.
> 
> Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
> ---
>  meta/recipes-core/uclibc/uclibc-git.inc            |  1 +
>  ...-define-_dl_strchr-and-_dl_strstr-if-not-.patch | 39 ++++++++++++++++++++++
>  2 files changed, 40 insertions(+)
>  create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-dl-string.h-define-_dl_strchr-and-_dl_strstr-if-not-.patch
> 
> diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc
> index a2b2353..68240dc 100644
> --- a/meta/recipes-core/uclibc/uclibc-git.inc
> +++ b/meta/recipes-core/uclibc/uclibc-git.inc
> @@ -25,5 +25,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \
>  	file://0002-wire-setns-syscall.patch \
>  	file://0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch \
>  	file://0001-timex-Sync-with-glibc.patch \
> +	file://0001-dl-string.h-define-_dl_strchr-and-_dl_strstr-if-not-.patch \
>  	"
>  S = "${WORKDIR}/git"
> diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-dl-string.h-define-_dl_strchr-and-_dl_strstr-if-not-.patch b/meta/recipes-core/uclibc/uclibc-git/0001-dl-string.h-define-_dl_strchr-and-_dl_strstr-if-not-.patch
> new file mode 100644
> index 0000000..e94fbba
> --- /dev/null
> +++ b/meta/recipes-core/uclibc/uclibc-git/0001-dl-string.h-define-_dl_strchr-and-_dl_strstr-if-not-.patch
> @@ -0,0 +1,39 @@
> +From eb1806f581a134599c1ef26975f514e35663f8c2 Mon Sep 17 00:00:00 2001
> +From: Junling Zheng <zhengjunling@huawei.com>
> +Date: Tue, 31 Mar 2015 12:00:58 +0000
> +Subject: [PATCH] dl-string.h: define _dl_strchr and _dl_strstr if not
> + IS_IN_rtld
> +
> +We should define _dl_strchr and _dl_strstr when not defining IS_IN_rtld.
> +Otherwise, if someone use _dl_strchr or _dl_strstr in the ldso/ldso/dl-
> +elf.c, libdl.a will lack the declaration of '_dl_strchr' or '_dl_strstr',
> +and there will be an compiling error like the following:
> +
> +  dl-elf.c:156: undefined reference to `_dl_strchr'
> +
> +So, add the definition of _dl_strchr and _dl_strstr.
> +
> +Upstream-Status: Submitted [http://lists.uclibc.org/pipermail/uclibc/2015-March/048888.html]
> +
> +Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
> +---
> + ldso/include/dl-string.h | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h
> +index aacad10..14ae617 100644
> +--- a/ldso/include/dl-string.h
> ++++ b/ldso/include/dl-string.h
> +@@ -204,7 +204,9 @@ static __always_inline char * _dl_get_last_path_component(char *path)
> + # define _dl_strcat strcat
> + # define _dl_strcpy strcpy
> + # define _dl_strcmp strcmp
> ++# define _dl_strchr strchr
> + # define _dl_strrchr strrchr
> ++# define _dl_strstr strstr
> + # define _dl_memcpy memcpy
> + # define _dl_memcmp memcmp
> + # define _dl_memset memset
> +-- 
> +1.8.3.4
> +
> 




  reply	other threads:[~2015-04-02  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01 10:00 [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a Junling Zheng
2015-04-02  6:34 ` Junling Zheng [this message]
2015-04-02  6:42 ` Bernhard Reutner-Fischer
2015-04-02  9:45   ` Junling Zheng
2015-04-02 14:35     ` Bernhard Reutner-Fischer
2015-04-03  2:55       ` Junling Zheng

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=551CE2DA.70409@huawei.com \
    --to=zhengjunling@huawei.com \
    --cc=openembedded-core@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.