From: Samuel Thibault Subject: Re: Pesky '#define current' in mini-os/sched.h Date: Tue, 28 Apr 2009 20:21:00 +0200 Message-ID: <20090428182100.GE5777@const.famille.thibault.fr> References: <87k5563r1v.fsf@tac.ki.iif.hu> <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> <87r5zd6q8p.fsf@tac.ki.iif.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <87r5zd6q8p.fsf@tac.ki.iif.hu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ferenc Wagner Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Ferenc Wagner, le Tue 28 Apr 2009 12:12:54 +0200, a =E9crit : > Samuel Thibault writes: > > Have you, like in the C example of stubdom/Makefile, propagated > > TARGET_CPPFLAGS, TARGET_CFLAGS, and added a rule like is done for oth= er > > stubdom images in the "minios" paragraph of stubdom/Makefile? >=20 > No, I had no idea how to start with this, I stole the various flags > from the output of make c-stubdom and configured ncurses with those. Errrr, that's an odd way. ncurses is a library, so stole things from a library, see the cross-zlib part for instance. No need to look at c-stubdom (which is only about the main application, not a library). > > Ferenc Wagner, le Mon 27 Apr 2009 22:29:02 +0200, a =E9crit : > > > >> I couldn't track how it's done for libpci & libz for qemu-stubdom > >> (ioemu?) yet. > > > > It's all in stubdom/Makefile: they get installed within the > > cross-root-$(GNU_TARGET_ARCH) hierarchy, where the linker finds it > > thanks to the TARGET_LDFLAGS variable. > > > >> This make magic is somewhat convoluted, > > > > It's no magic, it's makefiles :) >=20 > Ok, do I have to extend the # Links section as well? You need to add a cross-ncurses dependency, but the rest is only for libxc. > >> So, where should I add it for proper operation? > > > > Just the same way as zlib & C stubdom examples. >=20 > 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. > NCURSES_STAMPFILE=3D$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libncu= rses.a > .PHONY: cross-ncurses > cross-ncurses: $(NCURSES_STAMPFILE) > $(NCURSES_STAMPFILE): ncurses-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE) > ( cd $< && \ > CFLAGS=3D"$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=3D$(CC) ./c= onfigure --prefix=3D$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf --with-bui= ld-cppflags=3D"" --with-build-cflags=3D"" --with-build-ldflags=3D"" --wit= h-build-libs=3D"" && \ > $(MAKE) libs && \ > $(MAKE) install.libs ) >=20 > The --with-build-* options do nothing, so two utilities must be compile= d by hand. You need to pass the $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) there. I'm actually feared by all your terminal additions. These will probably never be implemented in mini-os. They can sure be stubbed, but the application will probably just not work properly. Remember that the Xen console can be attached/detached/reattached from a lot of various kinds of terminals... > 9. Actually, deleting #define current get_current() from extras/mini-os= /include/mini-os/sched.h > made libncurses++.a build, but broke make c-stubdom... According to Ke= ir Fraser, the simplest fix is: >=20 > #ifdef __MINIOS__ > #define current get_current() > #endif Use the same fix as in the unstable tree. Samuel