linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace
@ 2012-09-04  0:53 Yoshihiro YUNOMAE
  2012-09-04  6:04 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro YUNOMAE @ 2012-09-04  0:53 UTC (permalink / raw)
  To: Rusty Russell, linux-kernel
  Cc: Amit Shah, Masami Hiramatsu, Steven Rostedt, yrl.pp-manager.tt,
	Yoshihiro YUNOMAE

pthread flag should not be -lpthread but -pthread using gcc. The -lpthread
links the external multithread library. On the other hand, the -pthread manages
both the gcc's preprocessor and linker to be able to compile with pthread.

Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
---

 tools/virtio/virtio-trace/Makefile |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/virtio/virtio-trace/Makefile b/tools/virtio/virtio-trace/Makefile
index ef3adfc..0d23816 100644
--- a/tools/virtio/virtio-trace/Makefile
+++ b/tools/virtio/virtio-trace/Makefile
@@ -1,14 +1,13 @@
 CC = gcc
-CFLAGS = -O2 -Wall
-LFLAG = -lpthread
+CFLAGS = -O2 -Wall -pthread
 
 all: trace-agent
 
 .c.o:
-	$(CC) $(CFLAGS) $(LFLAG) -c $^ -o $@
+	$(CC) $(CFLAGS) -c $^ -o $@
 
 trace-agent: trace-agent.o trace-agent-ctl.o trace-agent-rw.o
-	$(CC) $(CFLAGS) $(LFLAG) -o $@ $^
+	$(CC) $(CFLAGS) -o $@ $^
 
 clean:
 	rm -f *.o trace-agent


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

* Re: [PATCH] tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace
  2012-09-04  0:53 [PATCH] tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace Yoshihiro YUNOMAE
@ 2012-09-04  6:04 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2012-09-04  6:04 UTC (permalink / raw)
  To: Yoshihiro YUNOMAE, linux-kernel
  Cc: Amit Shah, Masami Hiramatsu, Steven Rostedt, yrl.pp-manager.tt,
	Yoshihiro YUNOMAE

Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com> writes:

> pthread flag should not be -lpthread but -pthread using gcc. The -lpthread
> links the external multithread library. On the other hand, the -pthread manages
> both the gcc's preprocessor and linker to be able to compile with pthread.
>
> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>

Applied.

Thanks,
Rusty.

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

end of thread, other threads:[~2012-09-04 23:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04  0:53 [PATCH] tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace Yoshihiro YUNOMAE
2012-09-04  6:04 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).