problems while compiling in Arm processor

Valentin Valchev kaffe@rufus.w3.org
Sat, 15 Dec 2001 14:59:10 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_004F_01C18579.0D80DAD0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0050_01C18579.0D80DAD0"


------=_NextPart_001_0050_01C18579.0D80DAD0
Content-Type: text/plain;
	charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

I've attached a single document - part of article that describes how to =
create embedded arm distribution (along with cross-compilers) with java =
support (kaffe).
---------------------------------------------------------------
ProSyst Bulgaria Ltd.            Valentin Valchev
48 Vladajska Str.                Project Manager
Sofia 1606, Bulgaria             Dept: mBedded Server/Broadband
http://www.prosyst.com/          Phone: +359 02 (9631394) 223
---------------------------------------------------------------
Leading Software Technology for Open Service Gateways

  ----- Original Message -----=20
  From: Jyothi=20
  To: kaffe@rufus.w3.org=20
  Sent: Saturday, December 15, 2001 2:17 PM
  Subject: problems while compiling in Arm processor



  Hi,

  I am having problems while cross compiling kaffe to ARM processor...

  I configured with

  CC=3Darm-linux-gcc ./configure --host=3Di686-arm --target=3Darm-linux
  --with-x  --x-includes=3D/skiff/local/arm-linux/include
  --x-libraries=3D/skiff/local/arm-linux/lib/X11 --disable-nls

  it configured fine but when I ran the makefile it gave me error in
  machine.c in jit3 directory.....
  machine.c.195: inconsistent constraints for operand in an 'asm'

  I changed the Makefile in config directorty. In Makefile I changed all
  i386 to arm.. and then ran make again. But of no use.

  I saw the FAQ.profilier and thought it is just for timing purposes and
  then commented the line
  profiler_get_clicks(xmeth->jitclicks);
  and ran I got few more error like above wherever profiler functions =
were
  there... so I commented them and then ran. but it gave an
  error

  Error: bad instruction :'call    soft_fixup_trampoline'

  I have attached the error file...

  So How should I compile this ???

  I saw the www.kaffe.org/archieves and saw they have configured with
  host=3Darm-linux . So I did the same and make went fine and then i
  installed it in /usr/local... But when i try to run the =
Helloworld.java
  on arm processor it says
  cannot find library "libnative"  in the path
  /usr/local/lib/kaffe:/usr/local/lib:/usr/lib:/lib

  Even though the library libnative.so.* and libnative.a are there in =
path
  /usr/local/lib/kaffe , it is continuously giving this error...
  When I do "arm-linux-strip libnative*", it says Warning : Output file
  cannot represent architecture UNKNOWN!!

  Please tell me what is wrong and what all u need to run basic java
  program on any machine.

  Is there any document for cross compiling kaffe for arm. Is my =
configure
  correct ?.. what is this profiling used for ???..

  Please tell me the exact procedure for cross compiling kaffe for arm
  processor !!

  thanks in advance,
  Jyothi.



------=_NextPart_001_0050_01C18579.0D80DAD0
Content-Type: text/html;
	charset="windows-1251"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1251">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#e0e0e0>
<DIV><FONT size=3D2>I've attached a single document - part of article =
that=20
describes how to create embedded arm distribution (along with =
cross-compilers)=20
with java support (kaffe).</FONT></DIV>
<DIV><PRE>---------------------------------------------------------------=

ProSyst Bulgaria Ltd.            Valentin Valchev
48 Vladajska Str.                Project Manager
Sofia 1606, Bulgaria             Dept: mBedded Server/Broadband
<A href=3D"http://www.prosyst.com/" =
target=3D_blank>http://www.prosyst.com/</A>          Phone: +359 02 =
(9631394) 223
---------------------------------------------------------------
Leading Software Technology for Open Service Gateways
</PRE></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Djyothi@ncoretech.com =
href=3D"mailto:jyothi@ncoretech.com">Jyothi</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dkaffe@rufus.w3.org=20
  href=3D"mailto:kaffe@rufus.w3.org">kaffe@rufus.w3.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Saturday, December 15, =
2001 2:17=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> problems while =
compiling in Arm=20
  processor</DIV>
  <DIV><BR></DIV><BR>Hi,<BR><BR>I am having problems while cross =
compiling kaffe=20
  to ARM processor...<BR><BR>I configured with<BR><BR>CC=3Darm-linux-gcc =

  ./configure --host=3Di686-arm --target=3Darm-linux<BR>--with-x&nbsp;=20
  =
