none
install gcc (Migrated from community.research.microsoft.com)

    質問

  • Hello

    I am a new user of empis and i just have started to following the manual.

    I have downloaded the gcc 4.2.0 from ftp://ftp.gnu.org/../gnu/gcc/gcc-4.2.0/ and i have extracted it by the command tar -xf gcc-4.2.0.tar than i have run the command ./configure --prefix=/emips --with-divide=breaks --enable-languages=c,c++ --target=mips-elf.

    Than when i run : make bootstrap i  have an error

    config.status: executing default commands
    Bootstrapping the compiler
    make[1]: Entering directory `/cygdrive/c/GNU/gcc-4.2.0/gcc'
    make[1]: *** No rule to make target `bootstrap'.  Stop.
    make[1]: Leaving directory `/cygdrive/c/GNU/gcc-4.2.0/gcc'
    make: *** [bootstrap] Error 2

    HAve anyone an idea about this error

    thanks in advance

    REPLY:

     

    I did this many years ago and I am sorry, I do not remember much about it.

    I used cygwin (same as you I think).  I think you need to build the BFD also.  I also built GDB. If you put them all in the same place the build will build everything.

    Did you try to just "make".

    Good luck.

    sandro-

    REPLY:

    Hello

    Sorry as i am new user of unix and Emips i can't understand clearly

    have i a mistake in my command ???

    REPLY:

    Building GCC is not trivial, especially if you are not very familiar with Unix. Be patient.

    This page http://ecos.sourceware.org/tools/win-vr4300-elf.html  has some very old instructions for building something similar to what you want.  See if there is something there that helps you understand better.  For instance, the switches "--with-gnu-as --with-gnu-ld" seem familiar.

    I did find in my logs that I built our current chain in July 2007, but I do not have the specific steps I performed. I will look around if I can find the machine where I built.  But I doubt I did anything very strange.

    I did find a note with the following change I applied to GDB:

    diff -c \gnu\gcc-4.2.0\gdb/mips-tdep.c ./mips-tdep.c

    *** \gnu\gcc-4.2.0\gdb/mips-tdep.c      Thu Jul 26 20:02:41 2007

    --- ./mips-tdep.c       Tue Aug 08 14:32:37 2006

    ***************

    *** 5151,5157 ****

        set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_trampoline_code);

     

        set_gdbarch_single_step_through_delay (gdbarch, mips_single_step_through_delay);

    -   set_gdbarch_software_single_step (gdbarch, mips_software_single_step); 

     

        /* Hook in OS ABI-specific overrides, if they have been registered.  */

        gdbarch_init_osabi (info, gdbarch);

    --- 5151,5156 ----

     

     However these changes only apply to the debugger, not to the compiler/linker.

    REPLY:

    By the way, in the manual I wrote "After you have configured all packages, a single make command should build everything for you. "  I did not say to "make bootstrap", just "make". Again.. first unpack all of GCC, binutils and GDB, then configure, then make. 

    Things change in 4 years. So unless you have exactly the same version of the same packages I described in the manual you might get into problems.  Usually though, things change for the better.

     

    REPLY:

    Hello Thanks , but what i can understand is the difference between the package gcc installed during the install of cygwin and the Gcc 4.2.0 installled with the command configure and make.

    Is there a recent manual for installling and  using emips ??

    Thanks in advance

    REPLY:

    The instructions for GCC have not changed in the latest manual, because the GCC we use has not changed. The latest manual is available in the latest eMIPS release (last month).

    The GCC from cygwin is a "native" compiler. It runs on x86-Windows and produces code for the x86, for Windows. 

    The GCC 4.2.0 for eMIPS is a "cross" compiler. It runs on x86-Windows and produces code for MIPS.

    When you configure and make you are building the cross compiler, using the native compiler.  You will then run the cross compiler to create binaries to run on an eMIPS system.

    The cross compiler alone is not sufficient to build eMIPS binaries.  You also need an assembler, a linker, and other utilities. This is why you also want to get the "binutils" package, and build a cross version of that too.  Similarly for the debugger, GDB.

    Since the three elements (GCC, binutils, GDB) are so closely related, their developers have set things up so that you can build them all at once.

    Hope this helps.

    REPLY:

    Thanks sandrof

    I hope .

    REPLY:

    Helo

    Ok i see there are three element to install : GCC, binutils and GDB

    for each element i install as follow

    in usr/src

    mkdir objdir

    cd objdir

     ../element (gcc , binutils ,gdb)/configure --prefix=/emips --with-divide=breaks --enable-languages=c,c++ --target=mips-elf --with-gnu-ld --with-gnu-as

    make

    make install

    for binutils i didnt obtain an error

    but for gdb and gcc i obtain these errors

    for GCC

    /usr/src/gcc-build/./gcc/as: line 2: exec: -E: invalid option exec: usage: exec [-cl] [-a name] file [redirection ...] make[4]: *** [crti.o] Error 1 make[4]: *** Waiting for unfinished jobs.... /usr/src/gcc-build/./gcc/as: line 2: exec: -E: invalid option exec: usage: exec [-cl] [-a name] file [redirection ...] make[4]: *** [crtn.o] Error 1 make[4]: Leaving directory `/usr/src/gcc-build/gcc' make[3]: *** [extra] Error 2 make[3]: Leaving directory `/usr/src/gcc-build/gcc' make[2]: *** [stmp-multilib] Error 2 make[2]: Leaving directory `/usr/src/gcc-build/gcc' make[1]: *** [all-gcc] Error 2 make[1]: Leaving directory `/usr/src/gcc-build' make: *** [all] Error 2

    gor GDB

    checking for library containing tgetent... no
    configure: error: no termcap library found
    make[1]: *** [configure-gdb] Error 1
    make[1]: Leaving directory `/usr/src/gdb-build'
    make: *** [all] Error 2

    I can't see how  can i resolve these problem!!

    have you an idea

    you have said "" their developers have set things up so that you can build them all at once"""  how can i do this??

     

    Thanks in advance

     

    REPLY:

    Your first problem is that you do not have all the necessary Cygwin packages. Specifically: libtermcap.a.

    The quick answer is that you need to install the additional package Devel::libncurses-devel.

    The longer answer is here:  http://cygwin.com/ml/cygwin/2010-10/msg00018.html

     

    If you look at the eMIPS manual, you will see a list of packages listed in Section 2.3.1.1.

    That list was good with the Cygwin of that time.. but things change.

    I just installed the latest Cygwin (Setup.exe version 2.738) and went through that same list.

    There are a few differences, but I could select almost all the packages listed in the manual.

    There are often newer versions of some of the libraries, I picked the latest.

     

    I found the place where I built in 2007, and reproduced the steps I took back then.

    Here they are.

     

    # First copy the tarballs in c:/cygwin/usr/src, then run bash and..

    cd /usr/src

    mkdir emips

    tar xf /usr/src/gcc-4.2.0.tar

    tar xf /usr/src/binutils-2.17.tar

    tar xf /usr/src/gdb-6.6.tar

    cd gcc-4.2.0

    for i in bfd binutils cpu etc ld gas opcodes texinfo;

        do mv /usr/src/binutils-2.17/$i ./$i; done

    for i in aout coff elf gdb nlm opcode;

        do mv /usr/src/binutils-2.17/include/$i ./include/$i; done

    cp -n /usr/src/binutils-2.17/include/* include/

    for i in gdb readline sim;

        do mv /usr/src/gdb-6.6/$i ./$i;done

    cd ../emips

    ../gcc-4.2.0/configure --prefix=/emips --with-divide=breaks --target=mips-elf --enable-languages=c,c++ --with-included-gettext

    make

     

    The script above uses “mv” to simply move the extra stuff over. You can use other strategies (ln, cpio, tar, whatever).

    This  is the strategy in the GCC build page when they say “if they have been .. moved into the top level GCC source tree before configuring.

     

    Turns out the three packages have a slight disagreement about internationalization.

    That problem did not show up with the Cygwin I was using at the time.

    With the current Cygwin two of those packages (GCC, GDB) are ok with Cygwin’s libintl.a, but binutils is not.

    The result is a build failure in binutils, linking size.exe we find we do not have the file “./../intl/libintl.a” 

    I fixed this by adding the “--with-included-gettext” option above.

    That is the only difference from what the manual says.

     

    A better solution is to get a later version of the binutils, one that uses “configure” scripts closer to GCC’s.

    I made a quick check, and I found that version 2.18 of the binutils contains the same “intl” directory as GCC 4.2.0.

    That makes me think it is a better match for the other two packages. But I am not going to test this.

     

    With these refreshers I was able to rebuild all the files listed in the manual.

    Note that the build will actually fail trying to build the runtime libraries for C++:

                   configure: error: No support for this host/target combination.

    This is expected, because those libraries require some form of operating system support.

     

    Good luck.

    sandro-

     

    REPLY:

    Hello ,

    thanks for yor reply

    when i run

    for i in bfd binutils cpu etc ld gas opcodes texinfo;

        do mv /usr/src/binutils-2.17/$i ./$i; done


     i obtain

    mv: cannot stat `/usr/src/binutils-2.10.1/bfd': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/binutils': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/cpu': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/etc': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/ld': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/gas': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/opcodes': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/texinfo': No such file or directory

     

    also when i run

    for i in aout coff elf gdb nlm opcode;

        do mv /usr/src/binutils-2.17/include/$i ./include/$i; done

     

    i obtain

     mv: cannot stat `/usr/src/binutils-2.10.1/aout': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/coff': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/elf': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/gdb': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/nlm': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.10.1/opcode': No such file or directory

     

    what is the problem to not find these drectory ?!!!

    REPLY:

    hello

    when i run 

    $ for i in bfd binutils cpu etc ld gas opcodes texinfo ; do mv /usr/src/binutil
    s-2.17/$i ./$i; done
    mv: cannot stat `/usr/src/binutils-2.17/bfd': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/binutils': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/cpu': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/etc': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/ld': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/gas': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/opcodes': No such file or directory
    mv: cannot stat `/usr/src/binutils-2.17/texinfo': No such file or directory

    also i have the same problem when i run 

    $ for i in aout coff elf gdb nlm opcode;

    do mv /usr/src/binutils-2.10.1/$i ./$i; done

    what is the problem to not find these directory

     

     

    2011年6月22日 18:02

すべての返信

  • REPLY:

    Let me comment the steps and perhaps you will figure out what you did differently.

    cd /usr/src

    We will put everything in /usr/src, so that is where we start from.

    In my case that directory is empty before I start.

      

    mkdir emips

    This is the directory where all our build files go. If you have created that directory before delete it and make it again. It must be empty.

    NB: We are staying in /usr/src.

      

    tar xf /usr/src/gcc-4.2.0.tar

    Unpack the sources for GCC. This creates /usr/src/gcc-4.2.0.

    If you had done that before delete the previous directory and unpack again.

      

    tar xf /usr/src/binutils-2.17.tar

    Same for the binutils. This creates /usr/src/binutils-2.17.

    At this point you can check that those directories {bfd binutils...) are there, e.g. do an "ls binutils-2.17"

      

    tar xf /usr/src/gdb-6.6.tar

    Same for GDB. Creates /usr/src/gdb-6.6

      

    cd gcc-4.2.0

    Now we add the additional stuff from binutils,gdb into the GCC source subtree.

      

    for i in bfd binutils cpu etc ld gas opcodes texinfo;

        do mv /usr/src/binutils-2.17/$i ./$i; done

    .....

      

    Move the extra dirs for the binutils.  Note that mv(1) is not a copy: if you try this again the directories will be gone.

    At the end of the various moving my GCC directory looks like this:

      

    $ ls -F /usr/src/gcc-4.2.0
    ABOUT-NLS           boehm-gc/      gnattools/        ltcf-c.sh
    BUGS                bugs.html      include/          ltcf-cxx.sh
    COPYING             compile        install-sh*       ltcf-gcj.sh
    COPYING.LIB         config/        intl/             ltconfig*
    ChangeLog           config-ml.in   ld/               ltmain.sh
    ChangeLog.tree-ssa  config.guess*  libada/           maintainer-scripts/
    FAQ                 config.rpath*  libcpp/           missing*
    INSTALL/            config.sub*    libdecnumber/     mkdep*
    LAST_UPDATED        configure*     libffi/           mkinstalldirs*
    MAINTAINERS         configure.in   libgfortran/      move-if-change*
    MD5SUMS             contrib/       libgomp/          opcodes/
    Makefile.def        cpu/           libiberty/        readline/
    Makefile.in         depcomp*       libjava/          sim/
    Makefile.tpl        etc/           libmudflap/       symlink-tree*
    NEWS                faq.html       libobjc/          texinfo/
    README              fixincludes/   libssp/           ylwrap*
    README.SCO          gas/           libstdc++-v3/     zlib/
    bfd/                gcc/           libtool-ldflags*
    binutils/           gdb/           libtool.m4


    ..and my binutils looks like this:

      

    $ ls -F /usr/src/binutils-2.17
    COPYING       config-ml.in   include/     ltcf-gcj.sh   mkinstalldirs*
    COPYING.LIB   config.guess*  install-sh*  ltconfig*     move-if-change*
    Makefile.def  config.sub*    intl/        ltmain.sh     setup.com
    Makefile.in   configure*     libiberty/   makefile.vms  src-release
    Makefile.tpl  configure.in   libtool.m4   md5.sum       symlink-tree*
    README        gettext.m4     ltcf-c.sh    missing*      ylwrap*
    config/       gprof/         ltcf-cxx.sh  mkdep*

     

    REPLY:

    Hello

    I already installed the packages listed in the manual.

    I have proceeded as you described to install the GCC, GDB and binutils2.18 but i still have an error . i have the woking to install  the package texinfo that is already installed.

    The message is :

    WARNING: `makeinfo' is missing on your system.  You should only need it if
             you modified a `.texi' or `.texinfo' file, or any other file
             indirectly affecting the aspect of the manual.  The spurious
             call might also be the consequence of using a buggy `make' (AIX,
             DU, IRIX).  You might want to install the `Texinfo' package or
             the `GNU make' package.  Grab either from any GNU archive site.
    make[3]: *** [bfd.info] Error 1
    make[3]: Leaving directory `/usr/src/emips/bfd/doc'
    Making info in po
    make[3]: Entering directory `/usr/src/emips/bfd/po'
    ( if test 'x../../../gcc-4.2.0/bfd/po' != 'x.'; then \
                posrcprefix='../../../gcc-4.2.0/bfd/'; \
              else \
                posrcprefix="../"; \
              fi; \
              rm -f SRC-POTFILES-t SRC-POTFILES \
                && (sed -e '/^#/d' \
                        -e '/^[     ]*$/d' \
                        -e "s@.*@   $posrcprefix& \\\\@" < ../../../gcc-4.2.0/bfd/po
    /SRC-POTFILES.in \
                    | sed -e '$s/\\$//') > SRC-POTFILES-t \
                && chmod a-w SRC-POTFILES-t \
                && mv SRC-POTFILES-t SRC-POTFILES )
    ( rm -f BLD-POTFILES-t BLD-POTFILES \
                && (sed -e '/^#/d' \
                        -e '/^[     ]*$/d' \
                        -e "s@.*@   ../& \\\\@" < ../../../gcc-4.2.0/bfd/po/BLD-POTF
    ILES.in \
                    | sed -e '$s/\\$//') > BLD-POTFILES-t \
                && chmod a-w BLD-POTFILES-t \
                && mv BLD-POTFILES-t BLD-POTFILES )
    cd .. \
              && CONFIG_FILES=po/Makefile.in:po/Make-in \
                 CONFIG_HEADERS= /bin/sh ./config.status
    config.status: creating po/Makefile.in
    config.status: executing depfiles commands
    config.status: executing libtool commands
    config.status: executing default-1 commands
    config.status: executing bfd_stdint.h commands
    config.status: executing default commands
    make[3]: Leaving directory `/usr/src/emips/bfd/po'
    make[3]: Entering directory `/usr/src/emips/bfd/po'
    make[3]: Nothing to be done for `info'.
    make[3]: Leaving directory `/usr/src/emips/bfd/po'
    make[3]: Entering directory `/usr/src/emips/bfd'
    make[3]: Nothing to be done for `info-am'.
    make[3]: Leaving directory `/usr/src/emips/bfd'
    make[2]: *** [info-recursive] Error 1
    make[2]: Leaving directory `/usr/src/emips/bfd'
    make[1]: *** [all-bfd] Error 2
    make[1]: Leaving directory `/usr/src/emips'
    make: *** [all] Error 2

    I Can't see what these problem??!

    REPLY:

     

    >  I already installed the packages listed in the manual.

    Actually, you did not:

     

    REPLY:

    I mind that this package is installed. In fact , when i run the cygwin install, behind Doc,texinfo and text,texinfi i find 'keep'.

    This mean that this package is installed

    REPLY:

    The error message you reported said unequivocably that "makeinfo" did not exist on your system. That was the fix for such an error.

    You can verify what you have/have not installed in the following way:

    $ which makeinfo
    /usr/bin/makeinfo

    $ cygcheck -c
    Cygwin Package Information
    Package              Version             Status
    _update-info-dir     00940-1             OK
    alternatives         1.3.30c-10          OK
    autoconf             9-1                 OK
    autoconf2.1          2.13-10             OK
    autoconf2.5          2.67-1              OK
    base-cygwin          3.0-1               OK
    base-files           3.9-3               OK
    base-passwd          3.1-2               OK
    bash                 3.2.51-24           OK
    bc                   1.06-2              OK
    binutils             2.20.51-2           OK
    bison                2.4.2-1             OK
    byacc                1.9-1               OK
    bzip2                1.0.6-1             OK
    coreutils            8.8-1               OK
    cpio                 2.11-1              OK
    crypt                1.1-1               OK
    cvs                  1.12.13-10          OK
    cvs2svn              2.3.0-1             OK
    cvsps                2.2b1-1             OK
    cvsutils             0.2.5-1             OK
    cygutils             1.4.4-1             OK
    cygwin               1.7.7-1             OK
    cygwin-doc           1.7-1               OK
    dash                 0.5.6.1-2           OK
    dejagnu              20021217-2          OK
    diffutils            2.9-1               OK
    editrights           1.01-2              OK
    expect               20030128-1          OK
    findutils            4.5.9-2             OK
    flex                 2.5.35-1            OK
    gawk                 3.1.8-1             OK
    gcc                  3.4.4-999           OK
    gcc-core             3.4.4-999           OK
    gcc-g++              3.4.4-999           OK
    gcc-g77              3.4.4-999           OK
    gcc-gdc              3.4.4-999           OK
    gcc-mingw-core       20050522-1          OK
    gcc-mingw-g++        20050522-1          OK
    gcc-mingw-g77        20050522-1          OK
    gcc-mingw-gdc        20050522-1          OK
    gdb                  6.8-2               OK
    gettext              0.17-11             OK
    grep                 2.6.3-1             OK
    groff                1.20.1-2            OK
    gzip                 1.3.12-2            OK
    ipc-utils            1.0-1               OK
    less                 436-1               OK
    libapr1              1.4.2-1             OK
    libaprutil1          1.3.10-1            OK
    libattr1             2.4.43-1            OK
    libbz2_1             1.0.6-1             OK
    libdb4.5             4.5.20.2-2          OK
    libexpat0            1.95.8-2            OK
    libexpat1            2.0.1-1             OK
    libffi4              4.3.4-3             OK
    libgcc1              4.3.4-3             OK
    libgdbm              1.8.0-5             OK
    libgdbm-devel        1.8.3-20            OK
    libgdbm4             1.8.3-20            OK
    libgmp3              4.3.1-3             OK
    libiconv2            1.13.1-1            OK
    libintl2             0.12.1-3            OK
    libintl3             0.14.5-1            OK
    libintl8             0.17-11             OK
    liblzma1             4.999.9beta-11      OK
    libncurses-devel     5.7-18              OK
    libncurses10         5.7-18              OK
    libncurses8          5.5-10              OK
    libncurses9          5.7-16              OK
    libncursesw-devel    5.7-18              OK
    libncursesw10        5.7-18              OK
    libneon27            0.29.3-1            OK
    libopenldap2_3_0     2.3.43-1            OK
    libopenssl098        0.9.8q-1            OK
    libpcre0             8.02-1              OK
    libpopt0             1.6.4-4             OK
    libpq5               8.2.11-1            OK
    libproxy0            0.2.3-2             OK
    libreadline6         5.2.14-12           OK
    libreadline7         6.0.3-2             OK
    libsasl2             2.1.23-1            OK
    libserf0_1           0.7.0-1             OK
    libsigsegv2          2.8-1               OK
    libsqlite3_0         3.7.3-1             OK
    libssp0              4.3.4-3             OK
    libstdc++6           4.3.4-3             OK
    libxml2              2.7.7-1             OK
    login                1.10-10             OK
    m4                   1.4.15-1            OK
    make                 3.81-2              OK
    man                  1.6f-1              OK
    mingw-bzip2          1.0.5-10            OK
    mingw-libbz2-devel   1.0.5-10            OK
    mingw-libbz2_1       1.0.5-10            OK
    mingw-runtime        3.18-1              OK
    minires              1.02-1              OK
    perl                 5.10.1-5            OK
    python               2.6.5-2             OK
    rebase               3.0.1-1             OK
    run                  1.1.12-11           OK
    sed                  4.2.1-1             OK
    subversion           1.6.15-1            OK
    tar                  1.25-1              OK
    tcltk                20080420-1          OK
    termcap              5.7_20091114-14     OK
    terminfo             5.7_20091114-14     OK
    terminfo-extra       5.7_20091114-14     OK
    terminfo0            5.5_20061104-12     OK
    terminfo0-extra      5.5_20061104-12     OK
    texinfo              4.13-3              OK
    tzcode               2010j-1             OK
    w32api               3.15-1              OK
    which                2.20-2              OK
    xz                   4.999.9beta-11      OK
    zlib0                1.2.5-1             OK

    The above is the status of my current system, the one I used for building in the previous posts. My portable runs Windows7 Enterprise, Cygwin is version 2.738.  

    It may be that something else is amiss with your cygwin. If that is the case, a good idea is to remove it (unistall) from your system, and then restart from scratch. I would definitely do that if you had "upgraded" cygwin from previous versions.

    Please let me note that none of these software and procedures have anything to do with Microsoft or Microsoft Research. I am only a user of these software just like you, not their provider or a consultant. I am volunteering my time and whatever information I have about them to help make you successful with our project, eMIPS.

    REPLY:

    Hello

    i am sorry to disturb you but i can't find a response to my question in internet.

    I checked with the command cygcheck and i find the texinfo installed.

    Also i  work in windows 7 and the cygwin version is 2.738 .

    I note that in cygwin/bin   the texinfo is not there. Normally if the pckage is installed i have to find it in this directory !!!

    Is there a command of library or other command that you forget to note it :(((
    I'm sorry

     

    REPLY:

    Your best option is to unistall cygwin and start from scratch.

    2011年6月22日 18:03