* kvmtool : [PATCH] PowerPc : Fix compilation for ppc64
@ 2013-04-09 17:29 Prerna Saxena
2013-04-10 6:44 ` Pekka Enberg
0 siblings, 1 reply; 4+ messages in thread
From: Prerna Saxena @ 2013-04-09 17:29 UTC (permalink / raw)
To: kvm
'lkvm' compilation on ppc64 fails with the following error :
...[snip]..
LINK guest/init
LINK lkvm
/usr/bin/ld: powerpc:common architecture of input file `guest/guest_init.o'
is incompatible with powerpc:common64 output
collect2: ld returned 1 exit status
make: *** [lkvm] Error 1
This patch corrects the error above, and enables 'lkvm' to compile on ppc64
architecture.
Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
---
tools/kvm/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index 0c59faa..269e29e 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -335,7 +335,11 @@ $(PROGRAM_ALIAS): $(PROGRAM)
$(GUEST_INIT): guest/init.c
$(E) " LINK " $@
$(Q) $(CC) -static guest/init.c -o $@
+ifeq ($(ARCH), powerpc)
+ $(Q) $(LD) -r -b binary --oformat elf64-powerpc -o guest/guest_init.o $(GUEST_INIT)
+else
$(Q) $(LD) -r -b binary -o guest/guest_init.o $(GUEST_INIT)
+endif
$(DEPS):
--
1.7.10.4
Regards,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: kvmtool : [PATCH] PowerPc : Fix compilation for ppc64
2013-04-09 17:29 kvmtool : [PATCH] PowerPc : Fix compilation for ppc64 Prerna Saxena
@ 2013-04-10 6:44 ` Pekka Enberg
[not found] ` <CA+1xoqfEVC=8HgRV6dzMdN0ekPnrHw=YEzpuhaj4801x9Vp5Og@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Pekka Enberg @ 2013-04-10 6:44 UTC (permalink / raw)
To: Prerna Saxena; +Cc: KVM General, Michael Ellerman, Sasha Levin
On Tue, Apr 9, 2013 at 8:29 PM, Prerna Saxena <prerna@linux.vnet.ibm.com> wrote:
> 'lkvm' compilation on ppc64 fails with the following error :
> ...[snip]..
> LINK guest/init
> LINK lkvm
> /usr/bin/ld: powerpc:common architecture of input file `guest/guest_init.o'
> is incompatible with powerpc:common64 output
> collect2: ld returned 1 exit status
> make: *** [lkvm] Error 1
>
> This patch corrects the error above, and enables 'lkvm' to compile on ppc64
> architecture.
>
> Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
> ---
> tools/kvm/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
> index 0c59faa..269e29e 100644
> --- a/tools/kvm/Makefile
> +++ b/tools/kvm/Makefile
> @@ -335,7 +335,11 @@ $(PROGRAM_ALIAS): $(PROGRAM)
> $(GUEST_INIT): guest/init.c
> $(E) " LINK " $@
> $(Q) $(CC) -static guest/init.c -o $@
> +ifeq ($(ARCH), powerpc)
> + $(Q) $(LD) -r -b binary --oformat elf64-powerpc -o guest/guest_init.o $(GUEST_INIT)
> +else
> $(Q) $(LD) -r -b binary -o guest/guest_init.o $(GUEST_INIT)
> +endif
>
> $(DEPS):
>
> --
> 1.7.10.4
Michael, Sasha, comments?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kvmtool : [PATCH] PowerPc : Fix compilation for ppc64
[not found] ` <CA+1xoqfEVC=8HgRV6dzMdN0ekPnrHw=YEzpuhaj4801x9Vp5Og@mail.gmail.com>
@ 2013-04-11 16:53 ` Prerna Saxena
2013-04-11 19:44 ` Sasha Levin
0 siblings, 1 reply; 4+ messages in thread
From: Prerna Saxena @ 2013-04-11 16:53 UTC (permalink / raw)
To: Sasha Levin; +Cc: Pekka Enberg, KVM General, Michael Ellerman, Sasha Levin
On 04/10/2013 09:05 PM, Sasha Levin wrote:
> Hm, what would LD create before this patch? I thought that the default
> would be to create a binary that corresponds to the platform you're
> building in, so if you build on ppc64 you'd get ppc64 binaries, no?
>
Hi Sasha,
Thanks for the prompt response.
Powerpc had historically supported 32 bit userspace on a 64 bit kernel,
before everything moved 64 bit.
I'd hit this issue since the default output of 'ld' was turning out to
be 'elf32-powerpc' on my ppc64 build machine. This was running ld-2.22.
I found that adding '--oformat=elf64-powerpc' to the Makefile helped me
tide over it, so I sent a patch to that end.
Today, I verified on another ppc64 machine that ld is automatically
choosing 'elf64-powerpc'. This machine is running 'ld-2.23'
So, this patch can be ignored, since it appears to be a toolchain
dependency. Or, we could put it in place, to ensure kvmtool builds dont
break even if the toolchain is not perfectly configured.
As you suggest :)
Regards,
Prerna
>
>
> On Wed, Apr 10, 2013 at 2:44 AM, Pekka Enberg <penberg@kernel.org
> <mailto:penberg@kernel.org>> wrote:
>
> On Tue, Apr 9, 2013 at 8:29 PM, Prerna Saxena
> <prerna@linux.vnet.ibm.com <mailto:prerna@linux.vnet.ibm.com>> wrote:
> > 'lkvm' compilation on ppc64 fails with the following error :
> > ...[snip]..
> > LINK guest/init
> > LINK lkvm
> > /usr/bin/ld: powerpc:common architecture of input file
> `guest/guest_init.o'
> > is incompatible with powerpc:common64 output
> > collect2: ld returned 1 exit status
> > make: *** [lkvm] Error 1
> >
> > This patch corrects the error above, and enables 'lkvm' to compile
> on ppc64
> > architecture.
> >
> > Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com
> <mailto:prerna@linux.vnet.ibm.com>>
> > ---
> > tools/kvm/Makefile | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
> > index 0c59faa..269e29e 100644
> > --- a/tools/kvm/Makefile
> > +++ b/tools/kvm/Makefile
> > @@ -335,7 +335,11 @@ $(PROGRAM_ALIAS): $(PROGRAM)
> > $(GUEST_INIT): guest/init.c
> > $(E) " LINK " $@
> > $(Q) $(CC) -static guest/init.c -o $@
> > +ifeq ($(ARCH), powerpc)
> > + $(Q) $(LD) -r -b binary --oformat elf64-powerpc -o
> guest/guest_init.o $(GUEST_INIT)
> > +else
> > $(Q) $(LD) -r -b binary -o guest/guest_init.o $(GUEST_INIT)
> > +endif
> >
> > $(DEPS):
> >
> > --
> > 1.7.10.4
>
> Michael, Sasha, comments?
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kvmtool : [PATCH] PowerPc : Fix compilation for ppc64
2013-04-11 16:53 ` Prerna Saxena
@ 2013-04-11 19:44 ` Sasha Levin
0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2013-04-11 19:44 UTC (permalink / raw)
To: Prerna Saxena; +Cc: Sasha Levin, Pekka Enberg, KVM General, Michael Ellerman
On 04/11/2013 12:53 PM, Prerna Saxena wrote:
> On 04/10/2013 09:05 PM, Sasha Levin wrote:
>> Hm, what would LD create before this patch? I thought that the default
>> would be to create a binary that corresponds to the platform you're
>> building in, so if you build on ppc64 you'd get ppc64 binaries, no?
>>
>
> Hi Sasha,
> Thanks for the prompt response.
> Powerpc had historically supported 32 bit userspace on a 64 bit kernel,
> before everything moved 64 bit.
>
> I'd hit this issue since the default output of 'ld' was turning out to
> be 'elf32-powerpc' on my ppc64 build machine. This was running ld-2.22.
> I found that adding '--oformat=elf64-powerpc' to the Makefile helped me
> tide over it, so I sent a patch to that end.
> Today, I verified on another ppc64 machine that ld is automatically
> choosing 'elf64-powerpc'. This machine is running 'ld-2.23'
>
> So, this patch can be ignored, since it appears to be a toolchain
> dependency. Or, we could put it in place, to ensure kvmtool builds dont
> break even if the toolchain is not perfectly configured.
> As you suggest :)
What worries me with about this patch is that it will break build on 32bit
machines.
I don't know if those are even supported these days or not, but if they are -
we need something different to handle that.
Thanks,
Sasha
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-11 19:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 17:29 kvmtool : [PATCH] PowerPc : Fix compilation for ppc64 Prerna Saxena
2013-04-10 6:44 ` Pekka Enberg
[not found] ` <CA+1xoqfEVC=8HgRV6dzMdN0ekPnrHw=YEzpuhaj4801x9Vp5Og@mail.gmail.com>
2013-04-11 16:53 ` Prerna Saxena
2013-04-11 19:44 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox