diff mbox series

[15/27] package/flann: re-enable package on microblaze

Message ID 20190614210346.121013-16-giulio.benetti@micronovasrl.com
State Accepted
Headers show
Series [01/27] package/keyutils: re-enable package on microblaze | expand

Commit Message

Giulio Benetti June 14, 2019, 9:03 p.m. UTC
With Microblaze Gcc version <= 9.x build fails tue to bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. To avoid this, the
flann package has a !BR2_microblaze dependency. However, gcc bug 68485
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_68485, and
re-enables flann on Microblaze.

Note that the comment was talking about gcc bug 69401, but this gcc
bug is a duplicate of 68485. Since all Buildroot packages now use the
reference to gcc bug 68485 and the option is named
BR2_TOOLCHAIN_HAS_GCC_BUG_68485, we use this naming as well for
flann.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 package/flann/Config.in | 4 ----
 package/flann/flann.mk  | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Thomas Petazzoni June 19, 2019, 7:53 p.m. UTC | #1
On Fri, 14 Jun 2019 23:03:34 +0200
Giulio Benetti <giulio.benetti@micronovasrl.com> wrote:

> With Microblaze Gcc version <= 9.x build fails tue to bug 68485:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. To avoid this, the
> flann package has a !BR2_microblaze dependency. However, gcc bug 68485
> 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_68485, and
> re-enables flann on Microblaze.
> 
> Note that the comment was talking about gcc bug 69401, but this gcc
> bug is a duplicate of 68485. Since all Buildroot packages now use the
> reference to gcc bug 68485 and the option is named
> BR2_TOOLCHAIN_HAS_GCC_BUG_68485, we use this naming as well for
> flann.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> ---
>  package/flann/Config.in | 4 ----
>  package/flann/flann.mk  | 4 ++++
>  2 files changed, 4 insertions(+), 4 deletions(-)

I've applied to master, after changing the implementation to use a
FLANN_CXXFLAGS variable.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/flann/Config.in b/package/flann/Config.in
index a2cd50c867..3725fc784f 100644
--- a/package/flann/Config.in
+++ b/package/flann/Config.in
@@ -2,9 +2,6 @@  config BR2_PACKAGE_FLANN
 	bool "flann"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on !BR2_STATIC_LIBS
-	# all gcc versions fail to build flann on Microblaze due to
-	# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69401
-	depends on !BR2_microblaze
 	help
 	  FLANN is a library for performing fast approximate nearest
 	  neighbor searches in high dimensional spaces. It contains a
@@ -25,5 +22,4 @@  config BR2_PACKAGE_FLANN_EXAMPLES
 endif
 
 comment "flann needs a toolchain w/ C++, dynamic library"
-	depends on !BR2_microblaze
 	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS
diff --git a/package/flann/flann.mk b/package/flann/flann.mk
index d091ec18a0..b57a6d5f9b 100644
--- a/package/flann/flann.mk
+++ b/package/flann/flann.mk
@@ -18,4 +18,8 @@  FLANN_CONF_OPTS = \
 	-DPYTHON_EXECUTABLE=OFF \
 	-DCMAKE_DISABLE_FIND_PACKAGE_HDF5=TRUE
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+FLANN_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -O0"
+endif
+
 $(eval $(cmake-package))