* Problem adding new source files
@ 2008-09-18 11:56 Hacking, Stuart
2008-09-18 13:18 ` Uri Lublin
0 siblings, 1 reply; 5+ messages in thread
From: Hacking, Stuart @ 2008-09-18 11:56 UTC (permalink / raw)
To: kvm
Hello,
We have beening doing some experimentation with modifications to the
migration code in the Qemu and came up against a problem. We included
some code in a different file and are receiving the following error from
make:
---
Migration.o: In function `migrate_prepare_page':
/root/tmp/KVM/qemu/migration.c:367: undefined reference to
`get_cached_page'
/root/tmp/KVM/qemu/migration.c:367: undefined reference to
`get_cached_page'
/root/tmp/KVM/qemu/migration.c:367: undefined reference to
`get_cached_page'
collect2: ld returned 1 exit status
Make[2]: *** [qemu-system_x86_64] Error 1
Make[1]: *** [subdir-x86_64-softmmu] Error2
Make: *** [qemu] Error 2
---
We see from looking at the code that everything seems to be correct and
we suspect that the error is coming from the order that the files are
being compiled. Is there any special consideration we need to take when
adding new headers and code files to the tree? (at the minute any new
files we added are in the same directory as migration.c.)
We aren't sure if the kvm maintainers are using a custom makefile,
however, would it be more appropriate to post this on the Qemu mailing
list?
regards
Stuart
Stuart Hacking
SAP Research, CEC Belfast
SAP (UK) Limited
TEIC Building, University of Ulster
BT37 0QB Newtownabbey, U.K.
( +44 (28) 90930094
stuart.hacking@sap.com <mailto:stuart.hacking@sap.com>
This communication contains information which is confidential and may
also be privileged. It is for the exclusive use of the addressee. If you
are not the addressee please contact us immediately and also delete the
communication from your computer. Steps have been taken to ensure this
e-mail is free from computer viruses but the recipient is responsible
for ensuring that it is actually virus free before opening it or any
attachments. Any views and/or opinions expressed in this e-mail are of
the author only and do not represent the views of SAP.
SAP (UK) Limited, Registered in England No. 2152073. Registered Office:
Clockhouse Place, Bedfont Road, Feltham, Middlesex, TW14 8HD
SAP (UK) Limited, Registered in Northern Ireland No. FC004016.
Registered Office: University of Ulster, Shore Road, Newtownabbey, Co.
Antrim, BT37 0QB.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem adding new source files
2008-09-18 11:56 Problem adding new source files Hacking, Stuart
@ 2008-09-18 13:18 ` Uri Lublin
2008-09-18 15:09 ` Hacking, Stuart
0 siblings, 1 reply; 5+ messages in thread
From: Uri Lublin @ 2008-09-18 13:18 UTC (permalink / raw)
To: Hacking, Stuart; +Cc: kvm
Hacking, Stuart wrote:
> Hello,
Hi,
>
> We have been doing some experimentation with modifications to the
> migration code in the Qemu and came up against a problem. We included
> some code in a different file and are receiving the following error from
> make:
>
> ---
> Migration.o: In function `migrate_prepare_page':
> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> `get_cached_page'
> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> `get_cached_page'
> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> `get_cached_page'
> collect2: ld returned 1 exit status
> Make[2]: *** [qemu-system_x86_64] Error 1
> Make[1]: *** [subdir-x86_64-softmmu] Error2
> Make: *** [qemu] Error 2
> ---
Did you define new functions in a different .c file(s) ? Did you provide
prototypes for all new functions ? Did you add all new files to the Makefile ?
>
> We see from looking at the code that everything seems to be correct and
> we suspect that the error is coming from the order that the files are
> being compiled. Is there any special consideration we need to take when
> adding new headers and code files to the tree? (at the minute any new
> files we added are in the same directory as migration.c.)
>
> We aren't sure if the kvm maintainers are using a custom makefile,
> however, would it be more appropriate to post this on the Qemu mailing
> list?
Speculations...
I'm sure kvm maintainer and developers (and users) use the released Makefile.
Regards,
Uri.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Problem adding new source files
2008-09-18 13:18 ` Uri Lublin
@ 2008-09-18 15:09 ` Hacking, Stuart
2008-09-18 16:01 ` Uri Lublin
0 siblings, 1 reply; 5+ messages in thread
From: Hacking, Stuart @ 2008-09-18 15:09 UTC (permalink / raw)
To: Uri Lublin; +Cc: kvm
> -----Original Message-----
> From: Uri Lublin [mailto:uril@qumranet.com]
> Sent: 18 September 2008 14:18
> To: Hacking, Stuart
> Cc: kvm@vger.kernel.org
> Subject: Re: Problem adding new source files
>
> Hacking, Stuart wrote:
> > Hello,
> Hi,
> >
> > We have been doing some experimentation with modifications to the
> > migration code in the Qemu and came up against a problem.
> We included
> > some code in a different file and are receiving the following error
> > from
> > make:
> >
> > ---
> > Migration.o: In function `migrate_prepare_page':
> > /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> > `get_cached_page'
> > /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> > `get_cached_page'
> > /root/tmp/KVM/qemu/migration.c:367: undefined reference to
> > `get_cached_page'
> > collect2: ld returned 1 exit status
> > Make[2]: *** [qemu-system_x86_64] Error 1
> > Make[1]: *** [subdir-x86_64-softmmu] Error2
> > Make: *** [qemu] Error 2
> > ---
>
> Did you define new functions in a different .c file(s) ? Did
> you provide prototypes for all new functions ? Did you add
> all new files to the Makefile ?
>
As far as I know all the code is organised properly and the function
prototypes provided in header files. As for adding to the Makefile -
that's where we are struggling. We have tried the following
'experiments': adding our new source files to the 'OBJS' variable
(OBJS+=s1.o s2.o); creating a migration.o directive which depends on
s1.o and s2.o (this actually produces a slightly different error:
---
In File included from s1.h:11,
from s1.c:14:
Qemu-kvm.h:11:17: error: cpu.h: No such file or directory
In File included from s1.h:11,
from s1.c:14:
Qemu-kvm.h:18: error: expected declaration specifiers of '...' before
'CPUState'
<ommitted further cascading errors>
Make[1]: *** [arc.o] Error 1
Make[1]: Leaving directory `/root/tmp/KVM2/qemu'
Make: *** [qemu] Error 2
---
This is why we are wondering if any special consideratinos need to be
made when adding to the makefile, or if there is already a howto
somewhere?
>
> Regards,
> Uri.
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Problem adding new source files
2008-09-18 15:09 ` Hacking, Stuart
@ 2008-09-18 16:01 ` Uri Lublin
2008-09-19 13:23 ` Hacking, Stuart
0 siblings, 1 reply; 5+ messages in thread
From: Uri Lublin @ 2008-09-18 16:01 UTC (permalink / raw)
To: Hacking, Stuart; +Cc: kvm
Hacking, Stuart wrote:
>> From: Uri Lublin [mailto:uril@qumranet.com]
>> Hacking, Stuart wrote:
>>> Hello,
>> Hi,
>>>
>>> We have been doing some experimentation with modifications to the
>>> migration code in the Qemu and came up against a problem.
>> We included
>>> some code in a different file and are receiving the following error
>>> from
>>> make:
>>>
>>> ---
>>> Migration.o: In function `migrate_prepare_page':
>>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
>>> `get_cached_page'
>>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
>>> `get_cached_page'
>>> /root/tmp/KVM/qemu/migration.c:367: undefined reference to
>>> `get_cached_page'
>>> collect2: ld returned 1 exit status
>>> Make[2]: *** [qemu-system_x86_64] Error 1
>>> Make[1]: *** [subdir-x86_64-softmmu] Error2
>>> Make: *** [qemu] Error 2
>>> ---
>> Did you define new functions in a different .c file(s) ? Did
>> you provide prototypes for all new functions ? Did you add
>> all new files to the Makefile ?
>>
>
> As far as I know all the code is organised properly and the function
> prototypes provided in header files. As for adding to the Makefile -
> that's where we are struggling. We have tried the following
> 'experiments': adding our new source files to the 'OBJS' variable
> (OBJS+=s1.o s2.o); creating a migration.o directive which depends on
> s1.o and s2.o (this actually produces a slightly different error:
>
Try just adding your new .o files (e.g: OBJS+=s1.o s2.o) to
<kvmdir>/qemu/Makefile.target
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Problem adding new source files
2008-09-18 16:01 ` Uri Lublin
@ 2008-09-19 13:23 ` Hacking, Stuart
0 siblings, 0 replies; 5+ messages in thread
From: Hacking, Stuart @ 2008-09-19 13:23 UTC (permalink / raw)
To: Uri Lublin; +Cc: kvm
> -----Original Message-----
> From: Uri Lublin [mailto:uril@qumranet.com]
> Sent: 18 September 2008 17:01
> To: Hacking, Stuart
> Cc: kvm@vger.kernel.org
> Subject: Re: Problem adding new source files
>
>
> Try just adding your new .o files (e.g: OBJS+=s1.o s2.o) to
> <kvmdir>/qemu/Makefile.target
>
>
Thanks, that seems to have done the trick. Now all our coding errors
are being revealed! :-)
--Stuart
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-19 13:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 11:56 Problem adding new source files Hacking, Stuart
2008-09-18 13:18 ` Uri Lublin
2008-09-18 15:09 ` Hacking, Stuart
2008-09-18 16:01 ` Uri Lublin
2008-09-19 13:23 ` Hacking, Stuart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox