This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building compilers under cygwin


Hi All

I am using cygwin as environment for building GNU compilers. Initially I
had difficulties building a native compiler under cygwin 2.218.2.8 which
was solved after installing binutils and gcc, which were not installed as
default.

Now I have moved on to building cross compilers for embedded systems but am
experiencing new problems.

I am trying to build a compiler for the Motorola M-core, although the exact
target is probably not the issue here. Up to now I have had a number of
problems, mainly since I am new to this and was probably doing things the
wrong way. In the meantime I have gained some experience with the
environment and the tasks involved and am following a published procedure
which has helped me a great deal, but the build is still failing.
(http://www.nanotech.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cros
s-howto.txt - this is the procedure I am following - missing out the Linux
part)

Since the gcc compiler should successfully build (based on the fact that
others have surely done it) I deduce that I have problems with the
environment - for this reason I would like to know whether any one - who
also used cygwin as their environment for building gcc cross compilers -
could help me solve the problem. (eg. have I all the necessary utilities ?)



Before I continue with details of the problem, there is another point on my
mind. I am using cygwin since it was advised to me as a Unix type
environment for my Windows PC. This means that I can build my compilers
(when it works) with tools intended for a Unix machine. Although I have
never used Linux, people who have tell me that it is essentially Unix based
and is therefore also suitable for the job in hand. They also tell me that
I can make my computer dual bootable so that I can either run Linux or a
Windows operating system. If all of this is true, would it not be advisable
to install Linux and do away with cygwin altogether ? Please remember that
I really do not know much about the two systems, with their pros and cons
and this question is not intended as a derogatory question - I am sure that
there must be some good reasons for both and these are interesting me...





Now here's the problem I have (for anyone still following):

Procedure I followed:

1. Downloaded cygwin  with the following options (gcc make, binutils, gcc,
perl). [Is this list complete for what is absolutely necessary ? What is
your cygwin installation like, if yours works  ?)

2. Installed cygwin on computer

3. Copied binutils-2.12.tar.gz and gcc-3.0.4.tar.gz to computer in to
cygwin/tmp

4. Set up the following environment variables:
  cygwin$ host=i586-pc-cygwin              
  cygwin$ build=i586-pc-cygwin
  cygwin$ target=mcore-elf                             (Target is MCORE)
  cygwin$ prefix=/usr/local/mcore
  cygwin$ src_root=/usr/local/src/gnu

5. Extracted binutils and gcc new sources as follows
  cygwin$ cd $src_root
  cygwin$ tar zxf /tmp/gcc-2.95.2.tar.gz
  cygwin$ tar zxf /tmp/binutils-2.10.1.tar.gz

6. Build and install binutils for the mcore
  cygwin$ mkdir -p $src_root/BUILD/binutils
  cygwin$ cd $src_root/BUILD/binutils
  cygwin$ $src_root/binutils-2.10.1/configure \
    --with-included-gettext \
    --target=$target --host=$host --build=$build \
    --prefix=$prefix -v
  cygwin$ make > make.log 2>&1
  cygwin$ make install > install.log 2>&1

All works fine to here....

7. I set the path to the new binutils tools for Mcore
  cygwin$ export PATH=$PATH:$prefix/bin

This I check with   cygwin$ $target-ld --version, which returns GNU ld
version 2.12...(etc), as expected

8. Build GCC for mcore with

  cygwin$ mkdir -p $src_root/BUILD/gcc
  cygwin$ cd $src_root/BUILD/gcc
  cygwin$ $src_root/gcc-2.95.2/configure \
    --enable-languages=c,c++ \
    --with-included-gettext --enable-shared --enable-threads \
    --target=$target --host=$host --build=$build \
    --prefix=$prefix -v

  cygwin$ make > make.log 2>&1


This is where there are problems. libiberty is built fine and then some
other things, but then there is an abort.
Below is the content of make.log when I repeat make, where the first parts
are not repeated as they are already in place.


Maybe some one can see what is going wrong. I have added a couple of
comments at the right of the output where there may be something
fundamental:

Thanks if you find the time to help out, I would be grateful for any tips !

Cheers

Mark

=============================================================


make[1]: Entering directory `/usr/local/src/gnu/BUILD/gcc/libiberty'
make[2]: Entering directory
`/usr/local/src/gnu/BUILD/gcc/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory
`/usr/local/src/gnu/BUILD/gcc/libiberty/testsuite'
make[1]: Leaving directory `/usr/local/src/gnu/BUILD/gcc/libiberty'
make[1]: Entering directory `/usr/local/src/gnu/BUILD/gcc/gcc'
(cd intl && make all)
make[2]: Entering directory `/usr/local/src/gnu/BUILD/gcc/gcc/intl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/gnu/BUILD/gcc/gcc/intl'
(cd po && make all)
make[2]: Entering directory `/usr/local/src/gnu/BUILD/gcc/gcc/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/src/gnu/BUILD/gcc/gcc/po'
make GCC_FOR_TARGET="/usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include" \
  HOST_PREFIX="" HOST_PREFIX_1="loser-" \
  AR_FOR_TARGET="mcore-elf-ar" \
  AR_CREATE_FOR_TARGET="mcore-elf-ar  rc" \
  AR_FLAGS_FOR_TARGET="" \
  OLDCC="cc" CCLIBFLAGS="-O" \
  CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long" \
  RANLIB_FOR_TARGET="mcore-elf-ranlib" \
  RANLIB_TEST_FOR_TARGET="[ -f mcore-elf-ranlib ] || ( [ "i586-pc-cygwin" =
"mcore-unknown-elf" ] && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )" \
  NM_FOR_TARGET="/usr/local/mcore/mcore-elf/bin/nm.exe" AWK="gawk" \
  LIBGCC2_CFLAGS="-O2  -DCROSS_COMPILE -DIN_GCC   -DDONT_HAVE_STDIO
-DDONT_HAVE_SETJMP  -Dinhibit_libc  -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -O3
-DNO_FLOATLIB_FIXUNSDFSI  -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc" \
  INCLUDES="-I. -I. -I/usr/local/src/gnu/gcc-3.0.4/gcc
-I/usr/local/src/gnu/gcc-3.0.4/gcc/.
-I/usr/local/src/gnu/gcc-3.0.4/gcc/config
-I/usr/local/src/gnu/gcc-3.0.4/gcc/../include" MAYBE_USE_COLLECT2="" \
  CONFIG_H="config.h auto-host.h gansidecl.h
/usr/local/src/gnu/gcc-3.0.4/gcc/config/i386/xm-i386.h
/usr/local/src/gnu/gcc-3.0.4/gcc/config/i386/xm-cygwin.h defaults.h hwint.h
tm.h gansidecl.h /usr/local/src/gnu/gcc-3.0.4/gcc/config/mcore/mcore-elf.h
defaults.h insn-codes.h insn-flags.h" MACHMODE_H="machmode.h machmode.def"
\
  LIB1ASMSRC='mcore/lib1.asm' \
  MAKEOVERRIDES= \
  -f libgcc.mk all
make[2]: Entering directory `/usr/local/src/gnu/BUILD/gcc/gcc'
for d in libgcc big libgcc/big m210 libgcc/m210 big/m210 libgcc/big/m210;
do \
  if [ -d $d ]; then true; else mkdir $d; fi; \
done
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
make[2]: Leaving directory `/usr/local/src/gnu/BUILD/gcc/gcc'
echo timestamp > stmp-multilib
/usr/local/src/gnu/BUILD/gcc/gcc/xgcc -B/usr/local/src/gnu/BUILD/gcc/gcc/
-B/usr/local/mcore/mcore-elf/bin/ -B/usr/local/mcore/mcore-elf/lib/
-isystem /usr/local/mcore/mcore-elf/include -DCROSS_COMPILE -DIN_GCC  
-DDONT_HAVE_STDIO -DDONT_HAVE_SETJMP  -Dinhibit_libc  -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
    -c /usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:8: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:9: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:18: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:85: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:94: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:104: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:105: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:106: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:116: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:117: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:118: warning: function
declaration isn't a prototype
/usr/local/src/gnu/gcc-3.0.4/gcc/libgcc1-test.c:119: warning: function
declaration isn't a prototype
Testing libgcc1.  Ignore linker warning messages.
/usr/local/src/gnu/BUILD/gcc/gcc/xgcc -B/usr/local/src/gnu/BUILD/gcc/gcc/
-B/usr/local/mcore/mcore-elf/bin/ -B/usr/local/mcore/mcore-elf/lib/
-isystem /usr/local/mcore/mcore-elf/include -DCROSS_COMPILE -DIN_GCC  
-DDONT_HAVE_STDIO -DDONT_HAVE_SETJMP  -Dinhibit_libc  -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
 libgcc1-test.o -o libgcc1-test \
  -nostartfiles -nostdlib `/usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include --print-libgcc-file-name`
make[1]: Leaving directory `/usr/local/src/gnu/BUILD/gcc/gcc'
Configuring in mcore-elf/libstdc++-v3
loading cache ../config.cache
checking host system type... mcore-unknown-elf
checking target system type... mcore-unknown-elf
checking build system type... i586-pc-cygwin
checking whether ln -s works... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for Cygwin environment... (cached) no
checking for mingw32 environment... (cached) no
checking for working aclocal... missing                                  
[ARE THESE IMPORTANT - where do they come from ??]
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... found                                  
[THIS WAS MISSING BY PREVIOUS ATTEMPTS, BUT SEEMS TO BE FOUND
                                                                           
                AFTER INSTALLING THE CYGWIN PERL OPTION]