--x-includes=3D/skiff/local/arm-linux/include<BR>--x-libraries=3D/skiff/l=
ocal/arm-linux/lib/X11=20
  --disable-nls<BR><BR>it configured fine but when I ran the makefile it =
gave me=20
  error in<BR>machine.c in jit3 directory.....<BR>machine.c.195: =
inconsistent=20
  constraints for operand in an 'asm'<BR><BR>I changed the Makefile in =
config=20
  directorty. In Makefile I changed all<BR>i386 to arm.. and then ran =
make=20
  again. But of no use.<BR><BR>I saw the FAQ.profilier and thought it is =
just=20
  for timing purposes and<BR>then commented the=20
  line<BR>profiler_get_clicks(xmeth-&gt;jitclicks);<BR>and ran I got few =
more=20
  error like above wherever profiler functions were<BR>there... so I =
commented=20
  them and then ran. but it gave an<BR>error<BR><BR>Error: bad =
instruction=20
  :'call&nbsp;&nbsp;&nbsp; soft_fixup_trampoline'<BR><BR>I have attached =
the=20
  error file...<BR><BR>So How should I compile this ???<BR><BR>I saw the =
<A=20
  href=3D"http://www.kaffe.org/archieves">www.kaffe.org/archieves</A> =
and saw they=20
  have configured with<BR>host=3Darm-linux . So I did the same and make =
went fine=20
  and then i<BR>installed it in /usr/local... But when i try to run the=20
  Helloworld.java<BR>on arm processor it says<BR>cannot find library=20
  "libnative"&nbsp; in the=20
  path<BR>/usr/local/lib/kaffe:/usr/local/lib:/usr/lib:/lib<BR><BR>Even =
though=20
  the library libnative.so.* and libnative.a are there in=20
  path<BR>/usr/local/lib/kaffe , it is continuously giving this =
error...<BR>When=20
  I do "arm-linux-strip libnative*", it says Warning : Output =
file<BR>cannot=20
  represent architecture UNKNOWN!!<BR><BR>Please tell me what is wrong =
and what=20
  all u need to run basic java<BR>program on any machine.<BR><BR>Is =
there any=20
  document for cross compiling kaffe for arm. Is my configure<BR>correct =
?..=20
  what is this profiling used for ???..<BR><BR>Please tell me the exact=20
  procedure for cross compiling kaffe for arm<BR>processor =
!!<BR><BR>thanks in=20
  advance,<BR>Jyothi.<BR><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_0050_01C18579.0D80DAD0--

------=_NextPart_000_004F_01C18579.0D80DAD0
Content-Type: text/html;
	name="programs.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="programs.html"

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Building the GNU toolchain for ARM target</title>
<meta name=3D"Generator" content=3D"EditPlus">
<meta name=3D"Author" content=3D"Valentin Pavlov">
<meta name=3D"Keywords" content=3D"gnu,gcc,linux,kernel,arm">
</head>

<body bgcolor=3D"#FFFFFF">
<table width=3D"100%">
<tr width=3D"100%">
	<td valign=3D"center" align=3D"center">
	  <font size=3D+4>Building ProSyst's Linux for ARM target</font>
	  <br>By <a href=3D"mailto:v_valchev@prosyst.bg">Valentin Valchev</a>
	</td>
	<td width=3D"120"><img src=3D"../linux.gif" width=3D"120" =
height=3D"141" border=3D0 alt=3D"Linux Logo"></td>
</tr>
</table>
<h1>Introduction</h1>
This document describes how to build common tools and prepare the =
ProSyst's Linux <i>root image</i>. These are general instructions for =
cross-compiling a small portion of packages that are needed for a small, =
embedded linux distribution. Before you proceed to the build =
instructions first create folder <i>distro</i> in your home dir.
<p>

<h1>Busybox</h1>
Busybox is package for embedded linux distrubution that contains =
replacement for the most common unix tools - such as sh, ls, rm, cat, =
echo .. etc. The version we use is <i>busybox-0.47</i> and can be =
downloaded from <a href=3D"http://www.lineo.com/">Lineo's site</a>. To =
build it unpack it, change to the folder <i>busybox-0.47</i> and then =
run:
<pre>
  CFLAGS=3D"-DBB_FEATURE_SH_BACKTICKS -DBB_FEATURE_SH_IF_EXPRESSIONS =
-DBB_FEATURE_SH_ENVIRONMENT" make CROSS=3Darm-linux-gnu-
  make CROSS=3Darm-linux-gnu- PREFIX=3D~/distro install
