binfmt_aout.c error: 'SEGMENT_SIZE' undeclared

lc2047
Anybody help me?

**************************************************************************
owner@ubuntu:~$ cd bin
owner@ubuntu:~/bin$ cd FriendlyARM/
owner@ubuntu:~/bin/FriendlyARM$ cd android/
owner@ubuntu:~/bin/FriendlyARM/android$ cd kernel/
owner@ubuntu:~/bin/FriendlyARM/android/kernel$ cp config_mini2440 .config 
owner@ubuntu:~/bin/FriendlyARM/android/kernel$ make menuconfig 
scripts/kconfig/mconf arch/arm/Kconfig


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

owner@ubuntu:~/bin/FriendlyARM/android/kernel$ make zImage
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  CHK     include/linux/compile.h
  CC      fs/binfmt_aout.o
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:317:30: error: 'SEGMENT_SIZE' undeclared (first use in
this function)
fs/binfmt_aout.c:317:30: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [fs/binfmt_aout.o] Error 1
make: *** [fs] Error 2
owner@ubuntu:~/bin/FriendlyARM/android/kernel$

open-nandra
Do you compile with cross compiler? Export ARCH and CROSS_COMPILE before
run make?

marek

lc2047
Attachment: binfmt_aout.c (15.2 KB)
Hi Marek

Thanks for your help.

compiler = Sourcery G++
The path is ready added.

From my picture, it should able to run compiler(Sourcery G++) & access code
file. But compiler say 'SEGMENT_SIZE' undeclared (first use in
this function). Seem something necessary to define before compile.

From binfmt_aout.c(line 99) Seem to define "START_DATA". Which is relate to
line 317

***************************************
#if defined(__alpha__)
#       define START_DATA(u)  (u.start_data)
#elif defined(__arm__)
#  define START_DATA(u)  ((u.u_tsize << PAGE_SHIFT) + u.start_code)
#elif defined(__sparc__)
#       define START_DATA(u)    (u.u_tsize)
#elif defined(__i386__) || defined(__mc68000__) || defined(__arch_um__)
#       define START_DATA(u)  (u.u_tsize << PAGE_SHIFT)
#endif
#ifdef __sparc__
#       define START_STACK(u)   ((regs->u_regs[UREG_FP]) & ~(PAGE_SIZE -
1))
#else
#       define START_STACK(u)   (u.start_stack)
#endif

open-nandra
Hi, well try to compile this way: make ARCH=arm CROSS_COMPILE=<prefix to
your cross compiler (without gcc) e.g. arm-linux-

marek

lc2047
marek

right. 

initially in Makefile is 
"CROSS_COMPILE=arm-linux-"
then modify it to be
CROSS_COMPILE=arm-none-linux-???(I am not sure)

After that it can beginning to complie. 
But shop in 'SEGMENT_SIZE' undeclared 

*******************************************
  CC      fs/binfmt_aout.o
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:317:30: error: 'SEGMENT_SIZE' undeclared (first use in
this function)
fs/binfmt_aout.c:317:30: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [fs/binfmt_aout.o] Error 1
make: *** [fs] Error 2

open-nandra
check if arm-none-linux-gcc is in your patch (which arm-none-linux-gcc
should give some path). Also ARCH=arm is set? Could you post sources what
you try to compile?

marek

lc2047
Attachment: Makefile.rar (16.53 KB)
Marek

Thanks for your help.
Do you mean below?
****************************

export KBUILD_BUILDHOST := $(SUBARCH)
ARCH    ?= arm
#CROSS_COMPILE  ?= arm-linux-
CROSS_COMPILE  ?= arm-none-eabi-

****************************


For source issue, the whole set source file is very big.
or you mean "Makefile"? Which is attached.

lc2047
For source, please download with below link.
http://www.friendlyarm.net/dl.php?file=android-kernel_20090825.tgz
http://www.friendlyarm.net/dl.php?file=android-fs_20090825.tgz

lc2047
I find some info.
http://moto.debian.org.tw/viewtopic.php?p=56720
&
http://hi.baidu.com/yatusiter/blog/item/6df3e8507a6e04541038c2a5.html

Who said something necessary be selected in make menuconfig to support
a.out.

Executable file formats ---> 
<M> Kernel support for a.out and ECOFF binaries 

What is the mean/ function of it"Kernel support for a.out and ECOFF
binaries"?

Also what different between "<M>" & "<*>"? Since the initial state is <*>.

open-nandra
Well your problem could be fixed:
1. rename in kernel directory config_mini2440 to .config
2. make ARCH=arm CROSS_COMPILE=arm-none-eabi- 

You will have no problems with compilation (at least I don't have ;)). 

marek