From: Ferenc Wagner Subject: Re: Pesky '#define current' in mini-os/sched.h Date: Tue, 28 Apr 2009 21:43:17 +0200 Message-ID: <87tz485zu2.fsf@tac.ki.iif.hu> References: <20090427182543.GD5965@const.famille.thibault.fr> <877i163pga.fsf@tac.ki.iif.hu> <20090427185955.GF5965@const.famille.thibault.fr> <873abt51e5.fsf@tac.ki.iif.hu> <20090427200544.GN5965@const.famille.thibault.fr> <87skjt3koh.fsf@tac.ki.iif.hu> <20090427211132.GR5965@const.famille.thibault.fr> <87eivc7jbg.fsf@tac.ki.iif.hu> <20090428181211.GD5777@const.famille.thibault.fr> <87zle062eq.fsf@tac.ki.iif.hu> <20090428185908.GG5777@const.famille.thibault.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20090428185908.GG5777@const.famille.thibault.fr> (Samuel Thibault's message of "Tue, 28 Apr 2009 20:59:08 +0200") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Samuel Thibault writes: > Ferenc Wagner, le Tue 28 Apr 2009 20:47:41 +0200, a =C3=A9crit : >> Samuel Thibault writes: >> > Ferenc Wagner, le Tue 28 Apr 2009 19:57:07 +0200, a =C3=A9crit : >> >> newlib-1.16.0/newlib/libc/include/sys/unistd.h defines _PC_VDISABLE. >> >> It even has an fpathconf implementation in libc/sys/linux. Is there a >> >> way to get that work or had I better stub this one, too? >> > >> > Oh, right it's not defined in the linux/ part. >> > That one should be fine indeed. >>=20 >> Do you know offhand why it isn't found? > > What do you refer to by "it"? The fpathconf implementation. > _PC_VDISABLE is in the generic part, so that's why ncurses sees it. > fpathconf is in the linux/ part, so that's why it's not compiled in. Ah, I wasn't aware of this distinction. > Just take that implementation and it will get compiled in. Sorry for sounding dense... How do I "take that implementation"? I guess you don't mean cut&paste, do you? >> For now I configured out database access and compiled in some fallbacks. > > Ok, that should be fine. In that case, maybe you should rather stub > access() as always failing, as it's not supposed to read files. Not for the ncurses library, but maybe for something else... >>> Now, I'm wondering about the ncurses requirement: is grub2 really >>> using it for the bootloader, not just for the userland tool? >>=20 >> No, it does not require it for the bootloader. My plan is to port the >> grub-emu userland tool instead, and finally patch kexec on that, just >> like you did with grub1. > > Err, I didn't port the userland tool, I ported the bootloader. The > userland grub1 tool does not even include code to boot kernels, > actually... Yes, it's all the same for grub2. With "just like you did" I meant patching in kexec, so that the grub-emu userland tool can actually boot kernels. You also needed to patch kexec onto the grub1 boot loader (but not the userland tool). >>>> I may be blind, but there's no -l linker option in stubdom/Makefile. >>> >>> Sure, but in qemu/ there is a -lz linker option. Just the usual way, >>> that is. >>=20 >> There's no qemu/ in the 3.3.1 tree, as far as I can see. > > It's a symlink to the ioemu/ tree, yes, I didn't mean a precise > directory name, just vaguely evoking ioemu. OK, in ioemu I found tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c blo= ck-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-= vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_L= DFLAGS) -o $@ $^ -lz $(LIBS) and qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c bloc= k-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-v= pc.c block-vvfat.c block-qcow2.c $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_L= DFLAGS) -o $@ $^ -lz $(LIBS) but neither is applicable to c-stubdom, where the Makefile stops at creating an archive. I can't add -lncurses there... And generally I feel like being on a totally wrong track, as this part doesn't seem to involve minios at all. >>>> $(NCURSES_STAMPFILE): ncurses-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) >>>> ( cd $< && \ >>>> CFLAGS=3D"$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=3D$(CC) ./= configure --prefix=3D$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf --with-buil= d-cppflags=3D"" --with-build-cflags=3D"" --with-build-ldflags=3D"" --with-b= uild-libs=3D"" && \ >>>> $(MAKE) libs && \ >>>> $(MAKE) install.libs ) >>>>=20 >>>> The --with-build-* options do nothing, so two utilities must be compil= ed by hand. >>> >>> You need to pass the $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) there. >>=20 >> Sorry, I don't understand. Where? The target flags are the very >> thing causing the problem for the build helper programs. > > In --with-build-*, I guess. What do you hope to build with helper > programs? Mini-OS kernels? That would indeed require much more > invasive Makefile changes in ncurses. I don't think you need that > anyway. Oh no, these helpers are run as part of the cross building process itself, on the host system, not on the target. In the end I found a way to override the target flags for them by specifying BUILD_CCFLAGS=3D"" as a make argument. --=20 Feri.