This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin hosted Linux toolchain -- Howto test run


Mumit wrote:
>Anybody care to try and see if my howto on building x86-cygwin hosted
>x86-linux toolchain work?
>
>http://www.xraylith.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cros
s-howto.txt
>

My experience:

Cygwin-b20.1 was already installed on my computer, getting and
installing gcc-2.95 was easy (Done this before).

I must admit I currently do not have access to a Linux intel computer
with glibc-2.0 libraries. (shame on me!) I was therefore not able to
just get the includes and libs from a linux computer. So, I downloaded
a file for the net called glibc-2.0.bin.i386.tar.gz, extracted this
under a temporary directory c:\linuxbin. The neccesary lib files is
then found in the directory c:\linuxbin\usr\lib (not c:\linuxbin\lib
which is only the shared objects and not the .a files) I created the
linux-runtime.tar.gz accordingly to the HOWTO.

Then I downloaded the sources for binutils and gcc. I used the tar.gz
instead of bz2, cause I have some trouble with bunzip2, don't know why,
but it shouldn't matter. binutils-2.9.5.0.4 and gcc-2.95. Extracted to
/usr/src/BUILD/.

Made prefix=/usr/local/cross-tools and target=i686-pc-linux-gnu. Patched
the gcc-2.95 source

===Build===
$ cd /usr/src/BUILD/binutils-2.9.5.0.4
$ CONFIG_SHELL=bash /usr/local/src/binutils-2.9.5.0.4/configure \
    --prefix=$prefix --target=$target --with-gnu-libc -v

Note: I had to add the --with-gnu-libc flag here!

Configure runs fine, no problems.

$ make > make.log 2>&1

Compiles nice and beautiful. Some warning, but no errors. Most of the
warnings when compiling libiberty. I got the make.log if someone is
interested.

$ make install

No problem!

Added $prefix/bin to PATH, and then

$ cd /usr/src/BUILD/gcc-2.95

$ mkdir gcc
$ cd gcc
$ ln -s $prefix/bin/i686-pc-linux-gnu-as.exe as.exe

At this this point I started to hesitate. Was I supposed to go up
/usr/src/BUILD/gcc-2.95 before running configure? I decided to do that,
(I don't remember why I did, but it seemd logical at that moment), so

$ cd ..

$ CONFIG_SHELL=bash /usr/local/src/gcc-2.95/configure \
    --enable-languages=c --prefix=$prefix \
    --target=$target --enable-shared -v

Note: I added -v at the end. Just from habit. (Hope this isn't a big
 consequence?)

Configures fine. No problems!

$ (cd gcc; make installdirs)

The gem! No problems.

make > make.log 2>&1

Compiles nice and beatiful until it starts building the target libraries
(libiberty, libstdc++, libobjc, libg2c, etc). It's depending on the
include files from the linux source. As it happens, I did have the file
linux-2.0.36.tar.gz on my computer, extracted the includes, and linked
them to /usr/local/cross-tools/i686-pc-linux-gnu/include/. Then the
target libraries was built succesfully (?).

I think there is a problem when linking programs.

$ i686-pc-linux-gnu.gcc -c foo.c

works fine, but

$ i686-pc-linux-gnu-gcc -O2 -o foo-linux foo.c

runs out of memory, in the linking process. :-(
Please help on this issue. Does it use the right ld.exe?
Do I have to recompile binutils? or?

Regards,
Oystein


_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]