2007-09-18 15:14:59

by Philipp Marek

[permalink] [raw]
Subject: UML dead with current -git?

Hello everybody,

I'm trying to build a UML machine on x86-64 (config attached)
but I'm getting compile errors.


What am I doing wrong?

make allnoconfig ARCH=um
make menuconfig ARCH=um
selected a few options
make -j 5 ARCH=um
..
include/linux/jiffies.h:225:31: error: division by zero in #if
include/linux/jiffies.h:225:46: warning: "SHIFT_HZ" is not defined
In file included from arch/um/include/sysdep/kernel-offsets.h:2,
from arch/um/kernel/asm-offsets.c:1:
include/linux/sched.h: In function 'dequeue_signal_lock':
include/linux/sched.h:1506: error: implicit declaration of function 'local_irq_save'
include/linux/sched.h:1508: error: implicit declaration of function 'local_irq_restore'
In file included from include/linux/crypto.h:21,
from arch/um/include/sysdep/kernel-offsets.h:5,
from arch/um/kernel/asm-offsets.c:1:
include/linux/module.h: At top level:
include/linux/module.h:222: error: requested alignment is not a constant
In file included from arch/um/kernel/asm-offsets.c:1:
arch/um/include/sysdep/kernel-offsets.h:25:29: error: asm/arch/unistd.h: No such file or directory
In file included from arch/um/include/sysdep/kernel-offsets.h:30,
from arch/um/kernel/asm-offsets.c:1:
arch/um/include/common-offsets.h: In function 'foo':
arch/um/include/common-offsets.h:8: error: 'struct thread_struct' has no member named 'regs'
make[1]: *** [arch/um/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2


Thank you for all help.


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!


Attachments:
(No filename) (1.62 kB)
build.txt (6.31 kB)
make output
.config (6.61 kB)
Download all attachments

2007-09-18 17:13:42

by Jeff Dike

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Tue, Sep 18, 2007 at 05:14:33PM +0200, Philipp Marek wrote:
> I'm trying to build a UML machine on x86-64 (config attached)
> but I'm getting compile errors.

Builds for me. Did you start with an mrproper? These errors look
like the UML build getting confused by left-overs from an x86_64
build.

Jeff

--
Work email - jdike at linux dot intel dot com

2007-09-18 17:54:00

by Sam Ravnborg

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Tue, Sep 18, 2007 at 01:13:13PM -0400, Jeff Dike wrote:
> On Tue, Sep 18, 2007 at 05:14:33PM +0200, Philipp Marek wrote:
> > I'm trying to build a UML machine on x86-64 (config attached)
> > but I'm getting compile errors.
>
> Builds for me. Did you start with an mrproper? These errors look
> like the UML build getting confused by left-overs from an x86_64
> build.
Sounds to me like a known issue by you. Can you give a few more details
so we maybe can get it fixed?

Sam

2007-09-18 18:10:21

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Tuesday 18 September 2007 Jeff Dike wrote:
> On Tue, Sep 18, 2007 at 05:14:33PM +0200, Philipp Marek wrote:
> > I'm trying to build a UML machine on x86-64 (config attached)
> > but I'm getting compile errors.
>
> Builds for me. Did you start with an mrproper? These errors look
> like the UML build getting confused by left-overs from an x86_64
> build.
No, I didn't. Shouldn't that get cleaned up by a (completely new) config
anyway?

I'll try and tell you tomorrow.


Thank you!


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-19 01:35:35

by Jeff Dike

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Tue, Sep 18, 2007 at 07:55:13PM +0200, Sam Ravnborg wrote:
> Sounds to me like a known issue by you. Can you give a few more details
> so we maybe can get it fixed?

I believe what happened here is an x86_64 build followed by a
UML/x86_64 build with no intervening mrproper.

I've always considered this to be a "don't do that" sort of thing.
However, maybe we could stick the arch of the current build somewhere
in the tree, check that before any serious part of a subsequent
build, and error out if $ARCH is different.

Jeff

--
Work email - jdike at linux dot intel dot com

2007-09-19 12:43:39

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Wednesday 19 September 2007 Jeff Dike wrote:
> On Tue, Sep 18, 2007 at 07:55:13PM +0200, Sam Ravnborg wrote:
> > Sounds to me like a known issue by you. Can you give a few more details
> > so we maybe can get it fixed?
> I believe what happened here is an x86_64 build followed by a
> UML/x86_64 build with no intervening mrproper.
Yes, after a "make mrproper" it compiles fine.
However, the .config is gone afterwards ...

> I've always considered this to be a "don't do that" sort of thing.
> However, maybe we could stick the arch of the current build somewhere
> in the tree, check that before any serious part of a subsequent
> build, and error out if $ARCH is different.
Well, on this line it may be nice to be able to put the target architecture
somewhere ...
make mrproper
make menuconfig ARCH=um
make ARCH=um
... some tweaking
make menuconfig
and the .config is overwritten with the "wrong" architecture.
(I know about .config.bak and so on ... just a small wish)


Thank you!


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-19 15:51:51

by Randy Dunlap

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Wed, 19 Sep 2007 14:43:23 +0200 Philipp Marek wrote:

> On Wednesday 19 September 2007 Jeff Dike wrote:
> > On Tue, Sep 18, 2007 at 07:55:13PM +0200, Sam Ravnborg wrote:
> > > Sounds to me like a known issue by you. Can you give a few more details
> > > so we maybe can get it fixed?
> > I believe what happened here is an x86_64 build followed by a
> > UML/x86_64 build with no intervening mrproper.
> Yes, after a "make mrproper" it compiles fine.
> However, the .config is gone afterwards ...
>
> > I've always considered this to be a "don't do that" sort of thing.
> > However, maybe we could stick the arch of the current build somewhere
> > in the tree, check that before any serious part of a subsequent
> > build, and error out if $ARCH is different.
> Well, on this line it may be nice to be able to put the target architecture
> somewhere ...
> make mrproper
> make menuconfig ARCH=um
> make ARCH=um
> ... some tweaking
> make menuconfig
> and the .config is overwritten with the "wrong" architecture.
> (I know about .config.bak and so on ... just a small wish)

Yes, I've tried to coerce the top-level Makefile into honoring/using
the include/asm symlink if it exists, i.e., taking ARCH from
readlink include/asm && sed -e 's/include-asm//', but sadly my
makefile foo was not good enough.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2007-09-19 16:18:44

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?

Hello Randy!

On Wednesday 19 September 2007 Randy Dunlap wrote:
> Yes, I've tried to coerce the top-level Makefile into honoring/using
> the include/asm symlink if it exists, i.e., taking ARCH from
> readlink include/asm && sed -e 's/include-asm//', but sadly my
> makefile foo was not good enough.
How about that?
readlink include/asm
returns
asm-um
in my case, so I only have to strip the "asm-" part ...


Regards,

Phil


diff --git a/Makefile b/Makefile
index e0fdf49..c9284ba 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ )

