diff mbox

[1/1] trace-cmd: overwrite CFLAGS

Message ID 526D9ED3.4000401@openwide.fr
State Accepted
Headers show

Commit Message

Romain Naour Oct. 27, 2013, 11:16 p.m. UTC
Ptrace support detection is ignored when CFLAGS is set by buildroot.

Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
if ptrace is not available.

Fixes:
http://autobuild.buildroot.net/results/60e/60ed317d52d93ba2c087aa6ff4f422d760806d89//

Signed-off-by: Romain <romain.naour@openwide.fr>
---
  .../trace-cmd-0002-Makefile-overwrite-CFLAGS.patch | 33 
++++++++++++++++++++++
  1 file changed, 33 insertions(+)
  create mode 100644 
package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch

+

Comments

Arnout Vandecappelle Oct. 29, 2013, 5:05 p.m. UTC | #1
On 28/10/13 00:16, Romain Naour wrote:
>
> Ptrace support detection is ignored when CFLAGS is set by buildroot.
>
> Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
> if ptrace is not available.
>
> Fixes:
> http://autobuild.buildroot.net/results/60e/60ed317d52d93ba2c087aa6ff4f422d760806d89//
>
>
> Signed-off-by: Romain <romain.naour@openwide.fr>

  Looks good, but I didn't test it.

  However, we should also add NO_PTRACE to TRACE_CMD_MAKE_OPTS if 
BR2_PACKAGE_PTRACE is not selected, and add ptrace to the dependencies if 
it is.

  Regards,
  Arnout

> ---
>   .../trace-cmd-0002-Makefile-overwrite-CFLAGS.patch | 33
> ++++++++++++++++++++++
>   1 file changed, 33 insertions(+)
>   create mode 100644
> package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
>
> diff --git
> a/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
> b/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
> new file mode 100644
> index 0000000..f4afa53
> --- /dev/null
> +++ b/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
> @@ -0,0 +1,33 @@
> +
> +Ptrace support detection is ignored when CFLAGS is set in command
> arguments.
> +
> +Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
> +if ptrace is not available.
> +
> +Signed-off-by: Romain <romain.naour@openwide.fr>
> +---
> + Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 2f862ec..51b0df3 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -229,12 +229,12 @@ CFLAGS += -D_GNU_SOURCE
> + ifndef NO_PTRACE
> + ifneq ($(call try-cc,$(SOURCE_PTRACE),),y)
> +     NO_PTRACE = 1
> +-    CFLAGS += -DWARN_NO_PTRACE
> ++    override CFLAGS += -DWARN_NO_PTRACE
> + endif
> + endif
> +
> + ifdef NO_PTRACE
> +-CFLAGS += -DNO_PTRACE
> ++override CFLAGS += -DNO_PTRACE
> + endif
> +
> + # Append required CFLAGS
> +--
> +1.8.1.4
> +
Thomas Petazzoni Oct. 30, 2013, 8:08 a.m. UTC | #2
Dear Arnout Vandecappelle,

On Tue, 29 Oct 2013 18:05:20 +0100, Arnout Vandecappelle wrote:

>   However, we should also add NO_PTRACE to TRACE_CMD_MAKE_OPTS if 
> BR2_PACKAGE_PTRACE is not selected, and add ptrace to the dependencies if 
> it is.

Huh? ptrace is not a package, it's a libc function. See man ptrace(2).

Thomas
Arnout Vandecappelle Oct. 30, 2013, 12:07 p.m. UTC | #3
On 30/10/13 09:08, Thomas Petazzoni wrote:
> Dear Arnout Vandecappelle,
>
> On Tue, 29 Oct 2013 18:05:20 +0100, Arnout Vandecappelle wrote:
>
>>    However, we should also add NO_PTRACE to TRACE_CMD_MAKE_OPTS if
>> BR2_PACKAGE_PTRACE is not selected, and add ptrace to the dependencies if
>> it is.
>
> Huh? ptrace is not a package, it's a libc function. See man ptrace(2).

  D'oh!

  Regards,
  Arnout
Thomas Petazzoni Oct. 30, 2013, 9:45 p.m. UTC | #4
Dear Romain Naour,

On Mon, 28 Oct 2013 00:16:35 +0100, Romain Naour wrote:
> 
> Ptrace support detection is ignored when CFLAGS is set by buildroot.
> 
> Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
> if ptrace is not available.
> 
> Fixes:
> http://autobuild.buildroot.net/results/60e/60ed317d52d93ba2c087aa6ff4f422d760806d89//
> 
> Signed-off-by: Romain <romain.naour@openwide.fr>

Applied to for-peter-2013.11, thanks. However, your patch was badly
line-wrapped. Could you use 'git send-email' for your next patches,
instead of Thunderbird?

Thanks!

Thomas
Romain Naour Oct. 31, 2013, 5:26 p.m. UTC | #5
Hi,
Le 30/10/2013 22:45, Thomas Petazzoni a écrit :
> Dear Romain Naour,
>
> On Mon, 28 Oct 2013 00:16:35 +0100, Romain Naour wrote:
>> Ptrace support detection is ignored when CFLAGS is set by buildroot.
>>
>> Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
>> if ptrace is not available.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/60e/60ed317d52d93ba2c087aa6ff4f422d760806d89//
>>
>> Signed-off-by: Romain <romain.naour@openwide.fr>
> Applied to for-peter-2013.11, thanks. However, your patch was badly
> line-wrapped. Could you use 'git send-email' for your next patches,
> instead of Thunderbird?
>
Sorry for that, I will use git send-email for my next patch :)

Thanks !
Romain
diff mbox

Patch

diff --git 
a/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch 
b/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
new file mode 100644
index 0000000..f4afa53
--- /dev/null
+++ b/package/trace-cmd/trace-cmd-0002-Makefile-overwrite-CFLAGS.patch
@@ -0,0 +1,33 @@ 
+
+Ptrace support detection is ignored when CFLAGS is set in command 
arguments.
+
+Use override in Makefile to add -DWARN_NO_PTRACE and -DNO_PTRACE in CFLAGS
+if ptrace is not available.
+
+Signed-off-by: Romain <romain.naour@openwide.fr>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 2f862ec..51b0df3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -229,12 +229,12 @@ CFLAGS += -D_GNU_SOURCE
+ ifndef NO_PTRACE
+ ifneq ($(call try-cc,$(SOURCE_PTRACE),),y)
+     NO_PTRACE = 1
+-    CFLAGS += -DWARN_NO_PTRACE
++    override CFLAGS += -DWARN_NO_PTRACE
+ endif
+ endif
+
+ ifdef NO_PTRACE
+-CFLAGS += -DNO_PTRACE
++override CFLAGS += -DNO_PTRACE
+ endif
+
+ # Append required CFLAGS
+--
+1.8.1.4