m68k-rtems-gcc toolchain build problem on Solaris-7

Paul Cadaret rtems at usd.com
Tue Dec 30 08:20:26 UTC 2003

With help from Thomas (see below) I used the files he pointed out at


to run the build according to the PDF file at
and I followed the PDF file instructions carefully for:

     4.1.2 Unarchiving the Tools
     4.1.3 Applying RTEMS Patches,
             Apply RTEMS Patch to GCC,
             Apply RTEMS Patch to binutils,
             Apply RTEMS Patch to newlib Using configure and make,
                 Configuring and Building BINUTILS,
                 Configuring and Building GCC and NEWLIB

Binutils built and installed without error.

Building gcc-3.2.3 died as follows:

       1113  tools/gcc-3.2.3/build.m68k-rtems/gcc/ -nostdinc
       1113  68k-rtems/newlib/ -isystem
       1113  nclude -isystem
       1113  8k-rtems/bin/ -B/tools/local.m68k-rtems/m68k-rtems/lib/
     -isystem /tools/local.m68k-rtems/m68k-rtems/include -O2 -I../../src/
       1113  gcc/../newlib/libc/sys/rtems/include -DIN_GCC
     -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
       1113  types -isystem ./include   -g -DHAVE_GTHR_DEFAULT
     -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I.
       1113  cc -I../../src/gcc/. -I../../src/gcc/config
     -I../../src/gcc/../include  -DL_floatdisf -c ../../src/gcc/libgcc2.c
     -o libgcc/.
       1113  /_floatdisf.o

       1114  tools/gcc-3.2.3/build.m68k-rtems/gcc/ -nostdinc
       1114  68k-rtems/newlib/ -isystem
       1114  nclude -isystem
       1114  8k-rtems/bin/ -B/tools/local.m68k-rtems/m68k-rtems/lib/
     -isystem /tools/local.m68k-rtems/m68k-rtems/include -O2 -I../../src/
       1114  gcc/../newlib/libc/sys/rtems/include -DIN_GCC
     -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
       1114  types -isystem ./include   -g -DHAVE_GTHR_DEFAULT
     -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I.
       1114  cc -I../../src/gcc/. -I../../src/gcc/config
     -I../../src/gcc/../include  -DL_fixunsdfsi -c
     ../../src/gcc/libgcc2.c -o libgcc/
       1114  ./_fixunsdfsi.o

       1115  In file included from
       1116                   from
       1117                   from ../../src/gcc/libgcc2.c:1166:
     no include path in whi
       1118  ch to find limits.h
       1119  make[2]: *** [libgcc/./_fixunsdfsi.o] Error 1
       1120  make[2]: Leaving directory
       1121  make[1]: *** [stmp-multilib] Error 2
       1122  make[1]: Leaving directory
       1123  make: *** [all-gcc] Error 2

../../src/gcc/libgcc2.c looks like:

       1155  #ifdef L_fixunsdfsi
       1156  /* Reenable the normal types, in case limits.h needs them.  */
       1157  #undef char
       1158  #undef short
       1159  #undef int
       1160  #undef long
       1161  #undef unsigned
       1162  #undef float
       1163  #undef double
       1164  #undef MIN
       1165  #undef MAX
       1166  #include <limits.h>            <<<==============  OK

Note that ../src/gcc is where I unpacked the gcc-3.2.3 source tree and
applied the patches.
The above file includes  ./gcc/include/limits.h:
      9  #ifndef _LIBC_LIMITS_H_
     10  /* Use "..." so that we find syslimits.h only in this same
directory.  */
     11  #include "syslimits.h"    <<<===============OK
     12  #endif
     13  #ifndef _LIMITS_H___
     14  #define _LIMITS_H___

The above file includes ./gcc/include/syslimits.h:
      1  /* syslimits.h stands for the system's own limits.h file.
      2     If we can use it ok unmodified, then we install this text.
      3     If fixincludes fixes it, then the fixed version is installed
      4     instead of this text.  */
      6  #define _GCC_NEXT_LIMITS_H              /* tell gcc's limits.h
to recurse */
      7  #include_next <limits.h>    <<<============= dies here searching
for a secondary instance of limits.h
      8  #undef _GCC_NEXT_LIMITS_H

