Subject: Re: current build problem, linux_exec_setup_stack undeclared
To: None <current-users@netbsd.org>
From: Russell McManus <russell_mcmanus@yahoo.com>
List: current-users
Date: 08/14/2003 09:28:31
tsutsui@ceres.dti.ne.jp (Izumi Tsutsui) writes:

> In article <HJJ8CE.IvB@tac.nyc.ny.us>
> christos@zoulas.com wrote:
> 
> > >My compat/linux/arch/powerpc/linux_exec.h has this (updated last night):
> > >#define linux_exec_setup_stack(a, b)	exec_setup_stack(a, b)
> > >Changing this to
> > >#define linux_exec_setup_stack	exec_setup_stack
> > >allows a kernel to compile - I haven't been able to verify if this is
> > >correct, though.
> > 
> > Looks correct but the previous version should work. Can you look at the
> > preprocessor output?
> 
> linux_exec_setup_stack is referred as a function pointer in exec_conf.c:
> ---
> #ifdef COMPAT_LINUX
> 	/* Linux Elf32 */
> 	{ sizeof (Elf32_Ehdr),
> [..snip..]
> 	  coredump_elf32,
> 	  linux_exec_setup_stack },
> #endif
> ---
> so the macro definition should not have args.

I don't think that this is sufficient to address the problem.  I have
edited sys/compat/linux/arch/powerpc/linux_exec.h as per your
suggestion:

#define linux_exec_setup_stack(a, b)	exec_setup_stack

Then after running "./build.sh -U -m macppc kernel=MYKERNEL release"
command, I get this compilation error:


/export/src/obj/tooldir.NetBSD-1.6-i386/bin/powerpc--netbsd-gcc  -msoft-float   -ffreestanding  -O2 -Wreturn-type -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Dmacppc -I.  -I/export/src/sys/arch -I/export/src/sys -nostdinc -DLKM -DDIAGNOSTIC -DZS_CONSOLE_ABORT -DCAPS_IS_CONTROL -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c /export/src/sys/kern/exec_conf.c
/export/src/sys/kern/exec_conf.c:380: `linux_exec_setup_stack' undeclared here (not in a function)
/export/src/sys/kern/exec_conf.c:380: initializer element is not constant
/export/src/sys/kern/exec_conf.c:380: (near initialization for `execsw_builtin[3].es_setup_stack')
/export/src/sys/kern/exec_conf.c:578: `linux_exec_setup_stack' undeclared here (not in a function)
/export/src/sys/kern/exec_conf.c:578: initializer element is not constant
/export/src/sys/kern/exec_conf.c:578: (near initialization for `execsw_builtin[5].es_setup_stack')
*** Error code 1

Since linux_exec_setup_stack is #defined to exec_setup_stack, I made
the change by hand in exec_conf.c.  This seems to be compiling, but is
not a fix.

-russ