All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/opencv: fix build with old glibc versions
@ 2017-05-27 11:52 Bernd Kuhls
  2017-05-27 15:16 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2017-05-27 11:52 UTC (permalink / raw
  To: buildroot

Prior to glibc 2.18, definitions like SIZE_MAX or INT_FAST32_MAX from
<stdint.h> were only made available for C code, or in C++ if
__STDC_LIMIT_MACROS was defined.

The code from jasper uses such definitions, without defining
__STDC_LIMIT_MACROS. Unfortunately, defining __STDC_LIMIT_MACROS in
the jasper headers doesn't work, since <stdint.h> has already been
included before, at a point where __STDC_LIMIT_MACROS was not defined.

So to solve this problem, we simply pass -D__STDC_LIMIT_MACROS in
CXXFLAGS when building opencv with jasper support.

This patch uses the same solution used for libraw:
https://git.buildroot.net/buildroot/commit/package/libraw?id=d246cf5fd01bb0d20a0e64194ffed514ea8dd0aa

Fixes:
http://autobuild.buildroot.net/results/095/095f7574afdb633c59a625cd063de03644b6d3a7/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/opencv/opencv.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/opencv/opencv.mk b/package/opencv/opencv.mk
index ff5ab02b1..92cfd431a 100644
--- a/package/opencv/opencv.mk
+++ b/package/opencv/opencv.mk
@@ -192,7 +192,8 @@ OPENCV_CONF_OPTS += -DWITH_GTK=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_JASPER),y)
-OPENCV_CONF_OPTS += -DWITH_JASPER=ON
+OPENCV_CONF_OPTS += -DWITH_JASPER=ON \
+	-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -D__STDC_LIMIT_MACROS"
 OPENCV_DEPENDENCIES += jasper
 else
 OPENCV_CONF_OPTS += -DWITH_JASPER=OFF
-- 
2.11.0

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

* [Buildroot] [PATCH 1/1] package/opencv: fix build with old glibc versions
  2017-05-27 11:52 [Buildroot] [PATCH 1/1] package/opencv: fix build with old glibc versions Bernd Kuhls
@ 2017-05-27 15:16 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-05-27 15:16 UTC (permalink / raw
  To: buildroot

Hello,

On Sat, 27 May 2017 13:52:37 +0200, Bernd Kuhls wrote:
> Prior to glibc 2.18, definitions like SIZE_MAX or INT_FAST32_MAX from
> <stdint.h> were only made available for C code, or in C++ if
> __STDC_LIMIT_MACROS was defined.
> 
> The code from jasper uses such definitions, without defining
> __STDC_LIMIT_MACROS. Unfortunately, defining __STDC_LIMIT_MACROS in
> the jasper headers doesn't work, since <stdint.h> has already been
> included before, at a point where __STDC_LIMIT_MACROS was not defined.
> 
> So to solve this problem, we simply pass -D__STDC_LIMIT_MACROS in
> CXXFLAGS when building opencv with jasper support.
> 
> This patch uses the same solution used for libraw:
> https://git.buildroot.net/buildroot/commit/package/libraw?id=d246cf5fd01bb0d20a0e64194ffed514ea8dd0aa
> 
> Fixes:
> http://autobuild.buildroot.net/results/095/095f7574afdb633c59a625cd063de03644b6d3a7/
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  package/opencv/opencv.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to master, thanks.

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

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

end of thread, other threads:[~2017-05-27 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-27 11:52 [Buildroot] [PATCH 1/1] package/opencv: fix build with old glibc versions Bernd Kuhls
2017-05-27 15:16 ` 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.