diff mbox

[uclibc-ng-devel] okay to commit?

Message ID 20161208024807.GI8584@waldemar-brodkorb.de
State Accepted
Headers show

Commit Message

Waldemar Brodkorb Dec. 8, 2016, 2:48 a.m. UTC
Hi Max,

following patch was developed by crosstool-ng developer.
Okay to commit?

best regards
 Waldemar

Comments

Max Filippov Dec. 9, 2016, 9:10 p.m. UTC | #1
Waldemar, Alexey,

On Wed, Dec 7, 2016 at 6:48 PM, Waldemar Brodkorb <wbx@uclibc-ng.org> wrote:
> following patch was developed by crosstool-ng developer.
> Okay to commit?

I've got a couple questions:

> diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch b/libpthread/nptl/sysdeps/Makefile.commonarch
> index c206ac9..134eade 100644
> --- a/libpthread/nptl/sysdeps/Makefile.commonarch
> +++ b/libpthread/nptl/sysdeps/Makefile.commonarch
> @@ -32,10 +32,11 @@ libpthread_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libpthread_ar
>  libpthread_arch_OBJS = $(libpthread_subarch_OBJS) $(libpthread_arch_COBJ) $(libpthread_arch_SOBJ)
>
>  libc_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_CSRC))
> -libc_arch_SOBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
> +libc_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))

I see that there's a copy-paste-type error, but this change is not a
part of this fix, right?

> diff --git a/libpthread/nptl/sysdeps/xtensa/Makefile.arch b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
> index 9e63b19..c26e197 100644
> --- a/libpthread/nptl/sysdeps/xtensa/Makefile.arch
> +++ b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
> @@ -15,12 +15,11 @@
>  # License along with the GNU C Library; see the file COPYING.LIB.  If
>  # not, see <http://www.gnu.org/licenses/>.
>
> -ASFLAGS-dl-tlsdesc.S = -DNOT_IN_libc=1

Why is it removed? It changes the way dl-tlsdesc.S is built for the ld.so,
not for the libc.
I'm not sure why it was needed at all if it builds identically both with and
without it, but it's also not a part of this fix, right?
Alexey Neyman Dec. 9, 2016, 11:52 p.m. UTC | #2
On 12/09/2016 01:10 PM, Max Filippov wrote:
> Waldemar, Alexey,
>
> On Wed, Dec 7, 2016 at 6:48 PM, Waldemar Brodkorb <wbx@uclibc-ng.org> wrote:
>> following patch was developed by crosstool-ng developer.
>> Okay to commit?
> I've got a couple questions:
>
>> diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch b/libpthread/nptl/sysdeps/Makefile.commonarch
>> index c206ac9..134eade 100644
>> --- a/libpthread/nptl/sysdeps/Makefile.commonarch
>> +++ b/libpthread/nptl/sysdeps/Makefile.commonarch
>> @@ -32,10 +32,11 @@ libpthread_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libpthread_ar
>>   libpthread_arch_OBJS = $(libpthread_subarch_OBJS) $(libpthread_arch_COBJ) $(libpthread_arch_SOBJ)
>>
>>   libc_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_CSRC))
>> -libc_arch_SOBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
>> +libc_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
> I see that there's a copy-paste-type error, but this change is not a
> part of this fix, right?
Yes, I mentioned that it's an unrelated copy-paste fix on IRC.
>
>> diff --git a/libpthread/nptl/sysdeps/xtensa/Makefile.arch b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>> index 9e63b19..c26e197 100644
>> --- a/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>> +++ b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>> @@ -15,12 +15,11 @@
>>   # License along with the GNU C Library; see the file COPYING.LIB.  If
>>   # not, see <http://www.gnu.org/licenses/>.
>>
>> -ASFLAGS-dl-tlsdesc.S = -DNOT_IN_libc=1
> Why is it removed? It changes the way dl-tlsdesc.S is built for the ld.so,
> not for the libc.
> I'm not sure why it was needed at all if it builds identically both with and
> without it, but it's also not a part of this fix, right?
>
Yes, now that it is included via a proxy file, libc-dl-tlsdesc.S, this 
flag indeed only applies to compiling the object for ld.so. I removed it 
when I first tried to compile it under dl-tlsdesc.S name - but that way, 
it also ended up in libc.so.0, where it wasn't needed [*].

This line can be restored. I updated the patch in crosstool-ng's PR.

