i386-elf/coff cross build
Christopher Bahns
chris@bahns.com
Mon Jun 19 09:43:00 GMT 2000
Alagu,
I wrote a document/bash script that I use to build an m68k cross
compiler under Cygwin 1.0 (commercial version) with both Windows 98 and
Windows NT 4.0 Workstation. It does not seem to work with Windows NT 4.0
Server. Using the script all you have to do is download the distribution
archives (four files in my case: newlib-1.8.2.tar.gz, gcc-2.95.2.tar.gz,
binutils-2.9.1.tar.gz, and a patch file) and then run the script. You
may have to edit the script (although only slightly) depending on your
build setup and target platform.
I assume a similar script would work in Linux or perhaps other Unix's.
The overall procedure and script should be even simpler for Unix but I
have not tried it yet.
There have been recent messages about someone else trying to put
together a similar thing, but I have not looked at it yet. I assume
you've already seen that stuff.
Please let me know if you try my little procedure and script and if it's
helpful. I have not tried Windows 2000 but would like to know if it
works there, and if anyone can find out why it was not working with NT
Server that would be helpful. I tried a multithreaded option in make,
which seemed to be making use of my dual-Celerons for a while but it got
hung up, so I disabled that option. If someone can help me fix that I'd
appreciate it.
The script file is attached. Be careful not to do anything that would
cause the file to be saved with carriage returns. I don't think bash
will understand it like that.
Chris
|----------------- ORIGINAL TEXT: From Alagu Sankar -----------------|
Thanks for your response. But it doesnt seem to solve my problem. Let
me give a detailed output of the make error so that you can understand
it better. It
clearly says that it uses 'ar' for target i.e. i386-coff-ar. Moreover
the error says that it is from the assembler. There can be some other
solution for this. Can you
brief it if you remember?
I did explore to some more extend. The xgcc compiler generates an
assembly file for libgcc2.c file with _floatdidf option, which contains
a '.align 3' directive and
hence the 'alignment not power of 2' error. But i dont understand why
the compiler generates this alignment and how to overcome it.
Any help is appreciated.
--------------------------
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3
_ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2
_floatdidf
_floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi
_fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi
_fixunstfdi _floatditf __gcc_bcmp _varargs
__dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
_ctors _pure; \
do \
echo ${name}; \
/home/alagu/buildx86/buildgcc/gcc/xgcc
-B/home/alagu/buildx86/buildgcc/gcc/ -B/usr/x86gcc/i386-coff/bin/
-I/usr/x86gcc/i386-coff/include -O2
-DCROSS_COMPILE-DIN_GCC -g -O2 -I./include -g1 -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I.
-I/home/alagu/gcc-2.95.2/gcc
-I/home/alagu/gcc-2.95.2/gcc/config
-I/home/alagu/gcc-2.95.2/gcc/../include -c -DL${name} \
/home/alagu/gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
i386-coff-ar rc tmplibgcc2.a ${name}.o; \
rm -f ${name}.o; \
done
_muldi3
_divdi3
_moddi3
_divdi3
_moddi3
_udivdi3
_umoddi3
_negdi2
_lshrdi3
_ashldi3
_ashrdi3
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
/tmp/cc6hpKn9.s: Assembler messages:
/tmp/cc6hpKn9.s:113: Error: Alignment not a power of 2
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory `/home/alagu/buildx86/buildgcc/gcc'
make: *** [cross] Error 2
----------------------------------------------
----- Original Message -----
From: b gonzales
To: Alagu Sankar ; crossgcc@sourceware.cygnus.com
Sent: Thursday, March 30, 2000 7:04 PM
Subject: Re: i386-elf/coff cross build
I encountered this problem before.
What I did was I copied /bin/ar into one of the bin directory of
the cross compiler.
Try examining the make file. There is a line there that
references the ar program.
I'm sorry that I cannot give the details because I have no notes
about it.
Hope this helps.
-----Original Message-----
From: Alagu Sankar <alagu@nettaxi.com>
To: crossgcc@sourceware.cygnus.com
<crossgcc@sourceware.cygnus.com>
Date: Thursday, March 30, 2000 3:17 PM
Subject: i386-elf/coff cross build
Hi all,
I am in the process of building cross compiler tools for
intel 386 embedded target with a custom RTOS. Has anybody succeded in
installing the i[3456]-elf or i[3456]-coff gcc cross
compilers with linux or windows(cygwin) host. I'm seeing lot of failure
stories in
building i386 cross tools in the mailing list
I am using gcc-2.95.2 with newlib-1.8.2. I am able to
build bin utils for i386-coff successfully. But when i try to install
gcc i am
getting the follwoing errors (I tried with both cygwin and
linux host but the result is same). Any help in solving the problem is
very
much appreciated.
-------------------------------------------------------------------------
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
/tmp/ccQYtSN7.s: Assembler messages:
/tmp/ccQYtSN7.s:113: Error: Alignment not a power of 2
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory
`/home/alagu/buildx86/buildgcc/gcc'
make: *** [cross] Error 2
---------------------------------------------------------------------------
I was successfull in creating powerpc-eabi and arm-coff
for both the host and obviously i follow the same procedure for building
i386-coff also.
I have got one more question. Does anybody know, like..
what are the issues in using gcc with a custom developed RTOS (not
RTEMS or eCos) and its own C library routines for am
embedded target.
Thanx in anticipation
Alagu Sankar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Buildgcc.sh
Type: text/x-shellscript
Size: 10405 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20000619/be0d8307/attachment.bin>
More information about the crossgcc
mailing list