public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: torvalds@linux-foundation.org
Cc: akpm@linux-foundation.org, rmk+kernel@arm.linux.org.uk,
	adobriyan@gmail.com, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org
Subject: Re: hardirq.h removal broke sparc64 build...
Date: Wed, 07 Jan 2009 15:30:05 -0800 (PST)	[thread overview]
Message-ID: <20090107.153005.136649913.davem@davemloft.net> (raw)
In-Reply-To: <20090107145822.625960f2.akpm@linux-foundation.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 3103 bytes --]

From: Andrew Morton <akpm@linux-foundation.org>
Date: Wed, 7 Jan 2009 14:58:22 -0800

> On Wed, 07 Jan 2009 14:43:10 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
> 
> > I've spent most of last night and this morning trying to figure out
> > a way to fix this, it is very non-trivial.
> > 
> > Adding a simple asm/cpudata.h include into asm/topology_64.h for the
> > SMP case does not work.
> > 
> > asm/cpudata.h brings in percpu.h which wants SLAB which wants to use
> > GFP_* values and thus includes gfp.h
> > 
> > And thus because of the include loop:
 ...
> > we can't include asm/cpudata.h into asm/topology.h otherwise
> > we get:
 ...
> > for the drivers/base/topology.o build failure case above.
> 
> yes, there were some nasty problems like that.  In several cases we wimped
> out and added the necessary includes to the .c file.  Will that (sad hack)
> work here?

Ok, this works.

Linus, please apply, thanks!

topology: Fix sparc64 build.

Due to changeset ba84be2338d3a2b6020d39279335bb06fcd332e1
("remove linux/hardirq.h from asm-generic/local.h") the
sparc64 build started failing on drivers/base/topology.c:

drivers/base/topology.c: In function ‘show_physical_package_id’:
drivers/base/topology.c:103: error: implicit declaration of function ‘cpu_data’
drivers/base/topology.c:103: error: request for member ‘proc_id’ in something not a structure or union
drivers/base/topology.c: In function ‘show_core_id’:
drivers/base/topology.c:106: error: request for member ‘core_id’ in something not a structure or union

Adding the obvious fix of including asm/cpudata.h into
asm/topology.h on sparc64 doesn't fix it, in fact it
makes things worse because of the header file dependency
chain:

	linux/gfp.h --> linux/mmzone.h --> linux/topology.h -->
	asm/topology.h --> asm/cpudata.h --> linux/percpu.h -->
	linux/slab.h

which results in:

include/linux/slub_def.h: In function ‘kmalloc_large’:
include/linux/slub_def.h:209: error: implicit declaration of function ‘__get_free_pages’
include/linux/slub_def.h:209: error: ‘__GFP_COMP’ undeclared (first use in this function)
include/linux/slub_def.h:209: error: (Each undeclared identifier is reported only once
include/linux/slub_def.h:209: error: for each function it appears in.)
include/linux/slub_def.h:209: warning: cast to pointer from integer of different size

The simplest thing to do is to add yet another one-off hack like
parts of the guilty changeset did, by putting an explicit
linux/hardirq.h include into drivers/base/topology.c

Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index a8bc1cb..a778fb5 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -28,6 +28,7 @@
 #include <linux/mm.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
+#include <linux/hardirq.h>
 #include <linux/topology.h>
 
 #define define_one_ro(_name) 		\
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  parent reply	other threads:[~2009-01-07 23:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 22:43 hardirq.h removal broke sparc64 build David Miller
2009-01-07 22:58 ` Andrew Morton
2009-01-07 23:07   ` David Miller
2009-01-07 23:30   ` David Miller [this message]
2009-01-08  7:56 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090107.153005.136649913.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox