This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem building GCC


I've been following the CrossGCC faq to build sh4 versions of binutils,
gcc et all and have a failing gcc build which I can't figure out.

I built binutils ok with this:
# Tree root is the top of our source tree
export TREE_ROOT=`pwd`/../..
cd binutils-2.11.2
(cd gas && autoconf)
(cd bfd && autoconf)
mkdir objdir
cd objdir
export CFLAGS="-g -O2"
export CC=gcc

# configure (prefix needs to be calculated)
../configure --target=sh4-linux --prefix=$TREE_ROOT/host/
--program-prefix=sh4-linux-

# build, hardwireing the Library path 
make
LIB_PATH=$TREE_ROOT/target/usr/local/lib/:$TREE_ROOT/target/lib:$TREE_ROOT/target/usr/lib/

# install it - paths should be set by configure et all
make install

And then built gcc using the following:

# Tree root is the top of our source tree
export TREE_ROOT=`pwd`/../..
cd gcc-3.0.3
(cd gcc; autoconf)
rm -rf objdir
mkdir objdir
cd objdir
mkdir gcc
cd gcc
ln -s $TREE_ROOT/host/bin/sh4-linux-as as
cd ..
export CFLAGS="-g -O2"
# configure (prefix needs to be calculated)
../configure --target=sh4-linux \
             --prefix=$TREE_ROOT/host/ \
	     --program-prefix=sh4-linux- \
	     --program-transform-name=s,^,sh4-linux-, \
             --enable-cross \
             --enable-shared \
             --enable-languages=c,c++ \
	     --enable-threads \
	     --disable-c99 \
	     --with-system-zlib

# build
make
(cd gcc ; make relocation)

# install it - paths should be set by configure et all
make install

But the build fails with:
<snip>
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
./xgcc -B./ -B/home/alex/src/src/gcc/../../host//sh4-linux/bin/
-B/home/alex/src/src/gcc/../../host//target/lib/
-B/home/alex/src/src/gcc/../../host//target/usr/lib/ -isystem
/home/alex/src/src/gcc/../../host//target/usr/include -O2 
-DCROSS_COMPILE -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include   -g1 -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc
-I../../gcc/. -I../../gcc/config -I../../gcc/../include -fexceptions -c
../../gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from ../../gcc/unwind-dw2.c:25:
../../gcc/unwind-pe.h: In function `size_of_encoded_value':
../../gcc/unwind-pe.h:76: warning: implicit declaration of function
`abort'
In file included from gthr-default.h:1,
                 from ../../gcc/gthr.h:98,
                 from ../../gcc/unwind-dw2.c:27:
../../gcc/gthr-posix.h:37:21: pthread.h: No such file or directory
In file included from gthr-default.h:1,
                 from ../../gcc/gthr.h:98,
                 from ../../gcc/unwind-dw2.c:27:
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:39: parse error before "__gthread_key_t"
../../gcc/gthr-posix.h:39: warning: type defaults to `int' in
declaration of `__gthread_key_t'
../../gcc/gthr-posix.h:39: warning: data definition has no type or
storage class
../../gcc/gthr-posix.h:40: parse error before "__gthread_once_t"
../../gcc/gthr-posix.h:40: warning: type defaults to `int' in
declaration of `__gthread_once_t'
../../gcc/gthr-posix.h:40: warning: data definition has no type or
storage class
../../gcc/gthr-posix.h:41: parse error before "__gthread_mutex_t"
../../gcc/gthr-posix.h:41: warning: type defaults to `int' in
declaration of `__gthread_mutex_t'
../../gcc/gthr-posix.h:41: warning: data definition has no type or
storage class
../../gcc/gthr-posix.h:80: `pthread_create' undeclared here (not in a
function)
../../gcc/gthr-posix.h:439: parse error before '*' token
../../gcc/gthr-posix.h:439: parse error before ')' token
../../gcc/gthr-posix.h:448: parse error before '*' token
../../gcc/gthr-posix.h:448: parse error before ')' token
../../gcc/gthr-posix.h:454: parse error before "key"
../../gcc/gthr-posix.h:455: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_key_dtor':
../../gcc/gthr-posix.h:457: `ptr' undeclared (first use in this
function)
../../gcc/gthr-posix.h:457: (Each undeclared identifier is reported only
once
../../gcc/gthr-posix.h:457: for each function it appears in.)
../../gcc/gthr-posix.h:458: warning: implicit declaration of function
`pthread_setspecific'
../../gcc/gthr-posix.h:458: `key' undeclared (first use in this
function)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:464: parse error before "key"
../../gcc/gthr-posix.h:465: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_key_delete':
../../gcc/gthr-posix.h:466: warning: implicit declaration of function
`pthread_key_delete'
../../gcc/gthr-posix.h:466: `key' undeclared (first use in this
function)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:470: parse error before "key"
../../gcc/gthr-posix.h:471: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_getspecific':
../../gcc/gthr-posix.h:472: warning: implicit declaration of function
`pthread_getspecific'
../../gcc/gthr-posix.h:472: `key' undeclared (first use in this
function)
../../gcc/gthr-posix.h:472: warning: return makes pointer from integer
without a cast
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:476: parse error before "key"
../../gcc/gthr-posix.h:477: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_setspecific':
../../gcc/gthr-posix.h:478: `key' undeclared (first use in this
function)
../../gcc/gthr-posix.h:478: `ptr' undeclared (first use in this
function)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:482: parse error before '*' token
../../gcc/gthr-posix.h:483: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_mutex_lock':
../../gcc/gthr-posix.h:485: warning: implicit declaration of function
`pthread_mutex_lock'
../../gcc/gthr-posix.h:485: `mutex' undeclared (first use in this
function)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:491: parse error before '*' token
../../gcc/gthr-posix.h:492: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_mutex_trylock':
../../gcc/gthr-posix.h:494: warning: implicit declaration of function
`pthread_mutex_trylock'
../../gcc/gthr-posix.h:494: `mutex' undeclared (first use in this
function)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:500: parse error before '*' token
../../gcc/gthr-posix.h:501: warning: function declaration isn't a
prototype
../../gcc/gthr-posix.h: In function `__gthread_mutex_unlock':
../../gcc/gthr-posix.h:503: warning: implicit declaration of function
`pthread_mutex_unlock'
../../gcc/gthr-posix.h:503: `mutex' undeclared (first use in this
function)
../../gcc/unwind-dw2.c: At top level:
../../gcc/unwind-pe.h:61: warning: `size_of_encoded_value' defined but
not used
make[1]: *** [libgcc/./unwind-dw2.o] Error 1
make[1]: Leaving directory `/home/alex/src/src/gcc/gcc-3.0.3/objdir/gcc'
make: *** [libgcc.a] Error 2

I've seen one comment searching google but it was refering to building
newlib/glibc and I haven't got to that stage yet. Should all of gcc's
build headers be self contained or do I need some external headers to
get it to build correctly?

p.s. Is there a proper homepage for CrossGCC, I had to guess the email
address of the list as the FAQ pages still refer to soureware.cygnus.com

-- 
Alex Bennee
Senior Hacker, Braddahead Ltd
The above is probably my personal opinion and may not be that of my
employer


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]