This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-3.3.2 build problems found when building (cross compiler form68k-elf target
- From: Paul Cadaret <gnu at usd dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Dec 2003 11:14:41 -0800
- Subject: gcc-3.3.2 build problems found when building (cross compiler form68k-elf target
A few days ago I started trying to build a Solaris-based cross compiler
for an m68k-elf target.
The cross compile FAQ directions that I am following are from
http://www.rtems.com/onlinedocs/releases/rtemsdocs-4.6.0pre5/share/rtems/pdf/started.pdf.
This document describes how to use gcc-3.2.3 to build a cross compiler.
Since I am having problems with 3.3.2, I thought I should report the
error I have found thus far.
I started off building and installing binutils-2.14 for a m68k-elf
target. No problems.
I installed a copy of the 'newlib' sourcetree from
ftp://sources.redhat.com/pub/newlib/newlib-1.11.0.tar.gz
and created a symlink in my gcc build subdir as instructed.
I then setup a build subdir and ran configure as follows:
${SHELL} ../configure \
--prefix=$LOCAL \
--target=m68k-elf \
--program-prefix=m68k-elf- \
--with-newlib \
--enable-threads \
--enable-languages="c,c++" \
--verbose \
#
Note that the gcc configure apparently supports 'newlib'.
Configure ran fine.
I then ran make and found the 1st error. Here's an extract from the log.
2444 make[1]: Leaving directory
`/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc'
2445 Configuring in m68k-elf/libiberty
2446 loading cache ../config.cache
2447 checking whether to enable maintainer-specific portions of
Makefiles... no
2448 checking for makeinfo... makeinfo
2449 configure: warning:
2450 *** Makeinfo is too old. Info documentation will not be built.
2451 checking for perl... perl
2452 checking host system type... m68k-unknown-elf
2453 checking build system type... sparc-sun-solaris2.7
2454 checking for m68k-elf-ar... m68k-elf-ar
2455 checking for m68k-elf-ranlib... m68k-elf-ranlib
2456 checking for gcc...
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
-B/sd/c0t8d0/opt1/web/s
2456 ites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/
-B/tools/local.m68k-elf/m68k-elf/bin/ -B/tools/local.m68k-elf/m68k-el
2456 f/lib/ -isystem /tools/local.m68k-elf/m68k-elf/include
2457 checking whether we are using GNU C... yes
2458 checking whether
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
-B/sd/c0t8d0/opt1/web/site
2458 s/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/
-B/tools/local.m68k-elf/m68k-elf/bin/ -B/tools/local.m68k-elf/m68k-elf/l
2458 ib/ -isystem /tools/local.m68k-elf/m68k-elf/include accepts
-g... yes
2459 checking whether
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
-B/sd/c0t8d0/opt1/web/site
2459 s/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/
-B/tools/local.m68k-elf/m68k-elf/bin/ -B/tools/local.m68k-elf/m68k-elf/l
2459 ib/ -isystem /tools/local.m68k-elf/m68k-elf/include and cc
understand -c and -o together... yes
2460 checking for POSIXized ISC... no
2461 checking for working const... yes
2462 checking for inline... inline
2463 checking for a BSD compatible install...
/tools/local/bin/install -c
2464 xhost-mkfrag is unchanged
2465 checking how to run the C preprocessor... /lib/cpp
2466 checking for sys/file.h... yes
2467 checking for sys/param.h... yes
2468 checking for limits.h... yes
2469 checking for stdlib.h... yes
2470 checking for malloc.h... yes
2471 checking for string.h... yes
2472 checking for unistd.h... yes
2473 checking for strings.h... yes
2474 checking for sys/time.h... yes
2475 checking for time.h... yes
2476 checking for sys/resource.h... yes
2477 checking for sys/stat.h... yes
2478 checking for sys/mman.h... yes
2479 checking for fcntl.h... yes
2480 checking for alloca.h... yes
2481 checking for sys/pstat.h... no
2482 checking for sys/sysmp.h... no
2483 checking for sys/sysinfo.h... yes
2484 checking for machine/hal_sysinfo.h... no
2485 checking for sys/table.h... no
2486 checking for sys/sysctl.h... no
2487 checking for sys/systemcfg.h... no
2488 checking for sys/wait.h that is POSIX.1 compatible... no
2489 checking whether time.h and sys/time.h may both be
included... no
2490 checking whether errno must be declared... yes
2491 checking for ANSI C header files... no
2492 checking for uintptr_t... yes
2493 checking for pid_t... yes
2494 checking whether the C compiler (
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
-B/sd/c0t8
2494
d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/
-B/tools/local.m68k-elf/m68k-elf/bin/ -B/tools/local.m68
2494 k-elf/m68k-elf/lib/ -isystem
/tools/local.m68k-elf/m68k-elf/include -O2 -g -O2 ) works... no
2495 configure: error: installation or configuration problem: C
compiler cannot create executables.
2496 make: *** [configure-target-libiberty] Error 1
A detailed inspection found that the m68k-elf/libiberty configure tries
to run the new cross-compiler (xgcc) to compile & link a small simple
program but the compiler fails because there is no libc.a available to
the cross compiler yet.
I made a change to my gcc-3.3.2/libiberty/configure file as follows to
fix this error:
2397 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS
$LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2398 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS
-nostdlib $LDFLAGS conftest.$ac_ext $LIBS 1>&5' #PSC
Note that I have added line 2398 after 2397 to fix the error.
Since the test in question was just a simple test-link, adding the
'-nostdlib' seemed sufficient to correct this error.
Now on to the next error encountered.
2733 Adding multilib support to Makefile in ../../../../libiberty
2734 with_multisubdir=msoft-float
2735 make[1]: Entering directory
`/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/m68k-elf/libiberty'
2736 if [ x"" != x ] && [ ! -d pic ]; then \
2737 mkdir pic; \
2738 else true; fi
2739 touch stamp-picdir
2740 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in /bin/sh
./config.status
2741 creating config.h
2742 config.h is unchanged
2743 if [ x"" != x ]; then \
2744
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
-B/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gn
2744 u/gcc/gcc-3.3.2/build.m68k-elf/gcc/
-B/tools/local.m68k-elf/m68k-elf/bin/
-B/tools/local.m68k-elf/m68k-elf/lib/ -isystem /to
2744 ols/local.m68k-elf/m68k-elf/include -c -DHAVE_CONFIG_H -O2
-g -O2 -I. -I../../../libiberty/../include -W -Wall -Wtraditiona
2744 l -pedantic ../../../libiberty/regex.c -o pic/regex.o; \
2745 else true; fi
2746
/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/xgcc
\
2747
-B/sd/c0t8d0/opt1/web/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2/build.m68k-elf/gcc/
\
2748 -B/tools/local.m68k-elf/m68k-elf/bin/ \
2749 -B/tools/local.m68k-elf/m68k-elf/lib/ \
2750 -isystem /tools/local.m68k-elf/m68k-elf/include \
2751 -c \
2752 -DHAVE_CONFIG_H \
2753 -O2 -g -O2 \
2754 -I. -I../../../libiberty/../include \
2755 -W -Wall -Wtraditional -pedantic \
2756 ../../../libiberty/regex.c \
2757 -o regex.o
2758 ../../../libiberty/regex.c:53:25: sys/types.h: No such file
or directory
2759 ../../../libiberty/regex.c:151:24: string.h: No such file or
directory
2760 In file included from ../../../include/xregex.h:26,
2761 from ../../../libiberty/regex.c:195:
2762 ../../../include/xregex2.h:357: error: parse error before
"size_t"
2763 ../../../include/xregex2.h:357: warning: no semicolon at end
of struct or union
2764 ../../../include/xregex2.h:364: error: parse error before
':' token
2765 ../../../include/xregex2.h:373: error: parse error before
':' token
2766 ../../../include/xregex2.h:377: error: parse error before
':' token
2767 ../../../include/xregex2.h:381: error: parse error before
':' token
2768 ../../../include/xregex2.h:385: error: parse error before
':' token
2769 ../../../include/xregex2.h:388: error: parse error before
':' token
Note above that I took the 'liberty' of reformatting the xgcc command
line to better show what is going on.
The error here seems due to the fact that the cross compiler does not
have access to the <sys/types.h> and <string.h>
include files yet. These files exist in the 'newlib' source tree,
however they are not being referenced. I should point
out that the directory "/tools/local.m68k-elf/m68k-elf/include" is the
correct final location for my cross-compiler however
it has yet to be created. I am still looking into this problem further,
but I wanted to report the problems found to date.
Any suggestions would be appreciated.
Thanks.