All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue
@ 2016-08-10 22:00 Thomas Petazzoni
  2016-08-10 22:00 ` [Buildroot] [PATCH 2/2] Revert "blktrace: disable on PowerPC" Thomas Petazzoni
  2016-08-11 13:04 ` [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-08-10 22:00 UTC (permalink / raw)
  To: buildroot

Both the blktrace and gadgetfs-test packages were failing to build on
PowerPC due to the mysterious:

  hidden symbol `_rest32gpr_30_x' in libgcc.a(e500crtresx32gpr.o) is referenced by DSO

Due to this error, we disabled blktrace on PowerPC in commit
0d8158fc619ce849b531d07b27da4ba9748d4ea4. However, gadgetfs-test
continued to fail with the same error. As Romain Naour pointed out, the
problem seems in fact to come from a common dependency of blktrace and
gadgetfs-test: libaio. As Romain investigated, the problem started
appearing after the last bump of libaio, from version 0.3.109 to
0.3.110.

A quick bisect through the libaio changes between 0.3.109 and 0.3.110
has revealed that the problematic change is one in the libaio build
system, which now obeys to the CFLAGS provided in the environment,
rather than overriding them. So the CFLAGS provided by Buildroot cause
this problem. It turns out that the problematic CFLAGS is -Os, which is
indeed known to cause issues on PowerPC in some corner cases.

Even though it would probably be a better long-term solution to switch
to -O2 by default, and mark -Os as not available on PowerPC, it is a too
radical change so close to 2016.08. So we simply adjust the libaio
package so that it uses -O2 instead of -Os.

Fixes:

  http://autobuild.buildroot.net/results/5e6cc4c432ce6c964ac285026978ad14d9eae97c/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/libaio/libaio.mk | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/package/libaio/libaio.mk b/package/libaio/libaio.mk
index 9b28f05..0854fc5 100644
--- a/package/libaio/libaio.mk
+++ b/package/libaio/libaio.mk
@@ -11,16 +11,24 @@ LIBAIO_INSTALL_STAGING = YES
 LIBAIO_LICENSE = LGPLv2.1+
 LIBAIO_LICENSE_FILES = COPYING
 
+LIBAIO_CONFIGURE_OPTS = $(TARGET_CONFIGURE_OPTS)
+
+# On PowerPC, a weird toolchain issue causes -Os builds to produce
+# references to hidden symbols, so we're forcing -O2
+ifeq ($(BR2_powerpc),y)
+LIBAIO_CONFIGURE_OPTS += CFLAGS="$(subst -Os,-O2,$(TARGET_CFLAGS))"
+endif
+
 define LIBAIO_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+	$(LIBAIO_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
 define LIBAIO_INSTALL_STAGING_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+	$(LIBAIO_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
 endef
 
 define LIBAIO_INSTALL_TARGET_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+	$(LIBAIO_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
 endef
 
 $(eval $(generic-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 2/2] Revert "blktrace: disable on PowerPC"
  2016-08-10 22:00 [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni
@ 2016-08-10 22:00 ` Thomas Petazzoni
  2016-08-11 13:04 ` [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-08-10 22:00 UTC (permalink / raw)
  To: buildroot

This reverts commit 0d8158fc619ce849b531d07b27da4ba9748d4ea4. Thanks to
a fix in libaio, blktrace now builds fine on PowerPC, so there's no
reason to disable it anymore.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/blktrace/Config.in | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/package/blktrace/Config.in b/package/blktrace/Config.in
index 1b8212d..c17de80 100644
--- a/package/blktrace/Config.in
+++ b/package/blktrace/Config.in
@@ -3,8 +3,6 @@ config BR2_PACKAGE_BLKTRACE
 	# Uses posix_spawn()
 	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS
-	# issue: hidden symbol `_rest32gpr_30_x` is referenced by DSO
-	depends on !BR2_powerpc
 	select BR2_PACKAGE_LIBAIO
 	help
 	  blktrace is a block layer IO tracing mechanism which provides
@@ -15,5 +13,4 @@ config BR2_PACKAGE_BLKTRACE
 
 comment "blktrace needs a glibc or musl toolchain"
 	depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS
-	depends on !BR2_powerpc
 	depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue
  2016-08-10 22:00 [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni
  2016-08-10 22:00 ` [Buildroot] [PATCH 2/2] Revert "blktrace: disable on PowerPC" Thomas Petazzoni
@ 2016-08-11 13:04 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-08-11 13:04 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 11 Aug 2016 00:00:52 +0200, Thomas Petazzoni wrote:
> Both the blktrace and gadgetfs-test packages were failing to build on
> PowerPC due to the mysterious:
> 
>   hidden symbol `_rest32gpr_30_x' in libgcc.a(e500crtresx32gpr.o) is referenced by DSO
> 
> Due to this error, we disabled blktrace on PowerPC in commit
> 0d8158fc619ce849b531d07b27da4ba9748d4ea4. However, gadgetfs-test
> continued to fail with the same error. As Romain Naour pointed out, the
> problem seems in fact to come from a common dependency of blktrace and
> gadgetfs-test: libaio. As Romain investigated, the problem started
> appearing after the last bump of libaio, from version 0.3.109 to
> 0.3.110.
> 
> A quick bisect through the libaio changes between 0.3.109 and 0.3.110
> has revealed that the problematic change is one in the libaio build
> system, which now obeys to the CFLAGS provided in the environment,
> rather than overriding them. So the CFLAGS provided by Buildroot cause
> this problem. It turns out that the problematic CFLAGS is -Os, which is
> indeed known to cause issues on PowerPC in some corner cases.
> 
> Even though it would probably be a better long-term solution to switch
> to -O2 by default, and mark -Os as not available on PowerPC, it is a too
> radical change so close to 2016.08. So we simply adjust the libaio
> package so that it uses -O2 instead of -Os.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/5e6cc4c432ce6c964ac285026978ad14d9eae97c/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/libaio/libaio.mk | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)

Both patches applied.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-11 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10 22:00 [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni
2016-08-10 22:00 ` [Buildroot] [PATCH 2/2] Revert "blktrace: disable on PowerPC" Thomas Petazzoni
2016-08-11 13:04 ` [Buildroot] [PATCH 1/2] libaio: work-around for PowerPC issue Thomas Petazzoni

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.