+# sadly perl is defined below ... so we can't use it here, can we?
+ASMARCH := $(shell test -s include/asm && readlink include/asm | cut -f2 -d-)
+
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
@@ -182,7 +185,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

-ARCH ?= $(SUBARCH)
+ARCH ?= $(or $(SUBARCH), $(ASMARCH))
CROSS_COMPILE ?=

# Architecture as present in compile.h


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-19 18:06:52

by Jeff Dike

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Wed, Sep 19, 2007 at 06:17:51PM +0200, Philipp Marek wrote:
> How about that?
> readlink include/asm
> returns
> asm-um
> in my case, so I only have to strip the "asm-" part ...

It doesn't handle O= directories...

Jeff

--
Work email - jdike at linux dot intel dot com

2007-09-19 20:28:19

by Randy Dunlap

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Wed, 19 Sep 2007 18:17:51 +0200 Philipp Marek wrote:

> Hello Randy!
>
> On Wednesday 19 September 2007 Randy Dunlap wrote:
> > Yes, I've tried to coerce the top-level Makefile into honoring/using
> > the include/asm symlink if it exists, i.e., taking ARCH from
> > readlink include/asm && sed -e 's/include-asm//', but sadly my
> > makefile foo was not good enough.
> How about that?
> readlink include/asm
> returns
> asm-um
> in my case, so I only have to strip the "asm-" part ...
>
>
> Regards,
>
> Phil
>
>
> diff --git a/Makefile b/Makefile
> index e0fdf49..c9284ba 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -163,6 +163,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
> -e s/s390x/s390/ -e s/parisc64/parisc/ \
> -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
>
> +# sadly perl is defined below ... so we can't use it here, can we?
> +ASMARCH := $(shell test -s include/asm && readlink include/asm | cut -f2 -d-)
> +
> # Cross compiling and selecting different set of gcc/bin-utils
> # ---------------------------------------------------------------------------
> #
> @@ -182,7 +185,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
> # Default value for CROSS_COMPILE is not to prefix executables
> # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
>
> -ARCH ?= $(SUBARCH)
> +ARCH ?= $(or $(SUBARCH), $(ASMARCH))
> CROSS_COMPILE ?=
>
> # Architecture as present in compile.h
>
>
> --