What is "the system's own limits.h file" ???  linux?  solaris? newlib?
The "#include_next" is a feature of the newer gcc's

Disecting my build log line 1114 above looks like this:


             -nostdinc \

             -B/tools/local.m68k-rtems/m68k-rtems/bin/ \
             -B/tools/local.m68k-rtems/m68k-rtems/lib/ \
             -isystem /tools/local.m68k-rtems/m68k-rtems/include \
             -O2 \
             -I../../src/gcc/../newlib/libc/sys/rtems/include \
             -DIN_GCC -DCROSS_COMPILE   \
             -W -Wall -Wwrite-strings -Wstrict-prototypes
     -Wmissing-prototypes \
             -isystem ./include   \
             -g \
     -Dinhibit_libc \
             -I. \
             -I. \
             -I../../src/gcc \
             -I../../src/gcc/. \
             -I../../src/gcc/config \
             -I../../src/gcc/../include  \
             -DL_fixunsdfsi \
             -c \
             ../../src/gcc/libgcc2.c \
             -o libgcc/./_fixunsdfsi.o

  From my  build directory
if I run the command below

     find .. ../../src /tools/local.m68k-rtems -follow -name limits.h -print

shows the following:

     find: ../gcc/cp/stage1: No such file or directory
     find: ../gcc/cp/stage2: No such file or directory
     find: ../gcc/cp/stage3: No such file or directory
     find: ../gcc/cp/stage4: No such file or directory
     find: ../gcc/fixinc/stage1: No such file or directory
     find: ../gcc/fixinc/stage2: No such file or directory
     find: ../gcc/fixinc/stage3: No such file or directory
     find: ../gcc/fixinc/stage4: No such file or directory

The above list shows --ALL-- of the instances of  files named "limits.h"
available to this build;  in fact, everything
that might possibly pertain to the RTEMS tool sources I downloaded.

The file "./include/limits.h"  (aka ../gcc/include/limits.h) is the file
that xgcc finds on line 1166 above.
The file "syslimits.h"  tries to use the "#include_next" mechanism to
find a secondary "limits.h",  however,
the xgcc include path doesn't have any more files along the path.   As
best I can determine the xgcc include path
should effectively be (from top to bottom):



Since 'configure' builds the makefiles here and I have no idea what it
is trying to accomplish here, I really don't know
what to fix.   As best I can tell the Solaris toolchain is broken.

Some further data:

     rtems> uname -a
     SunOS u2 5.7 Generic_106541-08 sun4u sparc SUNW,UltraSPARC-IIi-Engine

     rtems> perl --version
     This is perl, v5.6.0 built for sun4-solaris

     rtems> autoconf --version
     autoconf (GNU Autoconf) 2.59

     rtems> automake --version
     automake (GNU automake) 1.8

     rtems> gmake --version
     GNU Make 3.80

     rtems> gcc --version

     rtems> type m68k-rtems-as
     m68k-rtems-as is /tools/local.m68k-rtems/bin/m68k-rtems-as

     rtems> m68k-rtems-as --version
     GNU assembler

I would appreciate some guidance here.

Thanks much.
Thomas Doerfler wrote:

 >the files you are looking for are actually located under
 >	Thomas.
 >>The web page
 >>has an entry that referrs to ' Getting Started with RTEMS for C/C++
 >>that is a PDF file
 >>On page 14 of the PDF file it says:
 >>    RTEMS Speci c Tool Patches and Scripts
 >>        FTP Site: ftp.rtems.com
 >>        Directory: /pub/rtems/releases/4.6.0pre5/c_tools/source
 >>        File: newlib-1.11.0-rtems-20030605.diff
 >>        File: gcc-3.2.3-rtems-20030507a.diff
 >>The directory /pub/rtems/releases/4.6.0pre5/c_tools does not exist.
 >>Where can these patch diffs be found now?
 >>thanks much.
 >IMD Ingenieurbuero fuer Microcomputertechnik
 >Thomas Doerfler           Herbststrasse 8
 >D-82178 Puchheim          Germany
 >email:    Thomas.Doerfler at imd-systems.de
 >PGP public key available at: http://www.imd-

More information about the users mailing list