Subject: Re: building -current for macppc (still) fails in ofwboot (related
To: Havard Eidnes <he@NetBSD.org>
From: Timo Schoeler <timo.schoeler@riscworks.net>
List: current-users
Date: 10/18/2005 18:42:34
This is a multi-part message in MIME format.
--------------000505050303040504050806
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

>>> (...) #      link  ofwboot/ofwboot 
>>> /usr/tools/bin/powerpc--netbsd-ld -s -N -Ttext E00000 -Bstatic -o
>>>  ofwboot.el1  Locore.o boot.o ofdev.o hfs.o net. o netif_of.o
>>> alloc.o vers.o ofwmagic.o byteorder.o 
>>> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/sa/libsa.a /usr/obj 
>>> /sys/arch/macppc/stand/ofwboot/lib/z/libz.a 
>>> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/kern/libkern.a
>>> 
>>> *** Failed target:  ofwboot *** Failed command:
>>> /usr/tools/bin/powerpc--netbsd-ld -s -N -Ttext E00000 -Bstatic -o
>>> ofwboot.el1 Locore.o boot.o ofdev.o hfs.o net.o netif_of.o
>>> alloc.o vers.o ofwmagic.o byteorder.o 
>>> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/ sa/libsa.a
>>> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/z/libz.a 
>>> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/kern/li bkern.a ***
>>> Error code 1
>> 
>> 
>> I don't see an error message from ld in there.  Did you perhaps 
>> forget to redirect stderr?
>> 
>> Regards,
>> 
>> - Håvard

> thanks,
> 
> yip, i forgot to merge my stdout and stderr :-O
> 
> command used:
> 
> ./build.sh -m macppc -O /usr/obj -D /usr/dest -T /usr/tools release
> 
> cvs checked out freshly yesterday at about 8pm CET.
> 
> here's what the machines says:
> 
> #      link  ofwboot/ofwboot /usr/tools/bin/powerpc--netbsd-ld -s -N
> -Ttext E00000 -Bstatic -o ofwboot.el1  Locore.o boot.o ofdev.o hfs.o
> net.o netif_of.o alloc.o vers.o ofwmagic.o byteorder.o
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/sa/libsa.a
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/z/libz.a
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/kern/libkern.a 
> Locore.o(.text+0x90): In function `_start': : undefined reference to
> `startup'
> 
> *** Failed target:  ofwboot *** Failed command:
> /usr/tools/bin/powerpc--netbsd-ld -s -N -Ttext E00000 -Bstatic -o
> ofwboot.el1 Locore.o boot.o ofdev.o hfs.o net.o netif_of.o alloc.o
> vers.o ofwmagic.o byteorder.o
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/sa/libsa.a
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/z/libz.a
> /usr/obj/sys/arch/macppc/stand/ofwboot/lib/kern/libkern.a *** Error
> code 1
> 
> Stop. nbmake: stopped in /usr/src/sys/arch/macppc/stand/ofwboot
> 
> *** Failed target:  dependall *** Failed command: cd
> /usr/src/sys/arch/macppc/stand/ofwboot; /usr/tools/bin/nbmake realall
>  *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src/sys/arch/macppc/stand/ofwboot
> 
> *** Failed target:  dependall-ofwboot *** Failed command:
> _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}"
> in /*) this="${dir}/"; real="${dir}" ;; .)
> this="sys/arch/macppc/stand/"; real="/usr/src/sys/arch/macppc/stand"
> ;; *) this="sys/arch/macppc/stand/${dir}/";
> real="/usr/src/sys/arch/macppc/stand/${dir}" ;; esac;
> show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd
> "${real}" && /usr/tools/bin/nbmake _THISDIR_="${this}" "$@"
> ${target}; }; _makedirtarget ofwboot dependall *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src/sys/arch/macppc/stand
> 
> *** Failed target:  dependall-stand *** Failed command:
> _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}"
> in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/arch/macppc/";
> real="/usr/src/sys/arch/macppc" ;; *) this="sys/arch/macppc/${dir}/";
> real="/usr/src/sys/arch/macppc/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget stand dependall *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src/sys/arch/macppc
> 
> *** Failed target:  dependall-macppc *** Failed command:
> _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}"
> in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/arch/";
> real="/usr/src/sys/arch" ;; *) this="sys/arch/${dir}/";
> real="/usr/src/sys/arch/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget macppc dependall *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src/sys/arch
> 
> *** Failed target:  dependall-arch *** Failed command:
> _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}"
> in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/";
> real="/usr/src/sys" ;; *) this="sys/${dir}/";
> real="/usr/src/sys/${dir}" ;; esac; show=${this:-.}; echo "${target}
> ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget arch dependall *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src/sys
> 
> *** Failed target:  dependall-sys *** Failed command:
> _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}"
> in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src"
> ;; *) this="${dir}/"; real="/usr/src/${dir}" ;; esac;
> show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd
> "${real}" && /usr/tools/bin/nbmake _THISDIR_="${this}" "$@"
> ${target}; }; _makedirtarget sys dependall *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src
> 
> *** Failed target:  do-build *** Failed command: _makedirtarget() {
> dir="$1"; shift; target="$1"; shift; case "${dir}" in /*)
> this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *)
> this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget . dependall BUILD_tools=no BUILD_lib=no *** Error code
> 1
> 
> Stop. nbmake: stopped in /usr/src
> 
> *** Failed target:  build *** Failed command: _makedirtarget() {
> dir="$1"; shift; target="$1"; shift; case "${dir}" in /*)
> this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *)
> this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget . do-build *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src
> 
> *** Failed target:  distribution *** Failed command: _makedirtarget()
> { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*)
> this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *)
> this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget . build NOPOSTINSTALL=1 *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src
> 
> *** Failed target:  release *** Failed command: _makedirtarget() {
> dir="$1"; shift; target="$1"; shift; case "${dir}" in /*)
> this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *)
> this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo
> "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" &&
> /usr/tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; };
> _makedirtarget . distribution *** Error code 1
> 
> Stop. nbmake: stopped in /usr/src
> 
> ERROR: Failed to make release *** BUILD ABORTED ***
> 
> thanks,
> 
> timo

hi,

removing the 'static' declaration from startup and setup in Locore.c 
fixes the problem. special thanks to Tim Kelly for his help and advice! :)

could anybody please investigate on why it runs with the declaration 
removed, but fails with static set for startup and setup?

i attached the patch for Locore.c.

thanks,

timo

--------------000505050303040504050806
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="Locore.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Locore.c.diff"

--- Locore.c_orig       2005-10-18 16:33:27.000000000 +0000
+++ Locore.c    2005-10-18 15:51:39.000000000 +0000
@@ -40,8 +40,8 @@
 
 static int (*openfirmware)(void *);
 
-static void startup(void *, int, int (*)(void *), char *, int);
-static void setup(void);
+void startup(void *, int, int (*)(void *), char *, int);
+void setup(void);
 
 static int stack[8192/4 + 4];
 
@@ -119,7 +119,7 @@
 }
 #endif
 
-static void
+void
 startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
 {
        extern char etext[], _end[], _edata[];
@@ -568,7 +568,7 @@
 static int stdin;
 static int stdout;
 
-static void
+void
 setup(void)
 {
        int chosen;

--------------000505050303040504050806--