mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix compilation on powerpc
@ 2009-11-24  4:19 Paul Mackerras
  2009-11-24 16:54 ` [tip:perf/core] " tip-bot for Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2009-11-24  4:19 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: linux-kernel, Frederic Weisbecker, Arnaldo Carvalho de Melo

Currently, perf fails to compile on powerpc with this error:

    CC util/header.o
In file included from util/../perf.h:17,
                 from util/header.c:9:
util/../../../arch/powerpc/include/asm/unistd.h:360:27: error: linux/linkage.h: No such file or directory
make: *** [util/header.o] Error 1

The reason is that we still have a #define __KERNEL__ in effect at the
point where <asm/unistd.h> gets included, which means we get extra
stuff that we don't need or want.

This fixes the problem by undefining __KERNEL__ once we have included
the file for which we need __KERNEL__ defined.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 tools/perf/util/include/linux/bitops.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h
index ace57c3..8d63116 100644
--- a/tools/perf/util/include/linux/bitops.h
+++ b/tools/perf/util/include/linux/bitops.h
@@ -7,6 +7,8 @@
 #define CONFIG_GENERIC_FIND_FIRST_BIT
 #include "../../../../include/linux/bitops.h"
 
+#undef __KERNEL__
+
 static inline void set_bit(int nr, unsigned long *addr)
 {
 	addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);

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

end of thread, other threads:[~2009-11-24 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24  4:19 [PATCH] perf tools: Fix compilation on powerpc Paul Mackerras
2009-11-24 16:54 ` [tip:perf/core] " tip-bot for Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®