* [Buildroot] [PATCH v3 0/3] treat gcc bug 63261 in a common way
@ 2019-05-29 14:51 Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261 Giulio Benetti
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Giulio Benetti @ 2019-05-29 14:51 UTC (permalink / raw)
To: buildroot
As done for other Gcc bugs introduce and use
BR2_TOOLCHAIN_HAS_GCC_BUG_63261 in affected packages:
- fxload
- dmalloc
This is more consistent than checking same conditions for every package
and putting a comment on top of it.
Changes:
V1->V2:
* add 'depends on BR2_ENABLE_DEBUG' to BR2_TOOLCHAIN_HAS_GCC_BUG_63261
V2->V3:
* remove 'depends on BR2_ENABLE_DEBUG' from BR2_TOOLCHAIN_HAS_GCC_BUG_63261
Giulio Benetti (3):
toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261
package/fxload: re-enable package on Microblaze
package/dmalloc: re-enable package on Microblaze
package/dmalloc/Config.in | 4 ----
package/dmalloc/dmalloc.mk | 4 ++++
package/fxload/Config.in | 4 ----
package/fxload/fxload.mk | 9 ++++++++-
toolchain/Config.in | 7 +++++++
5 files changed, 19 insertions(+), 9 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v3 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261
2019-05-29 14:51 [Buildroot] [PATCH v3 0/3] treat gcc bug 63261 in a common way Giulio Benetti
@ 2019-05-29 14:51 ` Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 2/3] package/fxload: re-enable package on Microblaze Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 3/3] package/dmalloc: " Giulio Benetti
2 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2019-05-29 14:51 UTC (permalink / raw)
To: buildroot
GCC hangs while building fxload for the Microblaze Arch using following
defconfig:
'
BR2_microblazeel=y
BR2_OPTIMIZE_2=y
BR2_KERNEL_HEADERS_5_0=y
BR2_GCC_VERSION_7_X=y
BR2_PACKAGE_FXLOAD=y
'
Reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261
This bug has been fixed on Gcc 8.x.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
Changes:
V1->V2:
* add 'depends on BR2_ENABLE_DEBUG' to BR2_TOOLCHAIN_HAS_GCC_BUG_63261
V2->V3:
* remove 'depends on BR2_ENABLE_DEBUG' from BR2_TOOLCHAIN_HAS_GCC_BUG_63261
* modified commit log on defconfig section by removing
'BR2_ENABLE_DEBUG=y'
toolchain/Config.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 2d39ee4039..d01a96f8a8 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -113,6 +113,13 @@ config BR2_TOOLCHAIN_SUPPORTS_VARIADIC_MI_THUNK
depends on !BR2_or1k
depends on !BR2_xtensa
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261. This bug no
+# longer exists in gcc 8.x.
+config BR2_TOOLCHAIN_HAS_GCC_BUG_63261
+ bool
+ default y if BR2_microblaze
+ depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
+
# Prior to gcc 7.x, exception_ptr, nested_exception and future from
# libstdc++ would only be provided on architectures that support
# always lock-free atomic ints. See
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v3 2/3] package/fxload: re-enable package on Microblaze
2019-05-29 14:51 [Buildroot] [PATCH v3 0/3] treat gcc bug 63261 in a common way Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261 Giulio Benetti
@ 2019-05-29 14:51 ` Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 3/3] package/dmalloc: " Giulio Benetti
2 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2019-05-29 14:51 UTC (permalink / raw)
To: buildroot
With Microblaze Gcc version < 8.x build gives:
'Error: operation combines symbols in different segments'
This is due to bug 63261:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261. To avoid this, the
fxload package has a !BR2_microblaze dependency. However, gcc bug
63261 only triggers when optimization is enabled, so we can work
around the issue by passing -O0, which is what we do in other
Buildroot packages to work around this bug.
So, this commit passes -O0 when BR2_TOOLCHAIN_HAS_GCC_BUG_63261, and
re-enables fxload on Microblaze.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
package/fxload/Config.in | 4 ----
package/fxload/fxload.mk | 9 ++++++++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/package/fxload/Config.in b/package/fxload/Config.in
index 88cc6d1e5f..f4d6ef54f5 100644
--- a/package/fxload/Config.in
+++ b/package/fxload/Config.in
@@ -1,9 +1,5 @@
config BR2_PACKAGE_FXLOAD
bool "fxload"
- # Hits gcc PR63261 on Microblaze with debugging symbols
- # enabled. Since this package is unlikely to be useful on
- # Microblaze, just disable it on this architecture.
- depends on !BR2_microblaze
help
This program is conveniently able to download firmware into
FX, FX2, and FX2LP EZ-USB devices, as well as the original
diff --git a/package/fxload/fxload.mk b/package/fxload/fxload.mk
index 94b11d0f1e..23c513b1c0 100644
--- a/package/fxload/fxload.mk
+++ b/package/fxload/fxload.mk
@@ -9,8 +9,15 @@ FXLOAD_SITE = http://downloads.sourceforge.net/project/linux-hotplug/fxload/$(FX
FXLOAD_LICENSE = GPL-2.0+
FXLOAD_LICENSE_FILES = COPYING
+FXLOAD_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_63261),y)
+FXLOAD_CFLAGS += -O0
+endif
+
define FXLOAD_BUILD_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(FXLOAD_CFLAGS)" -C $(@D) all
endef
define FXLOAD_INSTALL_TARGET_CMDS
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v3 3/3] package/dmalloc: re-enable package on Microblaze
2019-05-29 14:51 [Buildroot] [PATCH v3 0/3] treat gcc bug 63261 in a common way Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261 Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 2/3] package/fxload: re-enable package on Microblaze Giulio Benetti
@ 2019-05-29 14:51 ` Giulio Benetti
2 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2019-05-29 14:51 UTC (permalink / raw)
To: buildroot
With Microblaze Gcc version < 8.x build gives:
'Error: operation combines symbols in different segments'
This is due to bug 63261:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261. To avoid this,
the dmalloc package has a !BR2_microblaze dependency. However, gcc bug
63261 only triggers when optimization is enabled, so we can work around
the issue by passing -O0, which is what we do in other Buildroot
packages to work around this bug.
So, this commit passes -O0 when BR2_TOOLCHAIN_HAS_GCC_BUG_63261, and
re-enables dmalloc on Microblaze.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
package/dmalloc/Config.in | 4 ----
package/dmalloc/dmalloc.mk | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/dmalloc/Config.in b/package/dmalloc/Config.in
index e5be109332..0c01970b04 100644
--- a/package/dmalloc/Config.in
+++ b/package/dmalloc/Config.in
@@ -1,9 +1,5 @@
config BR2_PACKAGE_DMALLOC
bool "dmalloc"
- # On some packages, Microblaze gcc has issues when debugging
- # symbols are enabled: "Error: operation combines symbols in
- # different segments".
- depends on !(BR2_microblaze && BR2_ENABLE_DEBUG)
help
A debug memory allocation library which is a drop in
replacement for the system's malloc, realloc, calloc, free and
diff --git a/package/dmalloc/dmalloc.mk b/package/dmalloc/dmalloc.mk
index 6ebb44c5c0..38b2c02027 100644
--- a/package/dmalloc/dmalloc.mk
+++ b/package/dmalloc/dmalloc.mk
@@ -35,6 +35,10 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
DMALLOC_CFLAGS += -marm
endif
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_63261),y)
+DMALLOC_CFLAGS += -O0
+endif
+
DMALLOC_CONF_ENV = CFLAGS="$(DMALLOC_CFLAGS)"
define DMALLOC_POST_PATCH
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-29 14:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 14:51 [Buildroot] [PATCH v3 0/3] treat gcc bug 63261 in a common way Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_63261 Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 2/3] package/fxload: re-enable package on Microblaze Giulio Benetti
2019-05-29 14:51 ` [Buildroot] [PATCH v3 3/3] package/dmalloc: " Giulio Benetti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.