Deal with GCC PR libstdc++/64735
cover Deal with GCC PR libstdc++/64735
libstdc++ does not support exception propagation without lock-free atomic int. The issue has been filed as GCC PR libstdc++/64735 [1] and fixed in GCC trunk r244051 [2] and will be available in GCC 7. Patch #1 adds an option for toolchains affected by this bug.
Patch #2, #3, and #4 marks the architectures NIOS II, ARMv4, ARMv5 and SPARCv8 as affected by this bug.
At least package mpd version 0.20 does not build for those architectures as it uses exception_ptr. The package was bumped within the current release cycle. Mark the package as affected in patch #5.
Patch #6 adds a choice between version 0.20 and 0.19 to mpd to still allow building the package for the above architectures. Version 0.19 does not use the exception C++11 feature and is therefore unaffected by GCC PR libstdc++/64735.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
[2] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=244051
J?rg Krause (6):
toolchain: add option for toolchains affected by GCC PR
libstdc++/64735
arch: mark NIOS II as affected by GCC PR libstdc++/64735 arch/arm: mark ARMv{4,5} as affected by GCC PR libstdc++/64735 arch/sparc: mark SPARCv8 as affected by GCC PR libstdc++/64735 package/mpd: affected by GCC PR libstdc++/64735 package/mpd: add choice between version 0.19 and 0.20
arch/Config.in | 1 + arch/Config.in.arm | 2 ++ arch/Config.in.sparc | 1 + package/mpd/Config.in | 27 +++++++++++++++++++++++++-- package/mpd/mpd.mk | 9 +++++++++ toolchain/toolchain-common.in | 4 ++++ 6 files changed, 42 insertions(+), 2 deletions(-)
Signature · 1 line
2.11.1
PATCH 1/6 toolchain: add option for toolchains affected by GCC PR libstdc++/64735
exception_ptr, nested_exception, and future from libstdc++ are not available for architectures not supporting always lock-free atomic ints before GCC 7.
Bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
Fix available starting from GCC 7 (not yet released):
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=244051
--- toolchain/toolchain-common.in | 4 ++++ 1 file changed, 4 insertions(+)
toolchain/toolchain-common.in +4 -0
@@ -7,6 +7,10 @@ source "package/gdb/Config.in.host" comment "Toolchain Generic Options" +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735 +config BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + bool + # https://sourceware.org/bugzilla/show_bug.cgi?id=19405 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 bool
Signature · 1 line
2.11.1
PATCH 1/6 toolchain: add option for toolchains affected by GCC PR libstdc++/64735
Hello,
Quoted 1 line · J?rg Krause
I've taken a part of your commit log, and added it as a comment here.
toolchain/toolchain-common.in source "package/gdb/Config.in.host" · line 12
Quoted 2 lines
toolchain/toolchain-common.in +2
-0+config BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + bool
Instead of having this option selected by the architecture code, I've added the relevant "default y" and "depends on" here. I believe it's not worth spreading these selects all over the place.
Now that I write this, I realize I've written the logic in the wrong way, I'll fix that up now.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/6 toolchain: add option for toolchains affected by GCC PR libstdc++/64735
Hi Thomas,
Quoted 6 lines · Thomas Petazzoni
Hello,
Quoted 1 line · J?rg Krause
Quoted 8 lines
I've taken a part of your commit log, and added it as a comment here.
toolchain/toolchain-common.in source "package/gdb/Config.in.host" · line 12
Quoted 2 lines
toolchain/toolchain-common.in +2
-0+config BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + boolInstead of having this option selected by the architecture code, I've added the relevant "default y" and "depends on" here. I believe it's not worth spreading these selects all over the place.
You're right! It's much cleaner this way. Thanks!
Quoted 2 lines
Now that I write this, I realize I've written the logic in the wrong way, I'll fix that up now.
J?rg
PATCH 2/6 arch: mark NIOS II as affected by GCC PR libstdc++/64735
In reply to Jörg KrauseNIOS II does not support always lock-free atomic ints. Therefore, exception_ptr, nested_exception, and future from libstdc++ are not available before GCC 7.
--- arch/Config.in | 1 + 1 file changed, 1 insertion(+)
arch/Config.in +1 -0
@@ -154,6 +154,7 @@ config BR2_mips64el config BR2_nios2 bool "Nios II" select BR2_ARCH_HAS_MMU_MANDATORY + select BR2_TOOLCHAIN_HAS_GCC_BUG_64735 help Nios II is a soft core processor from Altera Corporation. http://www.altera.com/
Signature · 1 line
2.11.1
PATCH 2/6 arch: mark NIOS II as affected by GCC PR libstdc++/64735
Hello,
Quoted 8 lines · J?rg Krause
NIOS II does not support always lock-free atomic ints. Therefore,
exception_ptr,nested_exception, and future from libstdc++ are not available before GCC 7.Signed-off-by J?rg Krause <[email protected]>--- arch/Config.in | 1 + 1 file changed, 1 insertion(+)
I've marked patches 2, 3 and 4 as rejected in patchwork.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 3/6 arch/arm: mark ARMv{4, 5} as affected by GCC PR libstdc++/64735
In reply to Jörg KrauseARMv4 and ARMv5 does not support always lock-free atomic ints. Therefore, exception_ptr, nested_exception, and future from libstdc++ are not available before GCC 7.
--- arch/Config.in.arm | 2 ++ 1 file changed, 2 insertions(+)
arch/Config.in.arm +2 -0
@@ -46,9 +46,11 @@ config BR2_ARM_CPU_HAS_THUMB2 config BR2_ARM_CPU_ARMV4 bool + select BR2_TOOLCHAIN_HAS_GCC_BUG_64735 config BR2_ARM_CPU_ARMV5 bool + select BR2_TOOLCHAIN_HAS_GCC_BUG_64735 config BR2_ARM_CPU_ARMV6 bool
Signature · 1 line
2.11.1
PATCH 4/6 arch/sparc: mark SPARCv8 as affected by GCC PR libstdc++/64735
In reply to Jörg KrauseSPARCv8 does not support always lock-free atomic ints. Therefore, exception_ptr, nested_exception, and future from libstdc++ are not available before GCC 7.
--- arch/Config.in.sparc | 1 + 1 file changed, 1 insertion(+)
arch/Config.in.sparc +1 -0
@@ -9,6 +9,7 @@ choice config BR2_sparc_v8 bool "v8" depends on BR2_sparc + select BR2_TOOLCHAIN_HAS_GCC_BUG_64735 config BR2_sparc_leon3 bool "leon3" depends on BR2_sparc
Signature · 1 line
2.11.1
PATCH 5/6 package/mpd: affected by GCC PR libstdc++/64735
In reply to Jörg KrauseMPD uses exception_ptr from libstdc++ which is not available for architectures affected by GCC PR libstdc++/64735.
Fixes:
http://autobuild.buildroot.net/results/552/552e0c4d6482b60045a91fd398c4ffecd8877cce/
http://autobuild.buildroot.net/results/4d3/4d384950b6dba21163bdcd7721ddad133beeb72b/
http://autobuild.buildroot.net/results/842/842e992315dd78765938e6b629386a18fa9bb00c/
.. and many more.
--- package/mpd/Config.in | 4 ++++ 1 file changed, 4 insertions(+)
package/mpd/Config.in +4 -0
@@ -5,6 +5,7 @@ menuconfig BR2_PACKAGE_MPD depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14 + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 depends on BR2_TOOLCHAIN_HAS_ATOMIC select BR2_PACKAGE_BOOST select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
@@ -319,3 +320,6 @@ comment "mpd needs a toolchain w/ C++, threads, wchar, gcc >= 4.9" depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \ !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 + +comment "mpd needs a toolchain not affected by GCC bug 64735" + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
Signature · 1 line
2.11.1
Thomas Petazzoni
AppliedPATCH 5/6 package/mpd: affected by GCC PR libstdc++/64735
Hello,
Quoted 9 lines · J?rg Krause
MPD uses
exception_ptrfrom libstdc++ which is not available for architectures affected by GCC PR libstdc++/64735.Fixes:
http://autobuild.buildroot.net/results/552/552e0c4d6482b60045a91fd398c4ffecd8877cce/
http://autobuild.buildroot.net/results/4d3/4d384950b6dba21163bdcd7721ddad133beeb72b/
http://autobuild.buildroot.net/results/842/842e992315dd78765938e6b629386a18fa9bb00c/
.. and many more.
Quoted 4 lines
Signed-off-by J?rg Krause <[email protected]>--- package/mpd/Config.in | 4 ++++ 1 file changed, 4 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 6/6 package/mpd: add choice between version 0.19 and 0.20
In reply to Jörg KrauseMPD version 0.20 being affected by GCC PR libstdc++/64735 means no mpd package available in Buildroot for the architectures NIOSII, ARMv4, ARMv5 and SPARCv8 until GCC 7 is released.
As the next Buildroot release is in 2017.02 which is before GCC 7 is expected to be released add a choise between version 0.19 and 0.20, so that there is still an mpd package available for the affected architectures.
Note, that we bumped the version from 0.19 to 0.20 within the current Buildroot release cycle.
Note, that for the version 0.19 MPD requires libglib2.
--- package/mpd/Config.in | 31 +++++++++++++++++++++++++------ package/mpd/mpd.mk | 9 +++++++++ 2 files changed, 34 insertions(+), 6 deletions(-)
package/mpd/Config.in +25 -6
@@ -4,8 +4,6 @@ menuconfig BR2_PACKAGE_MPD depends on BR2_USE_WCHAR # flac depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # fork - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14 - depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 depends on BR2_TOOLCHAIN_HAS_ATOMIC select BR2_PACKAGE_BOOST select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
@@ -20,6 +18,30 @@ menuconfig BR2_PACKAGE_MPD if BR2_PACKAGE_MPD +choice + prompt "MPD version" + +config BR2_MPD_VERSION_0_20 + bool "0.20" + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14 + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + +comment "version 0.20 needs toolchain w/ gcc >= 4.9" + depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 + +comment "version 0.20 needs a toolchain not affected by GCC bug 64735" + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + +config BR2_MPD_VERSION_0_19 + bool "0.19" + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_6 + select BR2_PACKAGE_LIBGLIB2 + +comment "version 0.19 needs toolchain w/ gcc >= 4.6" + depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_6 + +endchoice + comment "Archive plugins" config BR2_PACKAGE_MPD_BZIP2
@@ -319,7 +341,4 @@ comment "mpd needs a toolchain w/ C++, threads, wchar, gcc >= 4.9" depends on BR2_USE_MMU depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \ - !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 - -comment "mpd needs a toolchain not affected by GCC bug 64735" - depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 + !BR2_TOOLCHAIN_HAS_THREADS
package/mpd/mpd.mk +9 -0
@@ -4,8 +4,13 @@ # ################################################################################ +ifeq ($(BR2_MPD_VERSION_0_20),y) MPD_VERSION_MAJOR = 0.20 MPD_VERSION = $(MPD_VERSION_MAJOR).4 +else +MPD_VERSION_MAJOR = 0.19 +MPD_VERSION = $(MPD_VERSION_MAJOR).21 +endif MPD_SOURCE = mpd-$(MPD_VERSION).tar.xz MPD_SITE = http://www.musicpd.org/download/mpd/$(MPD_VERSION_MAJOR) MPD_DEPENDENCIES = host-pkgconf boost
@@ -13,6 +18,10 @@ MPD_LICENSE = GPLv2+ MPD_LICENSE_FILES = COPYING MPD_AUTORECONF = YES +ifeq ($(BR2_MPD_VERSION_0_19),y) +MPD_DEPENDENCIES += libglib2 +endif + # Some options need an explicit --disable or --enable # Zeroconf support depends on libdns_sd from avahi.
Signature · 1 line
2.11.1
PATCH 6/6 package/mpd: add choice between version 0.19 and 0.20
Hello,
Quoted 9 lines · J?rg Krause
MPD version 0.20 being affected by GCC PR libstdc++/64735 means no mpd package available in Buildroot for the architectures NIOSII, ARMv4, ARMv5 and SPARCv8 until GCC 7 is released.
As the next Buildroot release is in 2017.02 which is before GCC 7 is expected to be released add a choise between version 0.19 and 0.20, so that there is still an mpd package available for the affected architectures.
Quoted 6 lines
Note, that we bumped the version from 0.19 to 0.20 within the current Buildroot release cycle.
Note, that for the version 0.19 MPD requires libglib2.
Signed-off-by J?rg Krause <[email protected]>
I am not sure we want to support a version choice for mpd just for the sake of NIOSII, ARMv4, ARMv5 and SPARCv8.
I'll let Peter Korsgaard decide if he believes this is worth the additional complexity.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 6/6 package/mpd: add choice between version 0.19 and 0.20
Quoted 19 lines · Thomas Petazzoni
Hello,
Quoted 16 lines · J?rg Krause
MPD version 0.20 being affected by GCC PR libstdc++/64735 means no mpd
package available in Buildroot for the architectures NIOSII, ARMv4, ARMv5 and SPARCv8 until GCC 7 is released.As the next Buildroot release is in 2017.02 which is before GCC 7 is
expected to be released add a choise between version 0.19 and 0.20, so
that there is still an mpd package available for the affected architectures.Note, that we bumped the version from 0.19 to 0.20 within the current Buildroot
release cycle.
Quoted 7 lines
Quoted 3 lines
Note, that for the version 0.19 MPD requires libglib2.
Signed-off-by J?rg Krause <[email protected]>I am not sure we want to support a version choice for mpd just for the
sake of NIOSII, ARMv4, ARMv5 and SPARCv8.
I'm using an ARMv5 board with MPD?myself. I really like to have that package available for this arch in the next Buildroot release.
Quoted 2 lines
I'll let Peter Korsgaard decide if he believes this is worth the additional complexity.
Thanks!
J?rg
PATCH 6/6 package/mpd: add choice between version 0.19 and 0.20
Hello,
Quoted 6 lines · J?rg Krause
Quoted 3 lines
I am not sure we want to support a version choice for mpd just for the
sake of NIOSII, ARMv4, ARMv5 and SPARCv8.I'm using an ARMv5 board with MPD?myself. I really like to have that package available for this arch in the next Buildroot release.
OK, makes sense. So could you send an updated version with the following changes:
- Hash for 0.19, as you mentioned.
- Removal of visible options. Just use 0.20 if possible (recent enough and non-buggy compiler) and fallback to 0.19 if not. A visible choice is really not needed for this. Also, if you use any Config.in option for that, they should be prefixed BR2_PACKAGE_MPD and not BR2_MPD like your patch was doing.
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 6/6 package/mpd: add choice between version 0.19 and 0.20
In reply to Thomas PetazzoniQuoted 21 lines · Thomas Petazzoni
Hello,
Quoted 18 lines · J?rg Krause
MPD version 0.20 being affected by GCC PR libstdc++/64735 means no mpd
package available in Buildroot for the architectures NIOSII, ARMv4, ARMv5 and SPARCv8 until GCC 7 is released.As the next Buildroot release is in 2017.02 which is before GCC 7 is
expected to be released add a choise between version 0.19 and 0.20, so
that there is still an mpd package available for the affected architectures.Note, that we bumped the version from 0.19 to 0.20 within the current Buildroot
release cycle.Note, that for the version 0.19 MPD requires libglib2.
Quoted 8 lines
Quoted 1 line
Signed-off-by J?rg Krause <[email protected]>I am not sure we want to support a version choice for mpd just for the
sake of NIOSII, ARMv4, ARMv5 and SPARCv8.I'll let Peter Korsgaard decide if he believes this is worth the additional complexity.
Just noticed I forgot the hash for mpd 0.19. If Peter decides to accept this patch, I can send an updated version.
J?rg