LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 10-14-2007, 09:54 PM   #1
saistain
LQ Newbie
 
Registered: Oct 2007
Posts: 9

Rep: Reputation: 0
Troubles in building cross compiler (error @ binutils)


Hi

I'm trying to build a cross compiler toolchain to compile on my PC to Mac. I've hit an error on building binutils stage (first step). I was wondering if anyone can guess what the problem is.

Before I post the error log, I'll give a brief description of my process:
-My project folder is /common/Shared/Projects/XCompiler
-In this folder, I downloaded and unzipped binutils, gcc, gdb, uclibc
-I set $TARGET as powerpc-linux (shouldn't matter what the target OS is, since all kernels are POSIX right?)
-I set $PREFIX as /common/Shared/Projects/XCompiler/powerpc-linux
-I add that to $PATH
-made a new folder build-binutils and ran configure from inside that folder. Configure went smoothly
-ran make all inside that folder. hit the error

Code:
[saistain XCompiler]$ setenv TARGET powerpc-linux
[saistain XCompiler]$ echo $TARGET
powerpc-linux
[saistain XCompiler]$ setenv PREFIX /common/Shared/Projects/XCompiler/$TARGET
[saistain XCompiler]$ echo $PREFIX
/common/Shared/Projects/XCompiler/powerpc-linux
[saistain XCompiler]$ setenv PATH ${PATH}:$PREFIX/bin
[saistain XCompiler]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/java/bin:/opt /vlsi/synopsys/ai_bin:/opt/vlsi/synopsys/linux/syn/bin:/opt/vlsi/synopsys/hspice /linux:/opt/vlsi/synopsys/bin:/common/Shared/Projects/XCompiler/powerpc-linux/bin
[saistain XCompiler]$ mkdir build-binutils
[saistain XCompiler]$ cd build-binutils/
[saistain build-binutils]$ ../binutils-2.9.1/configure --target=$TARGET --prefix=$PREFIX

[saistain build-binutils]$ make all
make[1]: Entering directory `/common/Shared/Projects/XCompiler/build-binutils/libiberty'
if [ -n "" ] && [ ! -d pic ]; then \
mkdir pic; \
else true; fi
touch stamp-picdir
echo "# !Automatically generated from ../../binutils-2.9.1/libiberty/functions.def"\
"- DO NOT EDIT!" >needed2.awk
grep '^DEFVAR(' < ../../binutils-2.9.1/libiberty/functions.def \
| sed -e '/DEFVAR/s|DEFVAR.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
grep '^DEFFUNC(' < ../../binutils-2.9.1/libiberty/functions.def \
| sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
gcc -c -g -O2 -I. -I../../binutils-2.9.1/libiberty/../include ../../binutils-2.9.1/libiberty/dummy.c 2>/dev/null
make[1]: *** [dummy.o] Error 1
make[1]: Leaving directory `/common/Shared/Projects/XCompiler/build-binutils/libiberty'
make: *** [all-libiberty] Error 2
note: the output from configure was snipped, since it was too long, but it was successful. I can post it if necessary

yea if anybody has any idea at all it'll be greatly appreciated. thx for ur time!
 
Old 10-15-2007, 01:11 AM   #2
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
Code:
gcc -c -g -O2 -I. -I../../binutils-2.9.1/libiberty/../include ../../binutils-2.9.1/libiberty/dummy.c 2>/dev/null
this compile line is ending in 2>/dev/null which i think is dumping all the error messages down the drain.

i think try to take that 2>/dev/null out of the makefile so you can see errors.
or even enter the compile command by hand without the 2>/dev/null
 
Old 10-15-2007, 01:33 AM   #3
saistain
LQ Newbie
 
Registered: Oct 2007
Posts: 9

Original Poster
Rep: Reputation: 0
actually I think I solved my own problem - my version of binutils is too old - something must have changed in binutils that the native gcc on my system doesn't recognise it

I'll test with latest binutils

thx for the reply!
 
Old 10-15-2007, 06:37 AM   #4
saistain
LQ Newbie
 
Registered: Oct 2007
Posts: 9

Original Poster
Rep: Reputation: 0
more problems

I managed to make and install binutils (well I'm not sure it's successful, but it didn't return any errors)

Now gcc is giving me errors

I configured with this command:
../gcc-4.2.2/configure --target=$TARGET --prefix=$PREFIX --without-headers --with-newlib -with-gnu-as -with-gnu-ld

make all-gcc ran for a long time (about 10 mins) before returning this error:

Code:
/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/bin/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
/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/bin/ranlib
./libgcov.a
/common/Shared/Projects/MP3Decoder/build-gcc/./gcc/xgcc
-B/common/Shared/Projects/MP3Decoder/build-gcc/./gcc/
-B/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/bin/
-B/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/lib/ -isystem
/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/include -isystem
/common/Shared/Projects/MP3Decoder/powerpc-linux/powerpc-linux/sys-include -O2
-O2 -g -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include  -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-4.2.2/gcc
-I../../gcc-4.2.2/gcc/. -I../../gcc-4.2.2/gcc/../include
-I../../gcc-4.2.2/gcc/../libcpp/include  -I../../gcc-4.2.2/gcc/../libdecnumber
-I../libdecnumber -fPIC -mstrict-align -fexceptions -fvisibility=hidden
-DHIDE_EXPORTS -c ../../gcc-4.2.2/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from ./gthr-default.h:1,
                 from ../../gcc-4.2.2/gcc/gthr.h:114,
                 from ../../gcc-4.2.2/gcc/unwind-dw2.c:42:
../../gcc-4.2.2/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or
directory
../../gcc-4.2.2/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or
directory
In file included from ./gthr-default.h:1,
                 from ../../gcc-4.2.2/gcc/gthr.h:114,
                 from ../../gcc-4.2.2/gcc/unwind-dw2.c:42:
../../gcc-4.2.2/gcc/gthr-posix.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_key_t’
../../gcc-4.2.2/gcc/gthr-posix.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_once_t’
../../gcc-4.2.2/gcc/gthr-posix.h:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_mutex_t’
../../gcc-4.2.2/gcc/gthr-posix.h:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_recursive_mutex_t’
../../gcc-4.2.2/gcc/gthr-posix.h:92: error: ‘pthread_once’ undeclared here (not
in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:92: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_once’
../../gcc-4.2.2/gcc/gthr-posix.h:93: error: ‘pthread_getspecific’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:93: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_getspecific’
../../gcc-4.2.2/gcc/gthr-posix.h:94: error: ‘pthread_setspecific’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:94: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_setspecific’
../../gcc-4.2.2/gcc/gthr-posix.h:95: error: ‘pthread_create’ undeclared here
(not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:95: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_create’
../../gcc-4.2.2/gcc/gthr-posix.h:96: error: ‘pthread_cancel’ undeclared here
(not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:96: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_cancel’
../../gcc-4.2.2/gcc/gthr-posix.h:97: error: ‘pthread_mutex_lock’ undeclared here
(not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:97: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_lock’
../../gcc-4.2.2/gcc/gthr-posix.h:98: error: ‘pthread_mutex_trylock’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:98: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_trylock’
../../gcc-4.2.2/gcc/gthr-posix.h:99: error: ‘pthread_mutex_unlock’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:99: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_unlock’
../../gcc-4.2.2/gcc/gthr-posix.h:100: error: ‘pthread_mutex_init’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:100: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_init’
../../gcc-4.2.2/gcc/gthr-posix.h:103: error: ‘pthread_key_create’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:103: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_key_create’
../../gcc-4.2.2/gcc/gthr-posix.h:104: error: ‘pthread_key_delete’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:104: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_key_delete’
../../gcc-4.2.2/gcc/gthr-posix.h:105: error: ‘pthread_mutexattr_init’ undeclared
here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:105: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_init’
../../gcc-4.2.2/gcc/gthr-posix.h:106: error: ‘pthread_mutexattr_settype’
undeclared here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:106: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_settype’
../../gcc-4.2.2/gcc/gthr-posix.h:107: error: ‘pthread_mutexattr_destroy’
undeclared here (not in a function)
../../gcc-4.2.2/gcc/gthr-posix.h:107: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_destroy’
../../gcc-4.2.2/gcc/gthr-posix.h:572: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:581: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:587: error: expected ‘)’ before ‘key’
../../gcc-4.2.2/gcc/gthr-posix.h:593: error: expected ‘)’ before ‘key’
../../gcc-4.2.2/gcc/gthr-posix.h:599: error: expected ‘)’ before ‘key’
../../gcc-4.2.2/gcc/gthr-posix.h:605: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:614: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:623: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:633: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:654: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:660: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/gthr-posix.h:666: error: expected ‘)’ before ‘*’ token
../../gcc-4.2.2/gcc/unwind-dw2.c: In function ‘uw_init_context_1’:
../../gcc-4.2.2/gcc/unwind-dw2.c:1417: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘once_regsizes’
../../gcc-4.2.2/gcc/unwind-dw2.c:1417: error: ‘once_regsizes’ undeclared (first
use in this function)
../../gcc-4.2.2/gcc/unwind-dw2.c:1417: error: (Each undeclared identifier is
reported only once
../../gcc-4.2.2/gcc/unwind-dw2.c:1417: error: for each function it appears in.)
../../gcc-4.2.2/gcc/unwind-dw2.c:1417: error: ‘PTHREAD_ONCE_INIT’ undeclared
(first use in this function)
../../gcc-4.2.2/gcc/unwind-dw2.c:1418: warning: implicit declaration of function
‘__gthread_once’
make[2]: *** [libgcc/./unwind-dw2.o] Error 1
make[2]: Leaving directory `/common/Shared/Projects/MP3Decoder/build-gcc/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/common/Shared/Projects/MP3Decoder/build-gcc/gcc'
make: *** [all-gcc] Error 2
what's the problem? why does make always return errors? does it every work first time?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help building x86_64 Cross compiler on x86 linux (Red Hat) torque_dwf Linux - Software 4 01-08-2009 03:37 AM
Trouble building a Cross Compiler to use to build a x86_64 kernel. nLEyETn Linux - Software 2 05-08-2007 06:35 PM
glib Error: while building Cross-Compiler for PPC Dhana_pal Linux From Scratch 2 12-28-2006 12:57 AM
Building cross-compiler gcc for powerpc-linux ccool Linux - General 3 09-17-2004 06:33 AM
Building an ARM7 cross compiler from gcc Charlie_B Linux - Software 2 08-20-2003 08:59 AM


All times are GMT -5. The time now is 01:34 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration