Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Updates to cross-compilation page

1 view
Skip to first unread message

Denver Gingerich

unread,
May 30, 2007, 5:38:11 PM5/30/07
to
I've recently gone through the instructions on the cross-compilation page
(http://www.student.cs.uwaterloo.ca/~cs452/docs/crosscompiler.html) and
found some of them to be slightly outdated.

I verified that the instructions work with the following versions of the
tools it lists (the current guide uses older versions):
- binutils 2.17
- gcc 4.1.2
- newlib 1.15.0

Because the library directory for GCC has changed, the lines for the
CFLAGS and LDFLAGS should be updated as follows:

ifeq ($(shell uname), Linux)
CS452DIR=/home/username/i586-elf
CCVER=4.1.2
GCCLIB=gcc
else
CS452DIR=/u3/cs452/i586-3.3.3
CCVER=3.3.3
GCCLIB=gcc-lib
endif

CPPFLAGS = -I. -I$(CS452DIR)/include -I$(CS452DIR)/i586-elf/include \
-I$(CS452DIR)/include/cs452 \
-I$(CS452DIR)/lib/$(GCCLIB)/i586-elf/$(CCVER)/include/
CFLAGS = -nostdinc -nostdinc++ -nodefaultlibs -nostdlib -Wall $(CPPFLAGS)
CXXFLAGS = $(CFLAGS)
LDFLAGS = -L$(CS452DIR)/lib
LDADD = -lstdc++ -lgcc -lc


Note that the Makefile appears to have changed since the cross-compilation
guide was written since the guide does not include the CPPFLAGS, CXXFLAGS,
or LDADD lines, but these appear in the current Makefile at
/u/cs452/public/examples/kernel/Makefile.

Also, you will need to update the .autopost section:

ifeq ($(shell uname), Linux)
./local-post.sh $(TITLE) $(POSTFILES)
else
452-post.py $(TITLE) $(POSTFILES)
-452postemu $(TITLE) $(POSTFILES)
endif
@touch .autopost


My local-post.sh looks like this:

#!/bin/sh
DEST_DIR=$1
shift
cp -p $@ $HOME/cs452/${DEST_DIR}/


I suggest making your own that copies files to the appropriate locations
on your hard drive, makes a new DEST_DIR if needed, etc. You can probably
copy a lot of the stuff from /u/cs452/public/tools/bin/452post; it seems
to do a pretty good job of copying files and updating the GRUB menu.

As usual, comments and questions are appreciated.

Denver

0 new messages