All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
@ 2016-08-25 17:01 Rahul Bedarkar
  2016-08-25 20:07 ` Samuel Martin
  2016-08-25 21:59 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Rahul Bedarkar @ 2016-08-25 17:01 UTC (permalink / raw)
  To: buildroot

domoticz.cpp currently assumes that on GNU/Linux systems header
<execinfo.h> is available. But that is not true. Since it provided by
C library and uClibc can be built without backtrace support. And in
such cases we get following build error.

  domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
   #include <execinfo.h>
                        ^
  compilation terminated.

This commit adds patch for detecting presence of <execinfo.h>
and guards code accordingly.

Fixes:

  http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
 ...per-check-for-detecting-header-execinfo.h.patch | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch

diff --git a/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
new file mode 100644
index 0000000..2e07abe
--- /dev/null
+++ b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
@@ -0,0 +1,61 @@
+From 5409696dfcbb05d6e4e67e74c97487b1987639e1 Mon Sep 17 00:00:00 2001
+From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
+Date: Thu, 25 Aug 2016 17:23:38 +0530
+Subject: [PATCH 1/1] add proper check for detecting header <execinfo.h>
+
+domoticz.cpp currently assumes that on GNU/Linux systems header
+<execinfo.h> is available. But that is not true. Since it provided by
+C library and uClibc can be built without backtrace support. And in
+such cases we get following build error.
+
+  domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
+   #include <execinfo.h>
+                        ^
+  compilation terminated.
+
+Instead of depending on __gnu_linux__, add check for detecting
+presence of <execinfo.h> and guard code for dumpstack accordingly.
+
+This build failure is detected by Buildroot autobuilder.
+http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/
+
+Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
+---
+ CMakeLists.txt    | 7 +++++++
+ main/domoticz.cpp | 2 +-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d3113f4..ef32f7b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,6 +61,13 @@ SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL
+   "Where to put the executables for Domoticz"
+   )
+ 
++INCLUDE(CheckIncludeFiles)
++CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
++
++IF(HAVE_EXECINFO_H)
++  ADD_DEFINITIONS(-DHAVE_EXECINFO_H)
++ENDIF(HAVE_EXECINFO_H)
++
+ #set(CMAKE_EXE_LINKER_FLAGS "-static")
+ 
+ # Macro for setting up precompiled headers. Usage:
+diff --git a/main/domoticz.cpp b/main/domoticz.cpp
+index 69d2ef6..c52e5ac 100644
+--- a/main/domoticz.cpp
++++ b/main/domoticz.cpp
+@@ -44,7 +44,7 @@
+ 	#include <string.h> 
+ #endif
+ 
+-#ifdef __gnu_linux__
++#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
+ static void dumpstack(void) {
+ 	// Notes :
+-- 
+2.6.2
+
-- 
2.6.2

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

* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
  2016-08-25 17:01 [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc Rahul Bedarkar
@ 2016-08-25 20:07 ` Samuel Martin
  2016-08-25 21:59 ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Martin @ 2016-08-25 20:07 UTC (permalink / raw)
  To: buildroot

Hi Rahul, all,

On Thu, Aug 25, 2016 at 7:01 PM, Rahul Bedarkar
<rahul.bedarkar@imgtec.com> wrote:
> domoticz.cpp currently assumes that on GNU/Linux systems header
> <execinfo.h> is available. But that is not true. Since it provided by
> C library and uClibc can be built without backtrace support. And in
> such cases we get following build error.
>
>   domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
>    #include <execinfo.h>
>                         ^
>   compilation terminated.
>
> This commit adds patch for detecting presence of <execinfo.h>
> and guards code accordingly.
>
> Fixes:
>
>   http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/
>
> Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
> ---
>  ...per-check-for-detecting-header-execinfo.h.patch | 61 ++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
>
> diff --git a/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
> new file mode 100644
> index 0000000..2e07abe
> --- /dev/null
> +++ b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
> @@ -0,0 +1,61 @@
> +From 5409696dfcbb05d6e4e67e74c97487b1987639e1 Mon Sep 17 00:00:00 2001
> +From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
> +Date: Thu, 25 Aug 2016 17:23:38 +0530
> +Subject: [PATCH 1/1] add proper check for detecting header <execinfo.h>
> +
> +domoticz.cpp currently assumes that on GNU/Linux systems header
> +<execinfo.h> is available. But that is not true. Since it provided by
> +C library and uClibc can be built without backtrace support. And in
> +such cases we get following build error.
> +
> +  domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
> +   #include <execinfo.h>
> +                        ^
> +  compilation terminated.
> +
> +Instead of depending on __gnu_linux__, add check for detecting
> +presence of <execinfo.h> and guard code for dumpstack accordingly.
> +
> +This build failure is detected by Buildroot autobuilder.
> +http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/
> +
> +Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
> +---
> + CMakeLists.txt    | 7 +++++++
> + main/domoticz.cpp | 2 +-
> + 2 files changed, 8 insertions(+), 1 deletion(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index d3113f4..ef32f7b 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -61,6 +61,13 @@ SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL
> +   "Where to put the executables for Domoticz"
> +   )
> +
> ++INCLUDE(CheckIncludeFiles)
> ++CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)