Regards,
Alexey.
Max Filippov Dec. 10, 2016, 3:23 a.m. UTC | #3
On Fri, Dec 9, 2016 at 3:52 PM, Alexey Neyman <stilor@att.net> wrote:
> On 12/09/2016 01:10 PM, Max Filippov wrote:
>> On Wed, Dec 7, 2016 at 6:48 PM, Waldemar Brodkorb <wbx@uclibc-ng.org>
>> wrote:
>>>
>>> following patch was developed by crosstool-ng developer.
>>> Okay to commit?
>>
>> I've got a couple questions:
>>
>>> diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch
>>> b/libpthread/nptl/sysdeps/Makefile.commonarch
>>> index c206ac9..134eade 100644
>>> --- a/libpthread/nptl/sysdeps/Makefile.commonarch
>>> +++ b/libpthread/nptl/sysdeps/Makefile.commonarch
>>> @@ -32,10 +32,11 @@ libpthread_arch_SOBJ = $(patsubst
>>> %.S,$(libpthread_arch_OUT)/%.o,$(libpthread_ar
>>>   libpthread_arch_OBJS = $(libpthread_subarch_OBJS)
>>> $(libpthread_arch_COBJ) $(libpthread_arch_SOBJ)
>>>
>>>   libc_arch_COBJ = $(patsubst
>>> %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_CSRC))
>>> -libc_arch_SOBJ = $(patsubst
>>> %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
>>> +libc_arch_SOBJ = $(patsubst
>>> %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
>>
>> I see that there's a copy-paste-type error, but this change is not a
>> part of this fix, right?
>
> Yes, I mentioned that it's an unrelated copy-paste fix on IRC.
>>
>>
>>> diff --git a/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>>> b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>>> index 9e63b19..c26e197 100644
>>> --- a/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>>> +++ b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
>>> @@ -15,12 +15,11 @@
>>>   # License along with the GNU C Library; see the file COPYING.LIB.  If
>>>   # not, see <http://www.gnu.org/licenses/>.
>>>
>>> -ASFLAGS-dl-tlsdesc.S = -DNOT_IN_libc=1
>>
>> Why is it removed? It changes the way dl-tlsdesc.S is built for the ld.so,
>> not for the libc.
>> I'm not sure why it was needed at all if it builds identically both with
>> and
>> without it, but it's also not a part of this fix, right?
>>
> Yes, now that it is included via a proxy file, libc-dl-tlsdesc.S, this flag
> indeed only applies to compiling the object for ld.so. I removed it when I
> first tried to compile it under dl-tlsdesc.S name - but that way, it also
> ended up in libc.so.0, where it wasn't needed [*].
>
> This line can be restored. I updated the patch in crosstool-ng's PR.

Acked-by: Max Filippov <jcmvbkbc@gmail.com>
diff mbox

Patch

From a34698c8494116eca2c16a88017047a9fb6273bb Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Wed, 7 Dec 2016 07:59:34 +0100
Subject: [PATCH 2/2] xtensa: fix static linking

uClibc-ng 1.0.20 fixed static linking with "libdl" by adding all libdl functions
into the libc. On xtensa, though, libdl contains an unresolved reference that is
satisfied by the ld.so - which is not a part of the linking in a static case.

Signed-off-by: Alexey Neyman <stilor@att.net>
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 libpthread/nptl/sysdeps/Makefile.commonarch      | 5 +++--
 libpthread/nptl/sysdeps/xtensa/Makefile.arch     | 3 +--
 libpthread/nptl/sysdeps/xtensa/libc-dl-tlsdesc.S | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)
 create mode 100644 libpthread/nptl/sysdeps/xtensa/libc-dl-tlsdesc.S

diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch b/libpthread/nptl/sysdeps/Makefile.commonarch
index c206ac9..134eade 100644
--- a/libpthread/nptl/sysdeps/Makefile.commonarch
+++ b/libpthread/nptl/sysdeps/Makefile.commonarch
@@ -32,10 +32,11 @@  libpthread_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libpthread_ar
 libpthread_arch_OBJS = $(libpthread_subarch_OBJS) $(libpthread_arch_COBJ) $(libpthread_arch_SOBJ)
 
 libc_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_CSRC))
-libc_arch_SOBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
+libc_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_SSRC))
 libc_arch_OBJS = $(libc_arch_COBJ) $(libc_arch_SOBJ)
 libc_arch_a_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(libc_arch_a_CSRC))
-libc_arch_a_OBJS = $(libc_arch_a_COBJ)
+libc_arch_a_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(libc_arch_a_SSRC))
+libc_arch_a_OBJS = $(libc_arch_a_COBJ) $(libc_arch_a_SOBJ)
 
 librt_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(librt_arch_CSRC))
 librt_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(librt_arch_SSRC))
diff --git a/libpthread/nptl/sysdeps/xtensa/Makefile.arch b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
index 9e63b19..c26e197 100644
--- a/libpthread/nptl/sysdeps/xtensa/Makefile.arch
+++ b/libpthread/nptl/sysdeps/xtensa/Makefile.arch
@@ -15,12 +15,11 @@ 
 # License along with the GNU C Library; see the file COPYING.LIB.  If
 # not, see <http://www.gnu.org/licenses/>.
 
-ASFLAGS-dl-tlsdesc.S = -DNOT_IN_libc=1
 ASFLAGS-pthread_spin_lock.S = -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc -DIS_IN_libpthread
 
 libc_arch_a_CSRC = libc-tls.c
-librt_arch_a_SSRC = dl-tlsdesc.S
+libc_arch_a_SSRC = libc-dl-tlsdesc.S
 
 CFLAGS-gen_tlsdesc.c = -S
 $(libpthread_arch_OUT)/gen_tlsdesc.c: $(libpthread_arch_DIR)/tlsdesc.sym | $(libpthread_arch_OUT)
diff --git a/libpthread/nptl/sysdeps/xtensa/libc-dl-tlsdesc.S b/libpthread/nptl/sysdeps/xtensa/libc-dl-tlsdesc.S
new file mode 100644
index 0000000..39da7c2
--- /dev/null
+++ b/libpthread/nptl/sysdeps/xtensa/libc-dl-tlsdesc.S
@@ -0,0 +1 @@ 
+#include <ldso/ldso/xtensa/dl-tlsdesc.S>
-- 
2.1.4