Error building my own toolchain

Sysprogs forums Forums Other tools & products Error building my own toolchain

This topic contains 11 replies, has 3 voices, and was last updated by  ket 5 years, 9 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #624

    Sgalperin
    Participant

    I have been trying to follow the “Building You Own GNU Toolchain” example and I’m getting an error that I don’t understand.

    I installed MinGW and Msys per the instructions. Then I downloaded binutils-2.23.0 from the GNU archive. I created the directories and did the configure and make commands per the tutorial, and I get the following error:

    checking whether to build shared libraries… yes
    checking whether to build static libraries… yes
    checking how to run the C++ preprocessor… /lib/cpp
    configure: error: in /c/gnu/binutils-2.23.0-build/ld’:
    configure: error: C++ preprocessor “/lib/cpp” fails sanity check
    See
    config.log’ for more details.
    make[1]: *** [configure-ld] Error 1
    make[1]: Leaving directory `/c/gnu/binutils-2.23.0-build’
    make: *** [all] Error 2

    config.log has the following:

    configure:4616: $? = 0
    configure:4605: g++ -v >&5
    Using built-in specs.
    COLLECT_GCC=c:SysGCCpowerpc-eabipowerpc-eabibing++.exe
    Target: powerpc-eabi
    Configured with: ../gcc-4.8.0/configure –target powerpc-eabi –enable-win32-registry=SysGCC-powerpc-eabi-4.8.0 –prefix /q/gnu/auto/bu-2.23.1+gcc-4.8.0+gmp-4.2.4+mpfr-2.4.1+mpc-0.8+newlib-2.0.0-powerpc-eabi/ –enable-languages=c,c++ –disable-nls –disable-shared –with-newlib –with-headers=../newlib-2.0.0/newlib/libc/include –enable-interwork –enable-multilib –with-float=soft : (reconfigured) ../gcc-4.8.0/configure –target powerpc-eabi –enable-win32-registry=SysGCC-powerpc-eabi-4.8.0 –prefix /q/gnu/auto/bu-2.23.1+gcc-4.8.0+gmp-4.2.4+mpfr-2.4.1+mpc-0.8+newlib-2.0.0-powerpc-eabi/ –enable-languages=c,c++ –disable-nls –disable-shared –with-newlib –with-headers=../newlib-2.0.0/newlib/libc/include –enable-interwork –enable-multilib –with-float=soft
    Thread model: single
    gcc version 4.8.0 (GCC)
    configure:4616: $? = 0
    configure:4605: g++ -V >&5
    g++.exe: error: unrecognized command line option ‘-V’
    g++.exe: fatal error: no input files
    compilation terminated.
    configure:4616: $? = 1
    configure:4605: g++ -qversion >&5
    g++.exe: error: unrecognized command line option ‘-qversion’
    g++.exe: fatal error: no input files
    compilation terminated.
    configure:4616: $? = 1
    configure:4620: checking whether we are using the GNU C++ compiler
    configure:4639: g++ -c conftest.cpp >&5
    g++.exe: error: CreateProcess: No such file or directory
    configure:4639: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME “”
    | #define PACKAGE_TARNAME “”
    | #define PACKAGE_VERSION “”
    | #define PACKAGE_STRING “”
    | #define PACKAGE_BUGREPORT “”
    | #define PACKAGE_URL “”
    | /* end confdefs.h. */
    |
    | int
    | main ()
    | {
    | #ifndef __GNUC__
    | choke me
    | #endif
    |
    | ;
    | return 0;
    | }

    Any idea what this is about?

    #2584

    ket
    Participant

    Hi,

    The problem lies here:

    COLLECT_GCC=c:SysGCCpowerpc-eabipowerpc-eabibing++.exe

    You should be using the MinGW’s gcc to build the cross-toolchain as you are trying to build a cross-toolchain that will be run on Windows not on PowerPC. Furthermore, make sure that there are no other gnu toolchains on the PATH that could confuse the build process. Do not forget to set the target to powerpc-wrs-vxworks instead of arm-eabi as in the example.

    #2586

    Sgalperin
    Participant

    How does COLLECT_GCC get set?

    #2585

    ket
    Participant

    Hi,

    Check that there are no other GNU toolchain directories defined on the PATH variable. Make sure to build the toolchain from within MinGW shell.

    #2587

    Sgalperin
    Participant

    OK, got all the extraneous compilers out of the path, including cc.exe in the MinGWbin directory.

    Now it’s asking for GMP, MPFR and MPC. I’m assuming that they need the same style directory structure that I used for binuitls and gcc. However they don’t take the –target option on configure. Any suggestions?

    #2588

    ket
    Participant

    Hi,

    Simply extract those libraries to the respective GMP, MPFR and MPC directories under the built gcc directory. GCC will then configure and build them automatically as a part of its own build process.

    #2589

    Sgalperin
    Participant

    OK. I have everything downloaded and put in directories as advised by the folks at GNU. When make goes into the ./libcpp directory it errors out. Here is the display:

    configure: loading cache ./config.cache
    checking build system type… i686-pc-mingw32
    checking host system type… i686-pc-mingw32
    checking target system type… powerpc-ibm-eabi
    checking whether make sets $(MAKE)… yes
    checking for a BSD-compatible install… /bin/install -c
    checking for i686-pc-mingw32-gcc… gcc
    checking for C compiler default output file name… a.exe
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables… .exe
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking whether we are using the GNU C++ compiler… no
    checking whether g++ accepts -g… no
    checking for i686-pc-mingw32-ranlib… ranlib
    checking how to run the C preprocessor… gcc -E
    checking for grep that handles long lines and -e… /bin/grep
    checking for egrep… /bin/grep -E
    checking for ANSI C header files… yes
    checking for sys/types.h… yes
    checking for sys/stat.h… yes
    checking for stdlib.h… yes
    checking for string.h… yes
    checking for memory.h… yes
    checking for strings.h… yes
    checking for inttypes.h… yes
    checking for stdint.h… yes
    checking for unistd.h… yes
    checking minix/config.h usability… no
    checking minix/config.h presence… no
    checking for minix/config.h… no
    checking whether it is safe to define __EXTENSIONS__… yes
    checking for special C compiler options needed for large files… no
    checking for _FILE_OFFSET_BITS value needed for large files… unknown
    checking for _LARGE_FILES value needed for large files… unknown
    checking for aclocal… no
    checking for autoconf… no
    checking for autoheader… no
    checking whether gcc supports -W… yes
    checking whether gcc supports -Wall… yes
    checking whether gcc supports -Wnarrowing… no
    checking whether gcc supports -Wwrite-strings… yes
    checking whether gcc supports -Wmissing-format-attribute… yes
    checking whether gcc supports -Wstrict-prototypes… yes
    checking whether gcc supports -Wmissing-prototypes… yes
    checking whether gcc supports -Wold-style-definition… yes
    checking whether gcc supports -Wc++-compat… yes
    checking whether gcc supports -pedantic -Wlong-long… yes
    checking whether gcc supports -fno-exceptions… yes
    checking whether gcc supports -fno-rtti… yes
    configure: error: C++ compiler missing or inoperational
    make[1]: *** [configure-libcpp] Error 1
    make[1]: Leaving directory `/c/gnu/gcc-4.8.1-build’
    make: *** [all] Error 2

    #2590

    ket
    Participant

    Hi,

    Look into config.log for the exact cause of the error. The compiler is probably complaining about missing headers, you need to copy the system headers from your vxworks powerpc target to either sysrootusrinclude if you are using sysroot or include if not. The location depends on how it is done for vxworks powerpc.

    #2593

    Sgalperin
    Participant

    The source of the error appears to be in the build for the std lib. It’s looking for g++ as a compiler which isn’t in the MinGW distribution.

    From config.log in the libcpp directory:

    configure:4850: result: yes
    configure:4901: g++ -c conftest.cpp >&5
    /c/gnu/gcc-4.8.1/libcpp/configure: line 1495: g++: command not found
    configure:4901: $? = 127
    configure: failed program was:

    #2591

    support
    Keymaster

    Hi,

    Please reinstall MinGW selecting “C++ compiler” in the installer options. Alternatively you can use a prebuilt package from http://gnutoolchains.com/mingw32/

    #2592

    Sgalperin
    Participant

    The C++ installation got me farther than ever, the build took over 2 hours to fail. Now it’s missing stdio.h.

    /c/gnu/gcc-4.8.1-build/./gcc/xgcc -B/c/gnu/gcc-4.8.1-build/./gcc/ -B/c/gnu/out/powerpc-ibm-eabi/bin/ -B/c/gnu/out/powerpc-ibm-ea
    bi/lib/ -isystem /c/gnu/out/powerpc-ibm-eabi/include -isystem /c/gnu/out/powerpc-ibm-eabi/sys-include -g -O2 -msoft-float -mr
    elocatable-lib -mno-eabi -mstrict-align -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wcast-qual –
    Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stac
    k-protector -I. -I. -I../../.././gcc -I../../../../gcc-4.8.1/libgcc -I../../../../gcc-4.8.1/libgcc/. -I../../../../gcc-4.8.1/l
    ibgcc/../gcc -I../../../../gcc-4.8.1/libgcc/../include -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../..
    /../../gcc-4.8.1/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
    In file included from ../../../../gcc-4.8.1/libgcc/libgcc2.c:27:0:
    ../../../../gcc-4.8.1/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory
    #include
    ^
    compilation terminated.
    make[4]: *** [_muldi3.o] Error 1
    make[4]: Leaving directory `/c/gnu/gcc-4.8.1-build/powerpc-ibm-eabi/nof/libgcc’
    make[3]: *** [multi-do] Error 1

    #2594

    ket
    Participant

    Hi,

    Is stdio.h provided by vxworks? If yes, have you copied the system headers over from vxworks as instructed before?

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.