bfin: fix issues with internal toolchain, re-enable C++ support
PATCH v4 1/1 bfin: fix issues with internal toolchain, re-enable C++ support
From: Waldemar Brodkorb <[email protected]>
The three patches allow to compile applications using TLS emulation from libgcc or C++ applications.
The patches 892-libgcc-mkmap-symver-support-skip_underscore.patch and 893-libgcc-config-bfin-use-the-generic-linker-version-in.patch fixes how libgcc is generated, by making the necessary libgcc symbols declared "GLOBAL", and therefore visible outside of libgcc. This fixes a large number of undefined reference issues (for either C++ applications or applications using TLS emulation). This was reported as gcc PR74748.
The patch 894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch allows to build DWARF in FDPIC mode. This patch replaces the older 892-disable-dwarf-bfin.patch, as instead of disabling DWARF support, it fixes it. This was reported as gcc PR68468.
In order to get C++ working without unresolved symbols, we also need to disable symbol versioning (--disable-symvers). This is a remaining issue in gcc which will be investigated at a later point.
Since this commit fixes C++ support in Blackfin, it re-enables the selection of C++ support for this architecture.
Fixes:
(alsa-lib emutls)
http://autobuild.buildroot.net/results/8544ce58d75820666579db93a25ca5656a8efa8e/
(cairo emutls)
http://autobuild.buildroot.net/results/88b02a5dd5408318941ccbfcea0a9cbaa331500a/
(audiofile c++)
http://autobuild.buildroot.net/results/394e530c5dcd9ccb590eb151aeaadb37d11e0e39/
(assimp c++)
http://autobuild.buildroot.net/results/01f4be126c2d786a5ad7f220c2cf60539888a480/
(bellagio c++)
http://autobuild.buildroot.net/results/ada/ada44228bf13ec05382275bd6571396f5ba2b1f7/
---
Changes since v3:
- Rework patches as Git commits
- Replace the ugly s/__/_/ workaround by a proper, potentially upstreamable fix (discussed with Mike Frysinger)
- Remove the libgcc/config.host hack, no longer needed with the proper fix of the linker version script.
- Improve the commit log.
- Re-enable C++ support.
--- package/gcc/6.1.0/892-disable-dwarf-bfin.patch | 24 - ...bgcc-mkmap-symver-support-skip_underscore.patch | 74 + ...ig-bfin-use-the-generic-linker-version-in.patch | 1962 ++++++++++++++++++++ ...-fix-DWARF-compilation-with-FDPIC-targets.patch | 73 + package/gcc/Config.in.host | 3 - package/gcc/gcc-final/gcc-final.mk | 4 + 6 files changed, 2113 insertions(+), 27 deletions(-) delete mode 100644 package/gcc/6.1.0/892-disable-dwarf-bfin.patch create mode 100644 package/gcc/6.1.0/892-libgcc-mkmap-symver-support-skip_underscore.patch create mode 100644 package/gcc/6.1.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch create mode 100644 package/gcc/6.1.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
package/gcc/6.1.0/892-disable-dwarf-bfin.patch deleted +0 -24
@@ -1,24 +0,0 @@ -Dwarf support does not compile on Blackfin - -Reported upstream: -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68468 - -Signed-off-by: Waldemar Brodkorb <[email protected]> - -diff -Nur gcc-6.1.0.orig/libgcc/config.host gcc-6.1.0/libgcc/config.host ---- gcc-6.1.0.orig/libgcc/config.host 2016-02-26 21:02:28.000000000 +0100 -+++ gcc-6.1.0/libgcc/config.host 2016-05-12 19:26:30.973350274 +0200 -@@ -230,6 +230,13 @@ - ;; - esac - ;; -+bfin-*-*linux*) -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" -+ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" -+ if test x$enable_vtable_verify = xyes; then -+ extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" -+ fi -+ ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) - tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
package/gcc/6.1.0/892-libgcc-mkmap-symver-support-skip_underscore.patch new file +74 -0
74 lines not on this page · raw message
package/gcc/6.1.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch new file +1962 -0
1,962 lines not on this page · raw message
package/gcc/6.1.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch new file +73 -0
73 lines not on this page · raw message
package/gcc/Config.in.host +0 -3
@@ -120,9 +120,6 @@ config BR2_EXTRA_GCC_CONFIG_OPTIONS config BR2_TOOLCHAIN_BUILDROOT_CXX bool "Enable C++ support" select BR2_INSTALL_LIBSTDCPP - # C++ support currently broken for Blackfin, under - # investigation. - depends on !BR2_bfin help Enable this option if you want your toolchain to support the C++ language and you want C++ libraries to be installed on
package/gcc/gcc-final/gcc-final.mk +4 -0
@@ -74,6 +74,10 @@ HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu" HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4* endif +ifeq ($(BR2_bfin),y) +HOST_GCC_FINAL_CONF_OPTS += --disable-symvers +endif + # Disable shared libs like libstdc++ if we do static since it confuses linking ifeq ($(BR2_STATIC_LIBS),y) HOST_GCC_FINAL_CONF_OPTS += --disable-shared
Signature · 1 line
2.7.4
PATCH v4 1/1 bfin: fix issues with internal toolchain, re-enable C++ support
Hi Thomas,
Thomas Petazzoni wrote,
Quoted 17 lines
From: Waldemar Brodkorb <[email protected]>
The three patches allow to compile applications using TLS emulation from libgcc or C++ applications.
The patches 892-libgcc-mkmap-symver-support-skip_underscore.patch and 893-libgcc-config-bfin-use-the-generic-linker-version-in.patch fixes how libgcc is generated, by making the necessary libgcc symbols declared "GLOBAL", and therefore visible outside of libgcc. This fixes a large number of undefined reference issues (for either C++ applications or applications using TLS emulation). This was reported as gcc PR74748.
The patch 894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch allows to build DWARF in FDPIC mode. This patch replaces the older 892-disable-dwarf-bfin.patch, as instead of disabling DWARF support, it fixes it. This was reported as gcc PR68468.
Quoted 6 lines
In order to get C++ working without unresolved symbols, we also need to disable symbol versioning (--disable-symvers). This is a remaining issue in gcc which will be investigated at a later point.
Since this commit fixes C++ support in Blackfin, it re-enables the selection of C++ support for this architecture.
Tested and works great. Awesome. Wonderful.
Thanks for cleaning up my messy hacks :)
best regards
Waldemar
PATCH v4 1/1 bfin: fix issues with internal toolchain, re-enable C++ support
Hello,
Quoted 5 lines · Waldemar Brodkorb
Quoted 2 lines
Since this commit fixes C++ support in Blackfin, it re-enables the selection of C++ support for this architecture.
Tested and works great. Awesome. Wonderful.
Thanks for cleaning up my messy hacks :)
Thanks for your testing! I've added a formal Tested-by tag from you in the commit log.
We still have the --disable-symvers workaround to investigate, though.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Thomas Petazzoni
AppliedPATCH v4 1/1 bfin: fix issues with internal toolchain, re-enable C++ support
In reply to Thomas PetazzoniHello,
Quoted 36 lines · Thomas Petazzoni
From: Waldemar Brodkorb <[email protected]>
The three patches allow to compile applications using TLS emulation from libgcc or C++ applications.
The patches 892-libgcc-mkmap-symver-support-skip_underscore.patch and 893-libgcc-config-bfin-use-the-generic-linker-version-in.patch fixes how libgcc is generated, by making the necessary libgcc symbols declared "GLOBAL", and therefore visible outside of libgcc. This fixes a large number of undefined reference issues (for either C++ applications or applications using TLS emulation). This was reported as gcc PR74748.
The patch 894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch allows to build DWARF in FDPIC mode. This patch replaces the older 892-disable-dwarf-bfin.patch, as instead of disabling DWARF support, it fixes it. This was reported as gcc PR68468.
In order to get C++ working without unresolved symbols, we also need to disable symbol versioning (--disable-symvers). This is a remaining issue in gcc which will be investigated at a later point.
Since this commit fixes C++ support in Blackfin, it re-enables the selection of C++ support for this architecture.
Fixes:
(alsa-lib emutls)
http://autobuild.buildroot.net/results/8544ce58d75820666579db93a25ca5656a8efa8e/
(cairo emutls)
http://autobuild.buildroot.net/results/88b02a5dd5408318941ccbfcea0a9cbaa331500a/
(audiofile c++)
http://autobuild.buildroot.net/results/394e530c5dcd9ccb590eb151aeaadb37d11e0e39/
(assimp c++)
http://autobuild.buildroot.net/results/01f4be126c2d786a5ad7f220c2cf60539888a480/
(bellagio c++)
http://autobuild.buildroot.net/results/ada/ada44228bf13ec05382275bd6571396f5ba2b1f7/
Quoted 2 lines
Signed-off-by Waldemar Brodkorb <[email protected]>Signed-off-by Thomas Petazzoni <[email protected]>
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com