Since only 1 header is checked, CHECK_INCLUDE_FILE (from the
CheckIncludeFile module) could be used.
But this is nitpicking ;)

> ++
> ++IF(HAVE_EXECINFO_H)
> ++  ADD_DEFINITIONS(-DHAVE_EXECINFO_H)
> ++ENDIF(HAVE_EXECINFO_H)
> ++
> + #set(CMAKE_EXE_LINKER_FLAGS "-static")
> +
> + # Macro for setting up precompiled headers. Usage:
> +diff --git a/main/domoticz.cpp b/main/domoticz.cpp
> +index 69d2ef6..c52e5ac 100644
> +--- a/main/domoticz.cpp
> ++++ b/main/domoticz.cpp
> +@@ -44,7 +44,7 @@
> +       #include <string.h>
> + #endif
> +
> +-#ifdef __gnu_linux__
> ++#ifdef HAVE_EXECINFO_H
> + #include <execinfo.h>
> + static void dumpstack(void) {
> +       // Notes :
> +--
> +2.6.2
> +
> --
> 2.6.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Reviewed-by: Samuel Martin <s.martin49@gmail.com>

BTW, it'd be great to submit upstream this patch.

Regards,

-- 
Samuel

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

* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
  2016-08-25 17:01 [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc Rahul Bedarkar
  2016-08-25 20:07 ` Samuel Martin
@ 2016-08-25 21:59 ` Peter Korsgaard
  2016-08-26  8:56   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2016-08-25 21:59 UTC (permalink / raw)
  To: buildroot

>>>>> "Rahul" == Rahul Bedarkar <rahul.bedarkar@imgtec.com> writes:

 > domoticz.cpp currently assumes that on GNU/Linux systems header
 > <execinfo.h> is available. But that is not true. Since it provided by
 > C library and uClibc can be built without backtrace support. And in
 > such cases we get following build error.

 >   domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
 >    #include <execinfo.h>
 >                         ^
 >   compilation terminated.

 > This commit adds patch for detecting presence of <execinfo.h>
 > and guards code accordingly.

 > Fixes:

 >   http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/

 > Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
  2016-08-25 21:59 ` Peter Korsgaard
@ 2016-08-26  8:56   ` Thomas Petazzoni
  2016-08-26  9:02     ` Rahul Bedarkar
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-08-26  8:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 25 Aug 2016 23:59:00 +0200, Peter Korsgaard wrote:

>  > Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>  
> 
> Committed, thanks.

And actually I had to fix up the patch, because it was not applying
properly. See
https://git.buildroot.org/buildroot/commit/?id=397962ce1737ba0f920ffc1d3a3ea2bc08b28270
for all the details.

Rahul, did you actually test the patch? It didn't apply to the domoticz
source code extracted from the tarball, causing an immediate build
failure.

Thanks,

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

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

* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
  2016-08-26  8:56   ` Thomas Petazzoni
@ 2016-08-26  9:02     ` Rahul Bedarkar
  2016-08-26  9:27       ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Rahul Bedarkar @ 2016-08-26  9:02 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Friday 26 August 2016 02:26 PM, Thomas Petazzoni wrote:
> Hello,
>
> On Thu, 25 Aug 2016 23:59:00 +0200, Peter Korsgaard wrote:
>
>>   > Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
>>
>> Committed, thanks.
>
> And actually I had to fix up the patch, because it was not applying
> properly. See
> https://git.buildroot.org/buildroot/commit/?id=397962ce1737ba0f920ffc1d3a3ea2bc08b28270
> for all the details.
>
> Rahul, did you actually test the patch? It didn't apply to the domoticz
> source code extracted from the tarball, causing an immediate build
> failure.
>

Yes, I had tested patch. It was applied cleanly in my case. Not sure why 
it hasn't failed for me.

Thanks for fix.

Regards,
Rahul

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

* [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc
  2016-08-26  9:02     ` Rahul Bedarkar
@ 2016-08-26  9:27       ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2016-08-26  9:27 UTC (permalink / raw)
  To: buildroot

>>>>> "Rahul" == Rahul Bedarkar <Rahul.Bedarkar@imgtec.com> writes:

Hi,

 >> And actually I had to fix up the patch, because it was not applying
 >> properly. See
 >> https://git.buildroot.org/buildroot/commit/?id=397962ce1737ba0f920ffc1d3a3ea2bc08b28270
 >> for all the details.
 >> 
 >> Rahul, did you actually test the patch? It didn't apply to the domoticz
 >> source code extracted from the tarball, causing an immediate build
 >> failure.
 >> 

 > Yes, I had tested patch. It was applied cleanly in my case. Not sure
 > why it hasn't failed for me.

I think the dos newlines got dropped by patchwork. We had similar issues
in the past.

-- 
Venlig hilsen,
Peter Korsgaard 

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

end of thread, other threads:[~2016-08-26  9:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-25 17:01 [Buildroot] [PATCH 1/1] domoticz: fix build with uClibc Rahul Bedarkar
2016-08-25 20:07 ` Samuel Martin
2016-08-25 21:59 ` Peter Korsgaard
2016-08-26  8:56   ` Thomas Petazzoni
2016-08-26  9:02     ` Rahul Bedarkar
2016-08-26  9:27       ` Peter Korsgaard

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.