gmon.c compile failure building cross compiler linux->solaris2

John C. Ruttenberg rutt@tensilica.com
Fri Mar 27 12:13:00 GMT 1998


Here are the steps I followed to build my cross compiler:
     
    mkdir ~/cross
    mkdir ~/cross/sparc-sun-solaris2
    mkdir src
    cd src
    tar xfz ~/tmp/egcs-1.0.2.tar.gz
    tar xfz ~/tmp/binutils-2.8.1.tar.gz
    tar xfz ~/tmp/newlib-1.8.0.tar.gz
    cd newlib
    cp -r newlib/libc/include/ ~/cross/sparc-sun-solaris2/  ## Required??
    cd binutils-2.8.1
    configure --target=sparc-sun-solaris2 --host=i686-linux \
              --prefix=/home/rutt/cross/sparc-elf \
              --with-headers=/home/rutt/cross/sparc-elf/include \
              --with-newlib --with-gnu-as
    make all install
    cd ../egcs-1.0.2
    mkdir sparc-sun-solaris2
    cd sparc-sun-solaris2
    ../configure --target=sparc-sun-solaris2 --host=i686-linux \
                 --prefix=/home/rutt/cross/sparc-sun-solaris2 \
                 --with-headers=/home/rutt/cross/sparc-sun-solaris2/include \
                 --with-newlib -with-gnu-ld
    make CFLAGS=-g cross install
    ####
    #### This gets an error trying to build gmon.o that looks like "PATH_MAX"
    #### undeclared.  See below for the full text of the error message.
    cd gcc
    touch gmon.o
    cd ..
    make CFLAGS=-g cross install
    #### This time it completes without an error

    cd ../../newlib-1.8.0
    configure --target=sparc-sun-solaris2 --host=i686-linux \
              --prefix=/home/rutt/cross/sparc-elf \
              --with-headers=/home/rutt/cross/sparc-elf/include \
              --with-newlib --with-gnu-as
    make all install


Here is the text of the error message:

    ../../gcc/config/sparc/gmon-sol2.c: In function `_mcleanup':
    ../../gcc/config/sparc/gmon-sol2.c:187: `PATH_MAX' undeclared (first use this function)
    ../../gcc/config/sparc/gmon-sol2.c:187: (Each undeclared identifier is reported only once
    ../../gcc/config/sparc/gmon-sol2.c:187: for each function it appears in.)
    make[1]: *** [gmon.o] Error 1
    make[1]: Leaving directory `/home/rutt/src/egcs-1.0.2/sparc-sun-solaris2/gcc'
    make: *** [cross] Error 2



More information about the Gcc-bugs mailing list