From: Wolfgang Denk Date: Sat, 26 Dec 2009 00:33:43 +0100 Subject: [U-Boot] [PATCH] omap3: beagle: fix compile error In-Reply-To: <1261580085-22547-1-git-send-email-premi@ti.com> References: <1261580085-22547-1-git-send-email-premi@ti.com> Message-ID: <20091225233343.C77B424F20@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Sanjeev Premi, In message <1261580085-22547-1-git-send-email-premi@ti.com> you wrote: > The configuration for beagle undefs CONFIG_CMD_NET. > This leads to following error: > > lib_arm/libarm.a(board.o): In function `start_armboot': > /home/premi/u-boot/lib_arm/board.c:360: undefined reference > to `getenv_IPaddr' > make: *** [u-boot] Error 1 > > This patch fixes the error by including offending line > in appropriate ifdef. > > Signed-off-by: Sanjeev Premi > --- > lib_arm/board.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/lib_arm/board.c b/lib_arm/board.c > index e148739..e289fc9 100644 > --- a/lib_arm/board.c > +++ b/lib_arm/board.c > @@ -357,8 +357,9 @@ void start_armboot (void) > #endif > > /* IP Address */ > +#ifdef CONFIG_CMD_NET > gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr"); > - > +#endif > stdio_init (); /* get the devices list going. */ I don't think this is the right way to fix the problem. This is global ARM code, and there may well be ARM boards out there that do not have network support in U-Boot, but they do so in Linux, which makes it desirable to be able to port network configuration (like the IP address) to the Linux kernel. We should not make the passing of the IP configuration to Linux dependent on U-Boot features / settings. Why cannot you simply implement getenv_IPaddr() ? I think the right way to fix this issue is to make getenv_IPaddr() always available, independent of CONFIG_NET. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de panic: can't find /