Building cross compiler for x86_64
Frank W. Miller
fwmiller@cornfed.com
Sat Feb 16 20:06:00 GMT 2008
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
>
>
>
More information about the Gcc-help
mailing list