Re: Building cross compiler for x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I tried recompiling both binutils and gcc using x86_64 as the target as
follows:

binutils:

configure --target=x86_64-pc-linux
make
make install

This works fine.  Then gcc:

configure --prefix=/usr/local --target=x86_64-pc-linux
--enable-languages="c"
make all-gcc

This fails.  I get the following error:

/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/xgcc
-B/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc/
-B/usr/local/x86_64-pc-linux/bin/ -B/usr/local/x86_64-pc-linux/lib/
-isystem /usr/local/x86_64-pc-linux/include
-isystem /usr/local/x86_64-pc-linux/sys-include -O2  -O2 -g -O2
-DIN_GCC -DCROSS_COMPILE -DNATIVE_CROSS   -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../.././gcc
-I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include
-I../.././gcc/../libdecnumber -I../libdecnumber -fexceptions
-fvisibility=hidden -DHIDE_EXPORTS -c ../.././gcc/unwind-dw2.c -o
libgcc/./unwind-dw2.o
In file included from ./gthr-default.h:1,
                 from ../.././gcc/gthr.h:114,
                 from ../.././gcc/unwind-dw2.c:42:
../.././gcc/gthr-posix.h:43:21: error: pthread.h: No such file or
directory
../.././gcc/gthr-posix.h:44:20: error: unistd.h: No such file or
directory
In file included from ./gthr-default.h:1,
                 from ../.././gcc/gthr.h:114,
                 from ../.././gcc/unwind-dw2.c:42:
../.././gcc/gthr-posix.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_key_t’
../.././gcc/gthr-posix.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_once_t’
../.././gcc/gthr-posix.h:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_mutex_t’
../.././gcc/gthr-posix.h:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘__gthread_recursive_mutex_t’
../.././gcc/gthr-posix.h:92: error: ‘pthread_once’ undeclared here (not
in a function)
../.././gcc/gthr-posix.h:92: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_once’
../.././gcc/gthr-posix.h:93: error: ‘pthread_getspecific’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:93: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_getspecific’
../.././gcc/gthr-posix.h:94: error: ‘pthread_setspecific’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:94: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_setspecific’
../.././gcc/gthr-posix.h:95: error: ‘pthread_create’ undeclared here
(not in a function)
../.././gcc/gthr-posix.h:95: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_create’
../.././gcc/gthr-posix.h:96: error: ‘pthread_cancel’ undeclared here
(not in a function)
../.././gcc/gthr-posix.h:96: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_cancel’
../.././gcc/gthr-posix.h:97: error: ‘pthread_mutex_lock’ undeclared here
(not in a function)
../.././gcc/gthr-posix.h:97: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_lock’
../.././gcc/gthr-posix.h:98: error: ‘pthread_mutex_trylock’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:98: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_trylock’
../.././gcc/gthr-posix.h:99: error: ‘pthread_mutex_unlock’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:99: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_unlock’
../.././gcc/gthr-posix.h:100: error: ‘pthread_mutex_init’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:100: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutex_init’
../.././gcc/gthr-posix.h:103: error: ‘pthread_key_create’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:103: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_key_create’
../.././gcc/gthr-posix.h:104: error: ‘pthread_key_delete’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:104: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_key_delete’
../.././gcc/gthr-posix.h:105: error: ‘pthread_mutexattr_init’ undeclared
here (not in a function)
../.././gcc/gthr-posix.h:105: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_init’
../.././gcc/gthr-posix.h:106: error: ‘pthread_mutexattr_settype’
undeclared here (not in a function)
../.././gcc/gthr-posix.h:106: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_settype’
../.././gcc/gthr-posix.h:107: error: ‘pthread_mutexattr_destroy’
undeclared here (not in a function)
../.././gcc/gthr-posix.h:107: warning: type defaults to ‘int’ in
declaration of ‘__gthrw_pthread_mutexattr_destroy’
../.././gcc/gthr-posix.h:572: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:581: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:587: error: expected ‘)’ before ‘key’
../.././gcc/gthr-posix.h:593: error: expected ‘)’ before ‘key’
../.././gcc/gthr-posix.h:599: error: expected ‘)’ before ‘key’
../.././gcc/gthr-posix.h:605: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:614: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:623: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:633: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:654: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:660: error: expected ‘)’ before ‘*’ token
../.././gcc/gthr-posix.h:666: error: expected ‘)’ before ‘*’ token
../.././gcc/unwind-dw2.c: In function ‘uw_init_context_1’:
../.././gcc/unwind-dw2.c:1417: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘once_regsizes’
../.././gcc/unwind-dw2.c:1417: error: ‘once_regsizes’ undeclared (first
use in this function)
../.././gcc/unwind-dw2.c:1417: error: (Each undeclared identifier is
reported only once
../.././gcc/unwind-dw2.c:1417: error: for each function it appears in.)
../.././gcc/unwind-dw2.c:1417: error: ‘PTHREAD_ONCE_INIT’ undeclared
(first use in this function)
../.././gcc/unwind-dw2.c:1418: warning: implicit declaration of function
‘__gthread_once’
make[2]: *** [libgcc/./unwind-dw2.o] Error 1
make[2]: Leaving directory
`/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory
`/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/gcc'
make: *** [all-gcc] Error 2


Thoughts?
FM



On Fri, 2008-02-15 at 11:30 -0700, Frank W. Miller wrote:
> OK, so I'm off trying to build the x86_64 cross toolchain.  My host is
> FC8 on a PC.
> 
> binutils-2.18 builds fine.
> 
> configure --target=x86_64-elf
> make
> make install
> 
> This gets me a nice set of tools in /usr/local/x86_64-elf/bin
> 
> I then try to build gcc-4.2.3
> 
> I tried:
> 
> configure --prefix=/usr/local --target=x86_64-elf
> make all-gcc
> 
> This gets me an error saying x86_64-elf is not a supported target.  I
> think tried substituting make all-gcc with make -k (after deleting the
> source tree and starting over).  I get this error somewhere down the
> line:
> 
> source='../.././libdecnumber/decimal128.c' object='decimal128.o'
> libtool=no gcc  -I../.././libdecnumber -I.  -g -O2 -W -Wall
> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
> -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -pedantic
> -Wno-long-long  -I../.././libdecnumber -I.
> -c ../.././libdecnumber/decimal128.c
> rm -f libdecnumber.a
> ar cru libdecnumber.a decNumber.o decContext.o decUtility.o decimal32.o
> decimal64.o decimal128.o
> ranlib libdecnumber.a
> make[2]: Leaving directory
> `/home/fwmiller/Desktop/gcc-4.2.3/host-i686-pc-linux-gnu/libdecnumber'
> make[1]: Target `all-host' not remade because of errors.
> make[1]: Target `all-target' not remade because of errors.
> make[1]: Leaving directory `/home/fwmiller/Desktop/gcc-4.2.3'
> make: *** [all] Error 2
> 
> 
> Can anyone comment?
> 
> Thanks,
> FM
> 
> 
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux