From: Ferenc Wagner Subject: Re: Pesky '#define current' in mini-os/sched.h Date: Tue, 28 Apr 2009 19:57:07 +0200 Message-ID: <87eivc7jbg.fsf@tac.ki.iif.hu> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20090427211132.GR5965@const.famille.thibault.fr> (Samuel Thibault's message of "Mon, 27 Apr 2009 23:11:32 +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 Mon 27 Apr 2009 22:29:02 +0200, a =C3=A9crit : > >> LDLIBS :=3D -L/home/wferi/xen/xen-3.3.1/stubdom/ncurses-x86_32/lib -lncu= rses > > That's not how it's supposed to be done. See the Cross-zlib paragraph > for instance: the cross-zlib target not only configures & builds libz, > but also installs it, the prefix being properly set during configuration > into the cross-chain directory. Now I have ncurses installed into cross-root. Suppose I want to use it from c-stubdom. #include works without any further modification, but where should I put -lncurses? The best I could come up with is APP_LDLIBS in extras/mini-os/Makefile... >> /home/wferi/xen/xen-3.3.1/stubdom/mini-os-x86_32-c/mini-os.o: In functio= n `grub_memalign': >> /home/wferi/xen/grub2/util/misc.c:263: undefined reference to `posix_mem= align' > > It should just be a matter of setting it as an alias for newlib's > memalign, by adding a macro into newlib/libc/include/malloc.h for > instance. Ideally it should be reported to newlib's upstream actually. Seems good. > Should be fixed by the patch below. Works as advertised, thanks! >> /home/wferi/xen/xen-3.3.1/stubdom/ncurses-x86_32/ncurses/../ncurses/./ti= nfo/lib_baudrate.c:244: undefined reference to `cfgetospeed' > > I'm a bit surprised you actually got code using cfgetospeed compiled in > the miniOS environment. It's supposed to return something like B9600, > but that's not defined by newlib! I'll stub this to always return B38400 and define those constants. Do you think it matters the least? >> /home/wferi/xen/xen-3.3.1/stubdom/ncurses-x86_32/ncurses/../ncurses/./ti= nfo/lib_kernel.c:67: undefined reference to `fpathconf' > > Same issue: how did you get that code to compile? _PC_VDISABLE is not > defined... I believe you are not using the cross-chain flags. 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? >> /home/wferi/xen/xen-3.3.1/stubdom/ncurses-x86_32/ncurses/../ncurses/./ti= nfo/access.c:112: undefined reference to `access' >> /home/wferi/xen/xen-3.3.1/stubdom/ncurses-x86_32/ncurses/../ncurses/./ti= nfo/access.c:125: undefined reference to `access' > > Mmmm, the fsif protocol does not provide an access operation to > implement that properly. You could add a dummy implementation in > lib/sys.c that just open()/close() it and return proper error codes if > any and it should be fine for ncurses' use cases. I stubbed this last one, and now I can compile the ncurses example at http://www.captain.at/howto-curses-example.php as a c-stubdom; too bad it does not work: Error opening terminal: unknown. Now let's try to hardwire the terminal type to xterm or similar... --=20 Cheers, Feri.