</pre>
This will build the sources and install everything in ~/distro folder.

<h1>e3 - the editor</h1>
Every os needs an editor - just a simple and easy to use editor. Since =
we need <font size=3D-1>small</font> editor the choice is e3. It can be =
downloaded from <a =
href=3D"http://www.sax.de/~adlibit/">http://www.sax.de/~adlibit/</a>. =
The version we use is e3-0.9 which is the latest release at the time of =
writing this document. Unfortunately the Makefile does not allow cross =
compilation so we will do it manually. Extract the archive and change to =
the new dir. Then run:
<pre>
  arm-linux-gnu-gcc -s -Wall -Wno-multichar -g -O2 -fomit-frame-pointer =
-DLIBDIR=3D\"/usr/lib\" e3.c -o e3
  install -m 755 e3 ~/distro/usr/bin
  install -m 644 *.hlp *.res ~/distro/usr/lib
</pre>
Now you have an editor! ;)

<h1>Net Tools</h1>
If you plan to use connect the embedded linux distribution to the =
network then you should have at least net-tools-1.57 which is the latest =
release regarding to 25.10.2000y. To build them download the sources and =
extract the archive. Change to the source dir and follow the =
instructions:
<pre>
  make CC=3Darm-linux-gnu-gcc BASEDIR=3D~/distro LOPTS=3D-s
</pre>
At this point you will see some messages and ERROR! This will stop make =
process! But don't worry! Continue with this:
<pre>
  arm-linux-gnu-ranlib lib/libnet-tools.a
  make CC=3Darm-linux-gnu-gcc BASEDIR=3D~/distro LOPTS=3D-s install
</pre>
The make process should be resumed and everything will be installed =
under ~/distro folder

<h1>Java Support</h1>
If you intend to run any java program on this embedded linux we should =
have java virtual machine. And we choose kaffe - open source JVM which =
is well tested and already ported to ARM platform. It will not be =
difficult to compile and install kaffe. Just do this:
<pre>
  CC=3Darm-linux-gnu-gcc \
  AR=3Darm-linux-gnu-ar \
  LD=3Darm-linux-gnu-ld \
  NM=3Darm-linux-gnu-nm \
  RANLIB=3Darm-linux-gnu-ranlib \
  KAFFEH=3D/home/fire/kaffeh \
  CFLAGS=3D-Os LDFLAGS=3D-s \
  ./configure \
  --host=3Darm-linux-gnu \
  --enable-shared \
  --disable-debug \
  --disable-xprofiling \
  --disable-xdebugging \
  --disable-feedback \
  --without-suncompat \
  --without-profiling \
  --without-libffi \
  --without-x \
  --without-stats \
  --disable-gcj \
  --prefix=3D/usr
 =20
  make

  make DESTDIR=3D~/distro install
</pre>
You may notice that many features are disabled but this is not =
significant loose of features. Most of them are not neccesary and will =
be only waste of space for embedded targets.

<h1>Conclusion</h1>
Before you have a complete java enabled, embedded linux distribution you =
should create <i>dev, proc, lib, etc</i> directories in ~distro. Then =
compy all the libraries from /opt/cross/powerpc/powerpc-linux-gnu/lib to =
~disto/lib and create your config files in etc.<br>
There are many many toosl you can build with the ARM Cross Compiler =
Toolchain. You can try almost everything. Although the tools mentioned =
here are not enough for serious distribution it is much pretty for =
embedded java enabled linux distribution which will run over minix =
filesystem. Using linux kernels 2.4.X will dramaticaly decrease the size =
of distribution <i>root image</i> if devfs driver is enabled and all =
other drivers are linked-in kernel so modutils are not neccesary.
<h1>Links</h1>
<a href=3D"http://www.arm.linux.org.uk/">The ARM Linux Project</a><br>
<a href=3D"http://www.kaffe.org/">Kaffe.org</a><br>
<a href=3D"http://www.lineo.com">Lineo - Embedded Linux =
Solutions</a><br>
<a href=3D"http://www.tazenda.demon.co.uk/phil/armlinux/">Philip =
Blundell's ARM Linux Site</a><br>
<hr>
Last modified 20.10.2000.<br>
Valentin Valchev &lt;<a =
href=3D"mailto:v_valchev@prosyst.bg">v_valchev@prosyst.bg</a>&gt;
</body>
</html>

------=_NextPart_000_004F_01C18579.0D80DAD0--