I''m trying to write the hash values of shared memory pages to a disk file. To do that i have changed mem_sharing.c code. The change includes a call to fopen function. However when compiling the source i got the following error. I have included header files which are on "/usr/include". make -f /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/Rules.mk /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/common/symbols-dummy.o make[4]: Entering directory `/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86'' gcc -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -DNDEBUG -nostdinc -fno-builtin -fno-common -iwithprefix include -Werror -Wno-pointer-arith -pipe -I/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/include -I/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/include/asm-x86/mach-generic -I/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/include/asm-x86/mach-default -I/usr/include -msoft-float -fno-stack-protector -fno-exceptions -mno-red-zone -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -g -D__XEN__ -MMD -MF .symbols-dummy.o.d -c /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/common/symbols-dummy.c -o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/common/symbols-dummy.o make[4]: Leaving directory `/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86'' ld -melf_x86_64 -L/usr/include -L/usr/include/ -T xen.lds -N /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86/boot/built_in.o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/common/built_in.o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/drivers/built_in.o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/xsm/built_in.o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86/built_in.o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/crypto/built_in.o \ /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/common/symbols-dummy.o -o /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/.xen-syms.0 /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86/built_in.o: In function `mem_sharing_nominate_page'': /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86/mm/mem_sharing.c:517: undefined reference to `fopen'' /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86/mm/mem_sharing.c:517: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fopen'' ld: /home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/.xen-syms.0: hidden symbol `fopen'' isn''t defined ld: final link failed: Nonrepresentable section on output make[3]: *** [/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/xen-syms] Error 1 make[3]: Leaving directory `/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/arch/x86'' make[2]: *** [/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen/xen] Error 2 make[2]: Leaving directory `/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen'' make[1]: *** [install] Error 2 make[1]: Leaving directory `/home/thilakshi/Xen/Xen-4.2/xen-4.0-testing.hg/xen'' make: *** [install-xen] Error 2 Can someone please check this error and tell me where to correct? Thanks. Harshan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I am not sure if you can link libc to xen. However check this: http://www.linuxquestions.org/questions/linux-networking-3/ns-installation-wont-let-me-do-it-on-ubuntu-9-10-a-766193/ <http://www.linuxquestions.org/questions/linux-networking-3/ns-installation-wont-let-me-do-it-on-ubuntu-9-10-a-766193/> -- Srujan D. Kotikela On Sat, Apr 2, 2011 at 8:36 PM, Lakshitha Harshan <harshan.dll@gmail.com>wrote:> Ya, I knew that. What i want to do it is that link mem_sharing.c with > stdio.h library on /usr/include directory. > Please if you know how to do that let me know. > > Regards, > Harshan > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, though I am not of great authority at *this* low-level stuff, I think the file you mentioned is using "glibc" to generate 32-bit elf images. I do not think you can use it for other purposes. Try if you can use other alternatives for fopen for your particular problem. If you can give more details on exactly what you are trying to do, some others might help you. -- Srujan D. Kotikela On Sat, Apr 2, 2011 at 11:33 PM, Lakshitha Harshan <harshan.dll@gmail.com>wrote:> Hi, > > I forgot to mention in previous mail. The thing is that > xen/arch/x86/boot/mkelf32.c uses stdio.h and if I include fopen function in > mkelf32.c, it will compile fine and generates xen.gz. I''m really confused on > that. > If you have any idea on that please let me know that. > > Regards, > Harshan > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel