All of lore.kernel.org
 help / color / mirror / Atom feed
From: ramsdell@mitre.org (John D. Ramsdell)
To: gm281@cam.ac.uk
Cc: xen-devel@lists.xensource.com
Subject: Mini-OS Makefile and Cross Compilation
Date: 02 Apr 2007 19:11:16 -0400	[thread overview]
Message-ID: <ogtlkhaid7v.fsf@oolong.mitre.org> (raw)
In-Reply-To: <E1HYSaT-0003Vz-5b@host-192-168-0-1-bcn-london>

Mini-OS developers:

I acquired a Core 2 Duo machine, and decided to see if I could get a
32-bit Mini-OS application running using a 64-bit hypervisor.  I'm
running Fedora Core 6 for hardware platform x86_64 using its packaging
of the Xen hypervisor.  The Mini-OS sources were obtained today from
xen-unstable.hg.

I built binutils 2.17, gcc 4.1.2, and newlib 1.5.0 with a target of
i386-elf, and installed them into $HOME/opt/i386-elf.

$ cd $HOME/opt/i386-elf
$ ls i386-elf/bin
ar  as  c++  g++  gcc  ld  nm  objdump  ranlib  strip
[ramsdell@mm144697-pc i386-elf]$ ls bin
i386-elf-addr2line  i386-elf-cpp        i386-elf-gcov     i386-elf-ranlib
i386-elf-ar         i386-elf-g++        i386-elf-ld       i386-elf-readelf
i386-elf-as         i386-elf-gcc        i386-elf-nm       i386-elf-size
i386-elf-c++        i386-elf-gcc-4.1.2  i386-elf-objcopy  i386-elf-strings
i386-elf-c++filt    i386-elf-gccbug     i386-elf-objdump  i386-elf-strip

I first tried to build an application on top of Mini-OS, so I
attempted to build libminios.a with:

$ make CROSS_COMPILE=$HOME/opt/i386-elf/i386-elf/bin/ \
      TARGET_ARCH=x86_32 CPPFLAGS=-DHAVE_LIBC libminios.a

I found there is no rule for the libminios.a target, or one for the
all target.  Okay, lets get more conservative.

I decided to try to build just Mini-OS with:

$ make CROSS_COMPILE=$HOME/opt/i386-elf/i386-elf/bin/ TARGET_ARCH=x86_32
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
/home/ramsdell/opt/i386-elf/i386-elf/bin/gcc -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -D__XEN_INTERFACE_VERSION__=0x00030205 -g -m64 -mno-red-zone -fpic -fno-reorder-blocks -fno-asynchronous-unwind-tables -I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include  -I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86	-I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86/x86_64 -c events.c -o events.o
events.c:1: sorry, unimplemented: 64-bit mode not compiled in
In file included from /home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86/os.h:20,
                 from events.c:19:
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/hypervisor.h:19:30: error: hypercall-x86_32.h: No such file or directory
cc1: warnings being treated as errors
In file included from events.c:22:
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h: In function 'notify_remote_via_evtchn':
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h:45: warning: implicit declaration of function 'HYPERVISOR_event_channel_op'
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h:45: warning: nested extern declaration of 'HYPERVISOR_event_channel_op'
make: *** [events.o] Error 1
$ 

Some how, setting TARGET_ARCH=x86_32 was not enough to convince the
makefile to think 32-bits.  What was I supposed to do?  

I decided to carefully read the makefiles in the Mini-OS directories.
I discovered that the one in the root directory calls for $(OBJCOPY).
When using a cross compiler, this variable evaluates to objcopy, but
the installation of a cross compiler does not produce a binary named
objcopy.  When the target is i386-elf, it puts i386-elf-objcopy in the
bin directory where it is installed, but objcopy is not put the
i386-elf/bin directory.  Is this makefile intended to be used with a
cross compiler?  I'd gladly specify a target of i386-elf on the
command line if that helps.

I promise to submit a text document to be placed in the Mini-OS root
directory describing how to use its makefile with a cross compiler if
given the information need to complete this document by you all.

John

       reply	other threads:[~2007-04-02 23:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1HYSaT-0003Vz-5b@host-192-168-0-1-bcn-london>
2007-04-02 23:11 ` John D. Ramsdell [this message]
2007-04-03  6:19   ` Mini-OS Makefile and Cross Compilation Keir Fraser
2007-04-03 11:08     ` John D. Ramsdell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ogtlkhaid7v.fsf@oolong.mitre.org \
    --to=ramsdell@mitre.org \
    --cc=gm281@cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.