checking for gcc... (cached) /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include
checking whether we are using GNU C... (cached) yes
checking whether /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -B/usr/local/mcore/mcore-elf/bin/
-B/usr/local/mcore/mcore-elf/lib/ -isystem
/usr/local/mcore/mcore-elf/include accepts -g... (cached) yes
checking for c++... (cached) /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -nostdinc++ 
-L/usr/local/src/gnu/BUILD/gcc/mcore-elf/libstdc++-v3/src
-L/usr/local/src/gnu/BUILD/gcc/mcore-elf/libstdc++-v3/src/.libs
-B/usr/local/mcore/mcore-elf/bin/ -B/usr/local/mcore/mcore-elf/lib/
-isystem /usr/local/mcore/mcore-elf/include
checking whether we are using GNU C++... (cached) yes
checking whether /usr/local/src/gnu/BUILD/gcc/gcc/xgcc
-B/usr/local/src/gnu/BUILD/gcc/gcc/ -nostdinc++ 
-L/usr/local/src/gnu/BUILD/gcc/mcore-elf/libstdc++-v3/src
-L/usr/local/src/gnu/BUILD/gcc/mcore-elf/libstdc++-v3/src/.libs
-B/usr/local/mcore/mcore-elf/bin/ -B/usr/local/mcore/mcore-elf/lib/
-isystem /usr/local/mcore/mcore-elf/include accepts -g... (cached) yes
checking for mcore-elf-as... (cached) /usr/local/mcore/mcore-elf/bin/as.exe
checking for mcore-elf-ar... (cached) mcore-elf-ar
checking for mcore-elf-ranlib... (cached) mcore-elf-ranlib
checking for a BSD compatible install... /usr/bin/install -c
checking whether to enable maintainer-specific portions of Makefiles... no
CPU config directory is config/cpu/generic
OS config directory is config/os/generic
checking for ld used by GCC... (cached)
/usr/local/mcore/mcore-elf/bin/ld.exe
checking if the linker (/usr/local/mcore/mcore-elf/bin/ld.exe) is GNU ld...
(cached) yes
checking for /usr/local/mcore/mcore-elf/bin/ld.exe option to reload object
files... (cached) -r
checking for BSD-compatible nm... (cached)
/usr/local/mcore/mcore-elf/bin/nm.exe
checking how to recognise dependant libraries... (cached) unknown
checking for object suffix... (cached) o
checking for mcore-elf-ranlib... (cached) mcore-elf-ranlib
checking for mcore-elf-strip... (cached) mcore-elf-strip
checking how to run the C++ preprocessor... (cached) /lib/cpp
updating cache ../config.cache
loading cache ../config.cache within ltconfig
checking whether -lc should be explicitly linked in... (cached) yes
checking for objdir... .libs
checking for /usr/local/src/gnu/BUILD/gcc/gcc/xgcc option to produce PIC...
 -fPIC -DPIC
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc PIC flag  -fPIC -DPIC
works... (cached) yes
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc static flag  works...
(cached) no
finding the maximum length of command line arguments... (cached) 393217
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc supports -c -o file.o...
(cached) yes
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc supports -fno-rtti
-fno-exceptions ... yes
checking whether the linker (/usr/local/mcore/mcore-elf/bin/ld.exe)
supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... no
checking command to parse /usr/local/mcore/mcore-elf/bin/nm.exe output...
failed   [IS THIS THE BASIC PROBLEM ?]
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
creating libtool
updating cache ../config.cache
loading cache ../config.cache
loading cache ../config.cache within ltconfig
checking host system type... mcore-unknown-elf
checking build system type... i586-pc-cygwin
checking for objdir... .libs
checking for /usr/local/src/gnu/BUILD/gcc/gcc/xgcc option to produce PIC...
-fPIC -DPIC
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc PIC flag -fPIC -DPIC
works... yes
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc static flag -static
works... no
finding the maximum length of command line arguments... (cached) 393217
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc supports -c -o file.o...
(cached) yes
checking if /usr/local/src/gnu/BUILD/gcc/gcc/xgcc supports -fno-rtti
-fno-exceptions ... yes
checking whether the linker (/usr/local/mcore/mcore-elf/bin/ld.exe)
supports shared libraries... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... no
checking command to parse /usr/local/mcore/mcore-elf/bin/nm.exe output...
failed
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
appending configuration tag "CXX" to libtool
checking for GNU make... make
checking how to run the C preprocessor... /lib/cpp
checking for cstdio to use... stdio
checking for clocale to use... generic
checking for ISO C99 support in <math.h>... no
checking for ISO C99 support in <stdio.h>... no
checking for lldiv_t declaration... no
checking for ISO C99 support in <stdlib.h>... no
checking for additional ISO C99 support in <wchar.h>... no
checking for enabled ISO C99 support... no
checking for enabled long long I/O support... no
checking for c header strategy to use... c_std
checking for thread model used by GCC... single
checking for exception model to use... configure: error: unable to detect
exception model   [WHAT DOES THIS MEAN ? IS THERE A CONNECTION
                                                                           
                                                       WITH nm.exe failed ?
I DO HAVE nm.exe AT THE
                                                                           
                                                       LOCATION
/usr/local/mcore/mcore-elf/bin]

make: *** [configure-target-libstdc++-v3] Error 1                          
                                   [    SHAME...    ]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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