Skip to contentSkip to conversation

package/uclibc: backport static linking fixes

PATCH Superseded Petr Vorel 2 participants 3 messages Sep 8, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 package/uclibc: backport static linking fixes

---
Hi,

not sure if the second commit, which changes Rules.mak does not require also some change on our side (it shouldn't, but better ask).

Kind regards,
Petr

 ...evert-Fix-static-linking-with-GCC-10.patch | 43 +++++++++++++++++++
 ...0002-fix-static-builds-with-gcc-10.x.patch | 25 +++++++++++
 2 files changed, 68 insertions(+)
 create mode 100644 package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
 create mode 100644 package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +43 -0
new file mode 100644
index 0000000000..be18b32f79
@@ -0,0 +1,43 @@
+From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Wed, 2 Sep 2020 09:45:17 +0200
+Subject: [PATCH 1/2] Revert "Fix static linking with GCC-10"
+
+This reverts commit 5b58a1ebd89a4f05778441814e81817c82193fa3.
+
+This breaks all static builds earlier to gcc 10 :(
+Bad testing on my side.
+---
+ libc/misc/elf/dl-support.c                 | 2 +-
+ libpthread/nptl/sysdeps/generic/libc-tls.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c
+index eaf08f5bb..87cd1bb72 100644
+--- a/libc/misc/elf/dl-support.c
++++ b/libc/misc/elf/dl-support.c
+@@ -29,7 +29,7 @@ void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls;
+ 
+ ElfW(Phdr) *_dl_phdr;
+ size_t _dl_phnum;
+-extern size_t _dl_pagesize;
++size_t _dl_pagesize;
+ 
+ void internal_function _dl_aux_init (ElfW(auxv_t) *av);
+ void internal_function _dl_aux_init (ElfW(auxv_t) *av)
+diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
+index a1d2ef913..d746c9a38 100644
+--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
++++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
+@@ -72,7 +72,7 @@ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list;
+ /* Number of modules in the static TLS block.  */
+ size_t _dl_tls_static_nelem;
+ /* Size of the static TLS block.  */
+-extern size_t _dl_tls_static_size;
++size_t _dl_tls_static_size;
+ /* Size actually allocated in the static TLS block.  */
+ size_t _dl_tls_static_used;
+ /* Alignment requirement of the static TLS block.  */
+-- 
+2.27.0.rc0
+
package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch new file +25 -0
new file mode 100644
index 0000000000..b707558a77
@@ -0,0 +1,25 @@
+From 4deace34cfcc5476b71a9cdc05828f5a48d1cd74 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Thu, 3 Sep 2020 15:08:24 +0200
+Subject: [PATCH 2/2] fix static builds with gcc 10.x
+
+---
+ Rules.mak | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Rules.mak b/Rules.mak
+index f270b7bee..55e88d462 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -288,7 +288,7 @@ OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
+ 
+ # Why -funsigned-char: I hunted a bug related to incorrect
+ # sign extension of 'char' type for 10 hours straight. Not fun.
+-CPU_CFLAGS-y := -funsigned-char -fno-builtin
++CPU_CFLAGS-y := -funsigned-char -fno-builtin -fcommon
+ 
+ $(eval $(call check-gcc-var,-fno-asm))
+ CPU_CFLAGS-y += $(CFLAG_-fno-asm)
+-- 
+2.27.0.rc0
+
Signature · 1 line
2.27.0.rc0
#1 lore raw

PATCH 1/1 package/uclibc: backport static linking fixes

Hello,

Quoted 7 lines · On Tue, 8 Sep 2020 16:48:37 +0200 Petr Vorel <[email protected]> wrote:

---
Hi,

not sure if the second commit, which changes Rules.mak does not require also some change on our side (it shouldn't, but better ask).

The commit log should ideally have a link to the autobuilder failures that this is fixing (we have some I believe).

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 4

Quoted 10 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +4 -0
new file mode 100644
index 0000000000..be18b32f79
@@ -0,0 +1,43 @@
+From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Wed, 2 Sep 2020 09:45:17 +0200
+Subject: [PATCH 1/2] Revert "Fix static linking with GCC-10"

Could you generate the patches with "git format-patch -N". This is pointed out by "make check-package".

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 9

Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +5 -0
+
+This reverts commit 5b58a1ebd89a4f05778441814e81817c82193fa3.
+
+This breaks all static builds earlier to gcc 10 :(
+Bad testing on my side.

We need you to sign-off on the patches.

Same comment for the second patch of course.

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 19

Quoted 10 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +10 -0
+diff --git a/Rules.mak b/Rules.mak
+index f270b7bee..55e88d462 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -288,7 +288,7 @@ OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
+ 
+ # Why -funsigned-char: I hunted a bug related to incorrect
+ # sign extension of 'char' type for 10 hours straight. Not fun.
+-CPU_CFLAGS-y := -funsigned-char -fno-builtin
++CPU_CFLAGS-y := -funsigned-char -fno-builtin -fcommon

Obviously, this is papering over the problem a bit, but OK, if that's the upstream fix for the moment, let's go with it.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author
#2 lore raw

PATCH 1/1 package/uclibc: backport static linking fixes

Hi Thomas,

Quoted 10 lines

Hello,

Quoted 4 lines · On Tue, 8 Sep 2020 16:48:37 +0200 Petr Vorel <[email protected]> wrote:

---
Hi,

Quoted 5 lines
Quoted 2 lines

not sure if the second commit, which changes Rules.mak does not require also some change on our side (it shouldn't, but better ask).

The commit log should ideally have a link to the autobuilder failures that this is fixing (we have some I believe).

Sure, found several, added in v2.

Quoted 5 lines
Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +0 -0
new file mode 100644
index 0000000000..be18b32f79
Quoted 8 lines

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 4

Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +4 -0
@@ -0,0 +1,43 @@
+From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Wed, 2 Sep 2020 09:45:17 +0200
+Subject: [PATCH 1/2] Revert "Fix static linking with GCC-10"

Could you generate the patches with "git format-patch -N". This is pointed out by "make check-package".

Sure, updated in v2. And thanks for a tip. FYI it didn't find a problem in v1 patch:

$ make check-package
find ../buildroot -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) \
	-exec ./utils/check-package {} +
48551 lines processed
0 warnings generated
37530 lines processed
0 warnings generated
30032 lines processed
0 warnings generated
37002 lines processed
0 warnings generated
38287 lines processed
0 warnings generated
Quoted 9 lines

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 9

Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +5 -0
+
+This reverts commit 5b58a1ebd89a4f05778441814e81817c82193fa3.
+
+This breaks all static builds earlier to gcc 10 :(
+Bad testing on my side.

We need you to sign-off on the patches.

Same comment for the second patch of course.

Also fixed.

Quoted 5 lines
Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +5 -0
+diff --git a/Rules.mak b/Rules.mak
+index f270b7bee..55e88d462 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -288,7 +288,7 @@ OPTIMIZATION += $(CFLAG_-fstrict-aliasing)
Quoted 8 lines

package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch line 19

Quoted 5 lines
package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch new file +5 -0
+ 
+ # Why -funsigned-char: I hunted a bug related to incorrect
+ # sign extension of 'char' type for 10 hours straight. Not fun.
+-CPU_CFLAGS-y := -funsigned-char -fno-builtin
++CPU_CFLAGS-y := -funsigned-char -fno-builtin -fcommon

Obviously, this is papering over the problem a bit, but OK, if that's the upstream fix for the moment, let's go with it.

Good.

Quoted 1 line

Thanks!

Thanks a lot for your review.

Kind regards,
Petr