public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Errors cross compiling gcc 4.1.1  for i686-linux-pc
@ 2007-01-13 22:50 Klaus Nji
  2007-01-13 23:14 ` Brian Dessent
  0 siblings, 1 reply; 2+ messages in thread
From: Klaus Nji @ 2007-01-13 22:50 UTC (permalink / raw)
  To: gcc-help

Need help here cross compiling gcc 4.1.1 for i686 linux pc target on cygwin 1.5.23.

I was able to compile and install binutils 2.13.1 without incident.  I also current have gcc 3.4.4 installed.  Any suggestions?

The logs show:

i686-pc-linux-gnu-ar  rc ./libgcov.a libgcc/./_gcov.o libgcc/./_gcov_merge_add.o libgcc/./_gcov_merge_single.o libgcc/./_gcov_merge_delta.o libgcc/./_gcov_fork.o libgcc/./_gcov_execl.o libgcc/./_gcov_execlp.o libgcc/./_gcov_execle.o libgcc/./_gcov_execv.o libgcc/./_gcov_execvp.o libgcc/./_gcov_execve.o libgcc/./_gcov_interval_profiler.o libgcc/./_gcov_pow2_profiler.o libgcc/./_gcov_one_value_profiler.o
i686-pc-linux-gnu-ranlib ./libgcov.a
/tmp/build/gcc/./gcc/xgcc -B/tmp/build/gcc/./gcc/ -B/opt/ecos/gnutools/H-i686-pc-linux-gnu/i686-pc-linux-gnu/bin/ -B/opt/ecos/gnutools/H-i686-pc-linux-gnu/i686-pc-linux-gnu/lib/ -isystem /opt/ecos/gnutools/H-i686-pc-linux-gnu/i686-pc-linux-gnu/include -isystem /opt/ecos/gnutools/H-i686-pc-linux-gnu/i686-pc-linux-gnu/sys-include -O2  -O2 -g -O2   -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I/tmp/gcc-4.1.1/gcc -I/tmp/gcc-4.1.1/gcc/. -I/tmp/gcc-4.1.1/gcc/../include -I/tmp/gcc-4.1.1/gcc/../libcpp/include  -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c /tmp/gcc-4.1.1/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from ./gthr-default.h:1,
                 from /tmp/gcc-4.1.1/gcc/gthr.h:114,
                 from /tmp/gcc-4.1.1/gcc/unwind-dw2.c:42:
/tmp/gcc-4.1.1/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directory
/tmp/gcc-4.1.1/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or directory
In file included from ./gthr-default.h:1,
                 from /tmp/gcc-4.1.1/gcc/gthr.h:114,
                 from /tmp/gcc-4.1.1/gcc/unwind-dw2.c:42:
/tmp/gcc-4.1.1/gcc/gthr-posix.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_key_t'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_once_t'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_mutex_t'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__gthread_recursive_mutex_t'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:88: error: 'pthread_once' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:88: warning: type defaults to 'int' in declaration of '__gthrw_pthread_once'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:89: error: 'pthread_getspecific' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:89: warning: type defaults to 'int' in declaration of '__gthrw_pthread_getspecific'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:90: error: 'pthread_setspecific' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:90: warning: type defaults to 'int' in declaration of '__gthrw_pthread_setspecific'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:91: error: 'pthread_create' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:91: warning: type defaults to 'int' in declaration of '__gthrw_pthread_create'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:92: error: 'pthread_cancel' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:92: warning: type defaults to 'int' in declaration of '__gthrw_pthread_cancel'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:93: error: 'pthread_mutex_lock' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:93: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_lock'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:94: error: 'pthread_mutex_trylock' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:94: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_trylock'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:95: error: 'pthread_mutex_unlock' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:95: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_unlock'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:96: error: 'pthread_mutex_init' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:96: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutex_init'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:99: error: 'pthread_key_create' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:99: warning: type defaults to 'int' in declaration of '__gthrw_pthread_key_create'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:100: error: 'pthread_key_delete' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:100: warning: type defaults to 'int' in declaration of '__gthrw_pthread_key_delete'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:101: error: 'pthread_mutexattr_init' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:101: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_init'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:102: error: 'pthread_mutexattr_settype' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:102: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_settype'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:103: error: 'pthread_mutexattr_destroy' undeclared here (not in a function)
/tmp/gcc-4.1.1/gcc/gthr-posix.h:103: warning: type defaults to 'int' in declaration of '__gthrw_pthread_mutexattr_destroy'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:513: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:522: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:528: error: expected ')' before 'key'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:534: error: expected ')' before 'key'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:540: error: expected ')' before 'key'
/tmp/gcc-4.1.1/gcc/gthr-posix.h:546: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:555: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:564: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:574: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:595: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:601: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/gthr-posix.h:607: error: expected ')' before '*' token
/tmp/gcc-4.1.1/gcc/unwind-dw2.c: In function 'uw_init_context_1':
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1259: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'once_regsizes'
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1259: error: 'once_regsizes' undeclared (first use in this function)
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1259: error: (Each undeclared identifier is reported only once
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1259: error: for each function it appears in.)
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1259: error: 'PTHREAD_ONCE_INIT' undeclared (first use in this function)
/tmp/gcc-4.1.1/gcc/unwind-dw2.c:1260: warning: implicit declaration of function '__gthread_once'
make[3]: *** [libgcc/./unwind-dw2.o] Error 1
make[3]: Leaving directory `/tmp/build/gcc/gcc'
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory `/tmp/build/gcc/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/tmp/build/gcc'
make: *** [all] Error 2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Errors cross compiling gcc 4.1.1  for i686-linux-pc
  2007-01-13 22:50 Errors cross compiling gcc 4.1.1 for i686-linux-pc Klaus Nji
@ 2007-01-13 23:14 ` Brian Dessent
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dessent @ 2007-01-13 23:14 UTC (permalink / raw)
  To: Klaus Nji; +Cc: gcc-help

Klaus Nji wrote:

> /tmp/gcc-4.1.1/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directory
> /tmp/gcc-4.1.1/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or directory

It looks like you don't have the target C library headers installed, or
they're in the wrong place.  This is required when building gcc because
gcc itself does not include a libc and it requires the headers when
building libgcc and the other target libraries like libstdc++.  You
normally point gcc to them using --with-headers or --with-sysroot et
cetera.

The easiest route is to get the C library headers from an existing
distro, in particular the same one (or one very similar to) that you
intend to eventually run your program on.  I.e. get them from the
libc-devel deb/rpm package.

It is also possible if there is no existing system to bootstrap gcc and
the libc together, but it's a lot more work.  You end up building a
stripped down C-only gcc, then using that to configure parts of the
libc, then using those headers to rebuild a full gcc, then using that to
actually build libc.  This is the method that the crosstool script uses
and if you want to go that route it's much easier just to run crosstool
and let it do everything.

Brian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-13 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-13 22:50 Errors cross compiling gcc 4.1.1 for i686-linux-pc Klaus Nji
2007-01-13 23:14 ` Brian Dessent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).