diff mbox series

[v3,1/1] package/uclibc: backport static linking fixes

Message ID 20200909172547.380537-1-petr.vorel@gmail.com
State Accepted
Headers show
Series [v3,1/1] package/uclibc: backport static linking fixes | expand

Commit Message

Petr Vorel Sept. 9, 2020, 5:25 p.m. UTC
Fixes:
     - http://autobuild.buildroot.net/results/645/6453da1471398e8c788e5b86abc4bf2e83e6c0b2
     - http://autobuild.buildroot.net/results/64d/64db6fcb132896ef3552b52ea743d53d05133982
     - http://autobuild.buildroot.net/results/938/938729c42d52bd9e74454bc34b2b20c4e0503142
     - http://autobuild.buildroot.net/results/bc5/bc50834820c921ce4927f23e4dcfa2aaa405c657
     - http://autobuild.buildroot.net/results/a15/a156ffcbe16af4b2f5440dad06c6985b8fcd045e

Suggested-by: Waldemar Brodkorb <wbx@openadk.org>
Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Changes v2->v3:
* mention backport commit hashes in both patches

Kind regards,
Petr

 ...evert-Fix-static-linking-with-GCC-10.patch | 46 +++++++++++++++++++
 ...0002-fix-static-builds-with-gcc-10.x.patch | 27 +++++++++++
 2 files changed, 73 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

Comments

Romain Naour Oct. 2, 2020, 3:23 p.m. UTC | #1
Hi Petr,

Le 09/09/2020 à 19:25, Petr Vorel a écrit :
> Fixes:
>      - http://autobuild.buildroot.net/results/645/6453da1471398e8c788e5b86abc4bf2e83e6c0b2
>      - http://autobuild.buildroot.net/results/64d/64db6fcb132896ef3552b52ea743d53d05133982
>      - http://autobuild.buildroot.net/results/938/938729c42d52bd9e74454bc34b2b20c4e0503142
>      - http://autobuild.buildroot.net/results/bc5/bc50834820c921ce4927f23e4dcfa2aaa405c657
>      - http://autobuild.buildroot.net/results/a15/a156ffcbe16af4b2f5440dad06c6985b8fcd045e
> 
> Suggested-by: Waldemar Brodkorb <wbx@openadk.org>
> Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

Tested-by: Romain Naour <romain.naour@gmail.com>

https://gitlab.com/kubu93/buildroot/-/jobs/769818673

Best regards,
Romain


> ---
> Changes v2->v3:
> * mention backport commit hashes in both patches
> 
> Kind regards,
> Petr
> 
>  ...evert-Fix-static-linking-with-GCC-10.patch | 46 +++++++++++++++++++
>  ...0002-fix-static-builds-with-gcc-10.x.patch | 27 +++++++++++
>  2 files changed, 73 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
> 
> diff --git a/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
> new file mode 100644
> index 0000000000..246aa5e04c
> --- /dev/null
> +++ b/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
> @@ -0,0 +1,46 @@
> +From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
> +From: Waldemar Brodkorb <wbx@openadk.org>
> +Date: Wed, 2 Sep 2020 09:45:17 +0200
> +Subject: [PATCH] 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.
> +
> +[petr.vorel@gmail.com: backport of upstream commit e80384786d7b7f895c97f2447d4b91af8eb5f0f4]
> +Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> +---
> + 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
> +
> diff --git a/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch b/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
> new file mode 100644
> index 0000000000..0aefe3d82e
> --- /dev/null
> +++ b/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
> @@ -0,0 +1,27 @@
> +From 4deace34cfcc5476b71a9cdc05828f5a48d1cd74 Mon Sep 17 00:00:00 2001
> +From: Waldemar Brodkorb <wbx@openadk.org>
> +Date: Thu, 3 Sep 2020 15:08:24 +0200
> +Subject: [PATCH] fix static builds with gcc 10.x
> +
> +[petr.vorel@gmail.com: backport of upstream commit 4deace34cfcc5476b71a9cdc05828f5a48d1cd74]
> +Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> +---
> + 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
> +
>
Thomas Petazzoni Oct. 6, 2020, 7:27 p.m. UTC | #2
Hello Petr,

On Wed,  9 Sep 2020 19:25:47 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:

