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]

Re: problems compiling gcc-3.3.5 with newlib-1.12.0


 --- Daniel Kegel <dank@kegel.com> wrote: 
> Kai Ruottu wrote:
> >  No patches should be necessary first... "Don't
> fix it
> > if it ain't broken!". If you find bugs or become
> aware
> > about them, you can always check that the bugs
> really
> > are there and then fix them later when already
> knowing
> > how to build GCC.
> 
> Indeed.  It's a good idea to start with clean
> unpatched sources,
> and only add patches as you discover you need them.
> - Dan
Agreed. But then why were those patches there in the
first place? I thought they were to be applied to any
cross-compiler binutils-2.15.

Anyway aside of that thanks Kai for the info on
copying newlib headers into sys-include. The final gcc
build went thru without any problems

However my troubles seem to have increased. It appears
that what is required is posix thread support (the
same as that provided by the glibc-linuxthreads
library ). On checking the configure options for
newlib-1.13.0  I find that --enable-newlib-multithread
apparently enables support for multiple theads. Also
on compiling  newlib with this option i get a
pthread.h header in $prefix/arm-elf/include which
(apparently - i havent checked fully) defines the
thread function headers. However on then trying to
compile the full gcc (with --enable-threads=posix)
after symlinking stdlib.h,stdio,h,string.h,limits.h
time.h, unistd.h and pthread.h from
$prefix/arm-elf/include to sys-include I get errors. I
even tried cp -r $prefix/arm-elf/include/*
$prefix/arm-elf/sys-include. The errors for this case
are --
In file included from
../../gcc-3.3.5/gcc/unwind-dw2.c:29:
../../gcc-3.3.5/gcc/unwind-pe.h: In function
`base_of_encoded_value':
../../gcc-3.3.5/gcc/unwind-pe.h:110: warning: implicit
declaration of function `abort'
In file included from gthr-default.h:1,
                 from ../../gcc-3.3.5/gcc/gthr.h:98,
                 from
../../gcc-3.3.5/gcc/unwind-dw2.c:31:
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:40: error: parse
error before "__gthread_key_t"
../../gcc-3.3.5/gcc/gthr-posix.h:40: warning: type
defaults to `int' in declaration of `__gthread_key_t'
../../gcc-3.3.5/gcc/gthr-posix.h:40: warning: data
definition has no type or storage class
../../gcc-3.3.5/gcc/gthr-posix.h:41: error: parse
error before "__gthread_once_t"
../../gcc-3.3.5/gcc/gthr-posix.h:41: warning: type
defaults to `int' in declaration of `__gthread_once_t'
../../gcc-3.3.5/gcc/gthr-posix.h:41: warning: data
definition has no type or storage class
../../gcc-3.3.5/gcc/gthr-posix.h:42: error: parse
error before "__gthread_mutex_t"
../../gcc-3.3.5/gcc/gthr-posix.h:42: warning: type
defaults to `int' in declaration of
`__gthread_mutex_t'
../../gcc-3.3.5/gcc/gthr-posix.h:42: warning: data
definition has no type or storage class
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_active_p':
../../gcc-3.3.5/gcc/gthr-posix.h:90: error:
`pthread_create' undeclared (first use in this
function)
../../gcc-3.3.5/gcc/gthr-posix.h:90: error: (Each
undeclared identifier is reported only once
../../gcc-3.3.5/gcc/gthr-posix.h:90: error: for each
function it appears in.)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:450: error: parse
error before '*' token
../../gcc-3.3.5/gcc/gthr-posix.h:450: error: parse
error before ')' token
../../gcc-3.3.5/gcc/gthr-posix.h:459: error: parse
error before '*' token
../../gcc-3.3.5/gcc/gthr-posix.h:459: error: parse
error before ')' token
../../gcc-3.3.5/gcc/gthr-posix.h:465: error: parse
error before "key"
../../gcc-3.3.5/gcc/gthr-posix.h:466: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_key_dtor':
../../gcc-3.3.5/gcc/gthr-posix.h:468: error: `ptr'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h:469: warning:
implicit declaration of function `pthread_setspecific'
../../gcc-3.3.5/gcc/gthr-posix.h:469: error: `key'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:475: error: parse
error before "key"
../../gcc-3.3.5/gcc/gthr-posix.h:476: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_key_delete':
../../gcc-3.3.5/gcc/gthr-posix.h:477: warning:
implicit declaration of function `pthread_key_delete'
../../gcc-3.3.5/gcc/gthr-posix.h:477: error: `key'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:481: error: parse
error before "key"
../../gcc-3.3.5/gcc/gthr-posix.h:482: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_getspecific':
../../gcc-3.3.5/gcc/gthr-posix.h:483: warning:
implicit declaration of function `pthread_getspecific'
../../gcc-3.3.5/gcc/gthr-posix.h:483: error: `key'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h:483: warning: return
makes pointer from integer without a cast
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:487: error: parse
error before "key"
../../gcc-3.3.5/gcc/gthr-posix.h:488: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_setspecific':
../../gcc-3.3.5/gcc/gthr-posix.h:489: error: `key'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h:489: error: `ptr'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:493: error: parse
error before '*' token
../../gcc-3.3.5/gcc/gthr-posix.h:494: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_mutex_lock':
../../gcc-3.3.5/gcc/gthr-posix.h:496: warning:
implicit declaration of function `pthread_mutex_lock'
../../gcc-3.3.5/gcc/gthr-posix.h:496: error: `mutex'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:502: error: parse
error before '*' token
../../gcc-3.3.5/gcc/gthr-posix.h:503: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_mutex_trylock':
../../gcc-3.3.5/gcc/gthr-posix.h:505: warning:
implicit declaration of function
`pthread_mutex_trylock'
../../gcc-3.3.5/gcc/gthr-posix.h:505: error: `mutex'
undeclared (first use in this function)
../../gcc-3.3.5/gcc/gthr-posix.h: At top level:
../../gcc-3.3.5/gcc/gthr-posix.h:511: error: parse
error before '*' token
../../gcc-3.3.5/gcc/gthr-posix.h:512: warning:
function declaration isn't a prototype
../../gcc-3.3.5/gcc/gthr-posix.h: In function
`__gthread_mutex_unlock':
../../gcc-3.3.5/gcc/gthr-posix.h:514: warning:
implicit declaration of function
`pthread_mutex_unlock'
../../gcc-3.3.5/gcc/gthr-posix.h:514: error: `mutex'
undeclared (first use in this function)
make[2]: *** [libgcc/./unwind-dw2.o] Error 1
make[2]: Leaving directory
`/home/carlos/tool_tar/build-gcc/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory
`/home/carlos/tool_tar/build-gcc/gcc'
make: *** [all-gcc] Error 2

I'm still working on this but any inputs here would be
most welcome as from what info ive found so far
indicates that newlib does not support pthreads !

Also a (hopefully)minor confusion -when
cross-compiling for target=arm-linux the linux headers
are required while for arm-elf the linux headers are
not used. Is this because the target in the first case
uses glibc which requires linux ? and arm-elf using
newlib does not require this? I thought any library
would necessarily require the kernel headers.

thanks
carlos



	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

------
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]