Kernel cross-compile issue (related to gcc?)

Hi all,

I followed instructions to cross compile a kernel for arm (AVILA BOARD) (http://people.freebsd.org/~cognet/freebsd_arm.txt).

Everything is going well until I try to build the kernel. When I type "make depend all" to build to kernel, I get this error:

Code:
/usr/cross/usr/bin/gcc -mbig-endian -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I../../../legacy -I../../.. -I../../../contrib/altq -I../../../contrib/ipfilter -I../../../contrib/pf -I../../../dev/ath -I../../../dev/ath/ath_hal -I../../../contrib/ngatm -I../../../dev/twa -I../../../gnu/fs/xfs/FreeBSD -I../../../gnu/fs/xfs/FreeBSD/support -I../../../gnu/fs/xfs -I../../../contrib/opensolaris/compat -I../../../dev/cxgb -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mcpu=xscale -ffreestanding ../../../arm/arm/genassym.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
*** Error code 1

Stop in /usr/src/sys/arm/compile/AVILA.


It seems like it is not finding cc1.

I've read that cc1 should be found in /usr/libexec/cc1 and I have it -- but I guess that I need the "cross compiling" version of cc1.
But if I look in the cross compile directory (/usr/cross/usr/) I see that libexec is not a directory but a file (!?!).

Do you know what could be the problem here?

I'm using FreeBSD 8.0-CURRENT-200905 on i386, gcc version is 4.2.1 20070719


Thank you very much,

Francesco
 
Update:

It seems like that I can't even cross compile a simple hello world program.


Code:
# truss /usr/cross/usr/bin/gcc main.c
__sysctl(0xbfbfe658,0x2,0x809e0a0,0xbfbfe660,0x0,0x0) = 0 (0x0)
readlink("/etc/malloc.conf",0xbfbfe667,1024)     ERR#2 'No such file or directory'
issetugid(0x80951c1,0xbfbfe667,0x400,0xbfbfe660,0x0,0x0) = 0 (0x0)
break(0x8100000)     = 0 (0x0)
__sysctl(0xbfbfe8a8,0x2,0xbfbfe8b0,0xbfbfe8b4,0x0,0x0) = 0 (0x0)
mmap(0x0,1048576,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 671719424 (0x2809a000)
mmap(0x2819a000,417792,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 672768000 (0x2819a000)
munmap(0x2809a000,417792)    = 0 (0x0)
sysarch(0xa,0xbfbfead0,0xbfbfeaf8,0x805dad7,0x28101030,0xc) = 0 (0x0)
__sysctl(0xbfbfeacc,0x2,0x809e1c0,0xbfbfead4,0x0,0x0) = 0 (0x0)
sigaction(SIGINT,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
sigaction(SIGINT,{ 0x8051ae0 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
sigaction(SIGHUP,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
sigaction(SIGHUP,{ 0x8051ae0 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
sigaction(SIGTERM,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL SA_RESTART ss_t }) = 0 (0x0)
sigaction(SIGTERM,{ 0x8051ae0 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
sigaction(SIGPIPE,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
sigaction(SIGPIPE,{ 0x8051ae0 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
sigaction(SIGCHLD,{ SIG_DFL SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
access("main.c",0)       = 0 (0x0)
access("/usr/cross/usr/libdata/gcc/specs",4)     ERR#2 'No such file or directory'
access("/var/tmp/",7)       = 0 (0x0)
open("/dev/random",O_RDONLY,00)     = 3 (0x3)
read(3,"$\M-S\M-I1\M-~Z\M-|\M^W:,b\M-f"...,128)  = 128 (0x80)
close(3)      = 0 (0x0)
stat("/var/tmp/",{ mode=drwxrwxrwt ,inode=23553,size=512,blksize=4096 }) = 0 (0x0)
open("/var/tmp//ccSyATRe.s",O_RDWR|O_CREAT|O_EXCL,0600) = 3 (0x3)
close(3)      = 0 (0x0)
stat("/usr/cross/usr/bin/cc1",0xbfbfdb90)  ERR#2 'No such file or directory'
stat("/usr/cross/usr/bin/cc1",0xbfbfdb90)  ERR#2 'No such file or directory'
stat("/usr/cross/usr/libexec/cc1",0xbfbfdb90)    ERR#20 'Not a directory'
stat("/usr/cross/usr/libexec/cc1",0xbfbfdb90)    ERR#20 'Not a directory'
stat("/usr/cross/usr/libexec/cc1",0xbfbfdb90)    ERR#20 'Not a directory'
gcc: error trying to exec 'cc1': execvp: No such file or directory
vfork(0x0,0x28138000,0x80a494c,0x28138150,0x3,0xbfbfdc18) = 11493 (0x2ce5)
wait4(0x2ce5,0x28127098,0x0,0x0,0x4,0x0)  = 11493 (0x2ce5)
stat("/var/tmp//ccSyATRe.s",{ mode=-rw------- ,inode=23556,size=0,blksize=4096 }) = 0 (0x0)
unlink("/var/tmp//ccSyATRe.s")     = 0 (0x0)
process exit, rval = 1


It's looking for /usr/cross/usr/libexec/cc1 but for me libexec is not a directory, it is just a file. This is very strange, any ideas?

Thank you,

Francesco
 
francesco said:
It's looking for /usr/cross/usr/libexec/cc1 but for me libexec is not a directory, it is just a file.
Sounds like your install is a bit b0rked. libexec should be a directory. It probably didn't exist and a "cp somedir/file* /usr/cross/usr/libexec" created a file libexec with the contents of the last file copied.

It's quite likely you forgot to do the mkdir -p usr/libexec which is at the top of the page you posted.
 
Back
Top