[OpenBIOS] Cross Compile Error for Different Arch while compiling for dictionary

Vishu at soc-soft.com Vishu at soc-soft.com
Mon Aug 23 13:42:36 CEST 2004


Hi Everyone
	As I saw a mail from Madhu Kiran with regard of forming a final
image as part of the
Kernel (i.e. dictionary part of the Kenel build). I knew this since
openbios.full has kernel
and dictionary built to-gether its correct right. The answer corresponds
to the answer given by
Stefan Reinauer.

I'm cross compiling Kernel-1.1 for my embedded processor still I havent
updated my BSP part but
I'll do it later once the dictionary and kernel independent part is
built properly. Is it ok to go in this
Way.

So while cross compiling kernel-1.1 using cross compiler on Linux based
machine was able to compile
Kernel part and the unix folder (Host) with changes done in the
Makefile. The steps doing so are as follows:

1. In kernel-1.1
arch
Documentation
forth
include
kernel
Makefile
plugins
README
Rules.make
Util

In Makefile

ARCH      := $(shell uname -m | sed -e s/i.86/mips/)

Commented forth.html and plugins since I dint want .html to be formed
and plugins since is was giving some error
When compiled for x86.

all: main unix dictionary $(ARCH) # forth.html plugins 

2. In directory /util

	types.sh changes are

if [ -z "$CC" ]; then
  CC=mips_fp_le-gcc			# cross compiler option for
Target Board
fi

#echo "void *pointersize;" > types.c
#$CC -c -o types.o types.c
#PTRSIZE=$(( 8 * 0x`nm types.o| grep pointersize | cut -f1 -d\ ` ))
#rm -f types.c types.o

PTRSIZE=32			# since my Target is 32-bit processor

3. In arch/unix I made the chages with the following line added as per
the little endian option

CC       := mips_fp_le-gcc

include $(TOPDIR)/Rules.make

Can we do this ....

It even compiles the unix directory with the cross compiler option.

4. It gives problems with dictionary file what may be the problem with
the following error code

[root at localhost kernel-1.1]# make

Welcome to OpenBIOS..

Creating build directory /home/viswa/kernel-1.1/obj-mips
Checking types... Checkings in types.sh updated by SoCrates
found 32bit platform, creating "types.h"

Building common core files for architecture mips
  compiling primitives.c...             ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling stack.c...                  ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling dict.c...                   ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling lib.c...                    ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling openbios.c...               ok
In Rules.make Compiler Used mips_fp_le-gcc

Building files for unix hosted bootstrap
  compiling unix.c...                   ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling plugins.c...                ok
[root at localhost obj-mips]# cd ..
[root at localhost kernel-1.1]# make clean
Cleaning up architecture mips
[root at localhost kernel-1.1]# make

Welcome to OpenBIOS..

Creating build directory /home/viswa/kernel-1.1/obj-mips
Checking types... Checkings in types.sh updated by SoCrates
found 32bit platform, creating "types.h"

Building common core files for architecture mips
  compiling primitives.c...             ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling stack.c...                  ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling dict.c...                   ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling lib.c...                    ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling openbios.c...               ok
In Rules.make Compiler Used mips_fp_le-gcc

Building files for unix hosted bootstrap
  compiling unix.c...                   ok
In Rules.make Compiler Used mips_fp_le-gcc
  compiling plugins.c...                ok
In Rules.make Compiler Used mips_fp_le-gcc
  linking unix bootstrap... -rdynamic -ldl
                ok
Bootstrapping dictionary.../bin/sh: ./unix: cannot execute binary file
make[1]: *** [bootstrap.dict] Error 126
make: *** [dictionary] Error 2

This error is due to since we are trying to execute on different
architecture to form the dictionary
File. 

Is there anyway to bypass or use Host compiler for dictionary forming
and finally use this later along
With the final image formation.

5. Is the image openbios.full a binary image or elf format and how to
link to ROM i.e using ld sript to
Map for the Target ROM address.

6. But with x86 was able to compile the kernel-1.1 without compiler
option of forth.html and plugins
Which could not find some ./config file what is the correction for it
and why the plugins are needed.

In advance Thanks
Viswa



More information about the OpenBIOS mailing list