> Fixes:
>      - http://autobuild.buildroot.net/results/645/6453da1471398e8c788e5b86abc4bf2e83e6c0b2
>      - http://autobuild.buildroot.net/results/64d/64db6fcb132896ef3552b52ea743d53d05133982
>      - http://autobuild.buildroot.net/results/938/938729c42d52bd9e74454bc34b2b20c4e0503142
>      - http://autobuild.buildroot.net/results/bc5/bc50834820c921ce4927f23e4dcfa2aaa405c657
>      - http://autobuild.buildroot.net/results/a15/a156ffcbe16af4b2f5440dad06c6985b8fcd045e
> 
> Suggested-by: Waldemar Brodkorb <wbx@openadk.org>
> Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

We now have updated to 1.0.36 in master, so this patch is no longer
needed in master.

However, it could be useful for the 2020.08.x branch.

It is not useful for the 2020.02.x however, because 2020.02.x did not
have gcc 10.x support.

Thomas
Peter Korsgaard Oct. 6, 2020, 8:03 p.m. UTC | #3
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > Hello Petr,
 > On Wed,  9 Sep 2020 19:25:47 +0200
 > Petr Vorel <petr.vorel@gmail.com> wrote:

 >> Fixes:
 >> - http://autobuild.buildroot.net/results/645/6453da1471398e8c788e5b86abc4bf2e83e6c0b2
 >> - http://autobuild.buildroot.net/results/64d/64db6fcb132896ef3552b52ea743d53d05133982
 >> - http://autobuild.buildroot.net/results/938/938729c42d52bd9e74454bc34b2b20c4e0503142
 >> - http://autobuild.buildroot.net/results/bc5/bc50834820c921ce4927f23e4dcfa2aaa405c657
 >> - http://autobuild.buildroot.net/results/a15/a156ffcbe16af4b2f5440dad06c6985b8fcd045e
 >> 
 >> Suggested-by: Waldemar Brodkorb <wbx@openadk.org>
 >> Suggested-by: Damien Le Moal <damien.lemoal@wdc.com>
 >> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

 > We now have updated to 1.0.36 in master, so this patch is no longer
 > needed in master.

 > However, it could be useful for the 2020.08.x branch.

Yes, except that 2020.08.x has 1.0.34 and the first patch reverts a
change that was only added in 1.0.35.

Committed to 2020.08.x after dropping the first patch, thanks.
Petr Vorel Oct. 6, 2020, 8:11 p.m. UTC | #4
Hi all,

> We now have updated to 1.0.36 in master, so this patch is no longer
> needed in master.
Great, master is already updated.
BTW how can I check that the toolchain already rebuilt?
I'm asking for iproute2 fix which needs that:
https://patchwork.ozlabs.org/project/buildroot/patch/20200903155728.19448-2-petr.vorel@gmail.com/

Kind regards,
Petr
Thomas Petazzoni Oct. 6, 2020, 8:17 p.m. UTC | #5
On Tue, 6 Oct 2020 22:11:24 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:

> > We now have updated to 1.0.36 in master, so this patch is no longer
> > needed in master.  
> Great, master is already updated.
> BTW how can I check that the toolchain already rebuilt?
> I'm asking for iproute2 fix which needs that:
> https://patchwork.ozlabs.org/project/buildroot/patch/20200903155728.19448-2-petr.vorel@gmail.com/

The toolchains used in the autobuilders are at
http://autobuild.buildroot.net/toolchains/tarballs/. They were last
rebuilt with Buildroot 2020.02. I guess I should rebuild them when we
have 2020.11 ?

Thomas
diff mbox series

Patch

diff --git a/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch b/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
new file mode 100644
index 0000000000..246aa5e04c
--- /dev/null
+++ b/package/uclibc/0001-Revert-Fix-static-linking-with-GCC-10.patch
@@ -0,0 +1,46 @@ 
+From e80384786d7b7f895c97f2447d4b91af8eb5f0f4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 2 Sep 2020 09:45:17 +0200
+Subject: [PATCH] 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.
+
+[petr.vorel@gmail.com: backport of upstream commit e80384786d7b7f895c97f2447d4b91af8eb5f0f4]
+Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
+---
+ 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
+
diff --git a/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch b/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
new file mode 100644
index 0000000000..0aefe3d82e
--- /dev/null
+++ b/package/uclibc/0002-fix-static-builds-with-gcc-10.x.patch
@@ -0,0 +1,27 @@ 
+From 4deace34cfcc5476b71a9cdc05828f5a48d1cd74 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Thu, 3 Sep 2020 15:08:24 +0200
+Subject: [PATCH] fix static builds with gcc 10.x
+
+[petr.vorel@gmail.com: backport of upstream commit 4deace34cfcc5476b71a9cdc05828f5a48d1cd74]
+Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
+---
+ 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
+