All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
@ 2015-04-01 10:00 Junling Zheng
  2015-04-02  6:34 ` Junling Zheng
  2015-04-02  6:42 ` Bernhard Reutner-Fischer
  0 siblings, 2 replies; 6+ messages in thread
From: Junling Zheng @ 2015-04-01 10:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: peifeiyue

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
+
-- 
1.8.3.4



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

* Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
  2015-04-01 10:00 [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a Junling Zheng
@ 2015-04-02  6:34 ` Junling Zheng
  2015-04-02  6:42 ` Bernhard Reutner-Fischer
  1 sibling, 0 replies; 6+ messages in thread
From: Junling Zheng @ 2015-04-02  6:34 UTC (permalink / raw)
  To: openembedded-core

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




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

* Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
  2015-04-01 10:00 [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a Junling Zheng
  2015-04-02  6:34 ` Junling Zheng
@ 2015-04-02  6:42 ` Bernhard Reutner-Fischer
  2015-04-02  9:45   ` Junling Zheng
  1 sibling, 1 reply; 6+ messages in thread
From: Bernhard Reutner-Fischer @ 2015-04-02  6:42 UTC (permalink / raw)
  To: Junling Zheng, openembedded-core; +Cc: peifeiyue

On April 1, 2015 12:00:25 PM GMT+02:00, Junling Zheng <zhengjunling@huawei.com> wrote:
>The orign_path.patch introduced '_dl_strchr' into ldso/ldso/dl-elf.c,

Please fix the origin patch directly.
Thanks,



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

* Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
  2015-04-02  6:42 ` Bernhard Reutner-Fischer
@ 2015-04-02  9:45   ` Junling Zheng
  2015-04-02 14:35     ` Bernhard Reutner-Fischer
  0 siblings, 1 reply; 6+ messages in thread
From: Junling Zheng @ 2015-04-02  9:45 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer; +Cc: openembedded-core

On 2015/4/2 14:42, Bernhard Reutner-Fischer wrote:
> On April 1, 2015 12:00:25 PM GMT+02:00, Junling Zheng <zhengjunling@huawei.com> wrote:
>> The orign_path.patch introduced '_dl_strchr' into ldso/ldso/dl-elf.c,
> 
> Please fix the origin patch directly.
> Thanks,
> 
Hi, Bernhard

The orign_path.patch is backported from:

http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html

It's an individual. Should I still fix this patch directly?

BTW, should uclibc upstream need this patch to avoid the above problem too?

I had submitted a patch to the uclibc upstream, and expected your review:)

Thanks,

Junling



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

* Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
  2015-04-02  9:45   ` Junling Zheng
@ 2015-04-02 14:35     ` Bernhard Reutner-Fischer
  2015-04-03  2:55       ` Junling Zheng
  0 siblings, 1 reply; 6+ messages in thread
From: Bernhard Reutner-Fischer @ 2015-04-02 14:35 UTC (permalink / raw)
  To: Junling Zheng; +Cc: openembedded-core

On April 2, 2015 11:45:47 AM GMT+02:00, Junling Zheng <zhengjunling@huawei.com> wrote:
>On 2015/4/2 14:42, Bernhard Reutner-Fischer wrote:
>> On April 1, 2015 12:00:25 PM GMT+02:00, Junling Zheng
><zhengjunling@huawei.com> wrote:
>>> The orign_path.patch introduced '_dl_strchr' into
>ldso/ldso/dl-elf.c,
>> 
>> Please fix the origin patch directly.
>> Thanks,
>> 
>Hi, Bernhard
>
>The orign_path.patch is backported from:
>
>http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
>
>It's an individual. Should I still fix this patch directly?

Yes.
>
>BTW, should uclibc upstream need this patch to avoid the above problem
>too?

There currently is no in-tree user of these, so no.
$ORIGIN support is on my todo list..

>
>I had submitted a patch to the uclibc upstream, and expected your
>review:)

See above :)

Cheers,
>
>Thanks,
>
>Junling




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

* Re: [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a
  2015-04-02 14:35     ` Bernhard Reutner-Fischer
@ 2015-04-03  2:55       ` Junling Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Junling Zheng @ 2015-04-03  2:55 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer; +Cc: openembedded-core

OK, I'll submit a patch v2 to both oe-core and uclibc upstream.

Cheers,

Junling

On 2015/4/2 22:35, Bernhard Reutner-Fischer wrote:
> On April 2, 2015 11:45:47 AM GMT+02:00, Junling Zheng <zhengjunling@huawei.com> wrote:
>> On 2015/4/2 14:42, Bernhard Reutner-Fischer wrote:
>>> On April 1, 2015 12:00:25 PM GMT+02:00, Junling Zheng
>> <zhengjunling@huawei.com> wrote:
>>>> The orign_path.patch introduced '_dl_strchr' into
>> ldso/ldso/dl-elf.c,
>>>
>>> Please fix the origin patch directly.
>>> Thanks,
>>>
>> Hi, Bernhard
>>
>> The orign_path.patch is backported from:
>>
>> http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
>>
>> It's an individual. Should I still fix this patch directly?
> 
> Yes.
>>
>> BTW, should uclibc upstream need this patch to avoid the above problem
>> too?
> 
> There currently is no in-tree user of these, so no.
> $ORIGIN support is on my todo list..
> 
>>
>> I had submitted a patch to the uclibc upstream, and expected your
>> review:)
> 
> See above :)
> 
> Cheers,
>>
>> Thanks,
>>
>> Junling
> 
> 
> 
> 




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

end of thread, other threads:[~2015-04-03  2:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 10:00 [PATCH] uclibc: fix undefinition of '_dl_strchr' in libdl.a Junling Zheng
2015-04-02  6:34 ` Junling Zheng
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

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.