This doesn't work when there is no include/asm symlink.

It also didn't apply cleanly due to tab(s) being converted
to spaces (but of course I fixed that part).

---
~Randy

2007-09-20 05:45:16

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?

Hello Jeff,

> On Wed, Sep 19, 2007 at 06:17:51PM +0200, Philipp Marek wrote:
>> How about that?
>> readlink include/asm
>> returns
>> asm-um
>> in my case, so I only have to strip the "asm-" part ...
>
> It doesn't handle O= directories...
Sorry, I don't understand you. What are "0=" directories? Do you mean that
if there's no include/ directory?


Well, I guess that there are non-obvious corner cases in the include/asm
symlink usage, that amateurs simply do not know ...


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-20 05:48:25

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?

Hello Randy!

> This doesn't work when there is no include/asm symlink.
Why? I specifically test for that, and tried it on my machine.
What's the bug?
ASMARCH should come out empty, and the ?= and $(or) should take care of
the rest ...

> It also didn't apply cleanly due to tab(s) being converted
> to spaces (but of course I fixed that part).
Yes, sorry. I'll try to attach inline next time.


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-20 07:00:28

by Sam Ravnborg

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Thu, Sep 20, 2007 at 07:44:49AM +0200, Ph. Marek wrote:
> Hello Jeff,
>
> > On Wed, Sep 19, 2007 at 06:17:51PM +0200, Philipp Marek wrote:
> >> How about that?
> >> readlink include/asm
> >> returns
> >> asm-um
> >> in my case, so I only have to strip the "asm-" part ...
> >
> > It doesn't handle O= directories...
> Sorry, I don't understand you. What are "0=" directories?

When building a kernel you can specify an other output directory
so you do not mix up your source tree with generated files.
To do so do like this:

Prepare the stuff:
mkdir ~/kernel
cp .config ~/kernel
make mrproper

And then build the kernel:
make O=~/kernel


Sam

2007-09-20 07:26:05

by Philipp Marek

[permalink] [raw]
Subject: Re: UML dead with current -git?


>> > It doesn't handle O= directories...
>> Sorry, I don't understand you. What are "0=" directories?
>
> When building a kernel you can specify an other output directory
> so you do not mix up your source tree with generated files.
> To do so do like this:
>
> Prepare the stuff:
> mkdir ~/kernel
> cp .config ~/kernel
> make mrproper
>
> And then build the kernel:
> make O=~/kernel
Oh yes ... thats the character 'o', not the number zero ...
Sorry, changing the font shows that :-)


Yes, that's right. Wouldn't $(srctree) help? That's defined just above, so
should be fine.


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
Try fsvs (fsvs.tigris.org)!

2007-09-20 08:25:43

by Sam Ravnborg

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Thu, Sep 20, 2007 at 09:25:38AM +0200, Philipp Marek wrote:
>
> >> > It doesn't handle O= directories...
> >> Sorry, I don't understand you. What are "0=" directories?
> >
> > When building a kernel you can specify an other output directory
> > so you do not mix up your source tree with generated files.
> > To do so do like this:
> >
> > Prepare the stuff:
> > mkdir ~/kernel
> > cp .config ~/kernel
> > make mrproper
> >
> > And then build the kernel:
> > make O=~/kernel
> Oh yes ... thats the character 'o', not the number zero ...
> Sorry, changing the font shows that :-)
>
>
> Yes, that's right. Wouldn't $(srctree) help? That's defined just above, so
> should be fine.
We want a solution that:
- Always use the same ARCH as before
- Error out if user specify another ARCH
- Tell what ARCH is used to user

I will inspired by yprs and other patches try to cook up something.
Hopefully my make-foo suffice.

Sam

2007-09-20 16:36:18

by Randy Dunlap

[permalink] [raw]
Subject: Re: UML dead with current -git?

On Thu, 20 Sep 2007 07:42:38 +0200 (CEST) Ph. Marek wrote:

> Hello Randy!
>
> > This doesn't work when there is no include/asm symlink.
> Why? I specifically test for that, and tried it on my machine.
> What's the bug?
> ASMARCH should come out empty, and the ?= and $(or) should take care of
> the rest ...

Sorry, I can't reproduce it now.
The variable was coming out empty though. I saw path strings like
linux-2.6.23-rc6/arch//Makefile

Hopefully Sam can fix it all up. :)

> > It also didn't apply cleanly due to tab(s) being converted
> > to spaces (but of course I fixed that part).
> Yes, sorry. I'll try to attach inline next time.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***