Skip to contentSkip to conversation

Fix the Double defind for setenv on ARM platform

U-Boot New Zhong Hongbo 3 participants 8 messages Jul 30, 2011 – Aug 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

Today, I test s5p_goni board
1. I have found two issue:
(1) Double defind setenv
I found setenv defind in the file of include/common.h and arch/arm/include/asm/u-boot-arm.h. At the same time, common.h include u-boot-arm.h head file.
(2) The type of parameters is inconsistent for the setenv?
arch/arm/include/asm/u-boot-arm.h:
setenv(char *?char *)

include/common.h:
setenv(const char *?const char *)

When everyone build the board, the error information will be display as following:
/home/seedshope/work/home-project/obj/u-boot/include2/asm/u-boot-arm.h:66: error: conflicting types for 'setenv'

I have test the patch for armv7 cpu to use command "./MAKEALL -a arm -c armv7".
2. The reproduce step as following
(1) The build enviroment:
u-boot is the source PATH and /home/seedshope/work/home-project/obj/u-boot is my object path. The cross compile version as following:

Quoted 1 line

/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -v

Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/2009q3-respin-linux-lite/src/gcc-4.4/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q3-67' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/jul
ian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67)

(2) configure s5p_goni_board

Quoted 1 line

make -C u-boot O=/home/seedshope/work/home-project/obj/u-boot CROSS_COMPILE=/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi- distclean

make: Entering directory `/home/seedshope/work/home-project/u-boot' rm -rf /home/seedshope/work/home-project/obj/u-boot/*
make: Leaving directory `/home/seedshope/work/home-project/u-boot'

(3) build s5p_goni board

Quoted 1 line

make -C u-boot O=/home/seedshope/work/home-project/obj/u-boot CROSS_COMPILE=/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-

make: Entering directory `/home/seedshope/work/home-project/u-boot' Generating /home/seedshope/work/home-project/obj/u-boot/include/autoconf.mk Generating /home/seedshope/work/home-project/obj/u-boot/include/autoconf.mk.dep
make: Leaving directory `/home/seedshope/work/home-project/u-boot'
make: Entering directory `/home/seedshope/work/home-project/u-boot'

/usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc -DDO_DEPS_ONLY \
		-g  -Os   -fno-common -ffixed-r8 -msoft-float   -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x34800000 -I/home/seedshope/work/home-project/obj/u-boot/include2 -I/home/seedshope/work/home-project/obj/u-boot/include -I/home/seedshope/work/home-project/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security   \
		-o /home/seedshope/work/home-project/obj/u-boot/lib/asm-offsets.s /home/seedshope/work/home-project/u-boot/lib/asm-offsets.c -c -S

In file included from /home/seedshope/work/home-project/u-boot/include/common.h:276,
from /home/seedshope/work/home-project/u-boot/lib/asm-offsets.c:18:
/home/seedshope/work/home-project/obj/u-boot/include2/asm/u-boot-arm.h:66: error: conflicting types for 'setenv' /home/seedshope/work/home-project/u-boot/include/common.h:271: note: previous declaration of 'setenv' was here
make: *** [/home/seedshope/work/home-project/obj/u-boot/lib/asm-offsets.s] Error 1
make: Leaving directory `/home/seedshope/work/home-project/u-boot'

#1 lore raw

PATCH 1/1 Fix the Double defind for setenv

From: seedshope <[email protected]>

setenv is defined common.h. We do not need re-defined it

Zhong hongbo <[email protected]>

---
 arch/arm/include/asm/u-boot-arm.h |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
arch/arm/include/asm/u-boot-arm.h +0 -8
index 3904027..e3fbb53 100644
@@ -57,14 +57,6 @@ void	dram_init_banksize (void);
 void	setup_serial_tag (struct tag **params);
 void	setup_revision_tag (struct tag **params);
 
-/* ------------------------------------------------------------ */
-/* Here is a list of some prototypes which are incompatible to	*/
-/* the U-Boot implementation					*/
-/* To be fixed!							*/
-/* ------------------------------------------------------------ */
-/* common/cmd_nvedit.c */
-int	setenv		(char *, char *);
-
 /* cpu/.../interrupt.c */
 int	arch_interrupt_init	(void);
 void	reset_timer_masked	(void);
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/1 Fix the Double defind for setenv

Dear Zhong Hongbo,

Quoted 3 lines · In message <[email protected]> you wrote:

From: seedshope <[email protected]>

setenv is defined common.h. We do not need re-defined it

Thanks, but there are some more function prototypes in this block which are actually bogus. I have a more complete cleanup patch ready, I'm running MAKEALL to test it right now.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
A conservative is a man with two perfectly good legs  who  has  never
learned to walk.                              - Franklin D. Roosevelt
#3 lore raw

PATCH 1/1 ARM: fix error: conflicting types for 'setenv'

In reply to Zhong Hongbo

Also remove bogus comment.

Changed commit message

---
 arch/arm/include/asm/u-boot-arm.h |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
arch/arm/include/asm/u-boot-arm.h +0 -8
index 3904027..e3fbb53 100644
@@ -57,14 +57,6 @@ void	dram_init_banksize (void);
 void	setup_serial_tag (struct tag **params);
 void	setup_revision_tag (struct tag **params);
 
-/* ------------------------------------------------------------ */
-/* Here is a list of some prototypes which are incompatible to	*/
-/* the U-Boot implementation					*/
-/* To be fixed!							*/
-/* ------------------------------------------------------------ */
-/* common/cmd_nvedit.c */
-int	setenv		(char *, char *);
-
 /* cpu/.../interrupt.c */
 int	arch_interrupt_init	(void);
 void	reset_timer_masked	(void);
Signature · 1 line
1.7.6
#4 lore raw

PATCH 1/1 Unify timer_init() and cpu_init() prototypes

Clean up some duplicated prototype declarations.
Get rid of now useless AVR32 initcalls.h file.

Cc Albert Aribaud <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Graeme Russ <[email protected]>
---
 arch/arm/include/asm/u-boot-arm.h  |    3 ---
 arch/avr32/include/asm/initcalls.h |   30 ------------------------------
 arch/avr32/lib/board.c             |    1 -
 arch/x86/include/asm/u-boot-x86.h  |    1 -
 include/common.h                   |    3 +++
 5 files changed, 3 insertions(+), 35 deletions(-)
 delete mode 100644 arch/avr32/include/asm/initcalls.h
arch/arm/include/asm/u-boot-arm.h +0 -3
index e3fbb53..d3308f7 100644
@@ -63,7 +63,4 @@ void	reset_timer_masked	(void);
 ulong	get_timer_masked	(void);
 void	udelay_masked		(unsigned long usec);
 
-/* cpu/.../timer.c */
-int	timer_init		(void);
-
 #endif	/* _U_BOOT_ARM_H_ */
arch/avr32/include/asm/initcalls.h deleted +0 -30
deleted file mode 100644
index 57a278b..0000000
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2005, 2006 Atmel Corporation
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-#ifndef __ASM_AVR32_INITCALLS_H__
-#define __ASM_AVR32_INITCALLS_H__
-
-#include <config.h>
-
-extern int cpu_init(void);
-extern int timer_init(void);
-
-#endif /* __ASM_AVR32_INITCALLS_H__ */
arch/avr32/lib/board.c +0 -1
index e69f8d1..65473a1 100644
@@ -30,7 +30,6 @@
 #include <miiphy.h>
 #endif
 
-#include <asm/initcalls.h>
 #include <asm/sections.h>
 #include <asm/arch/mmu.h>
 
arch/x86/include/asm/u-boot-x86.h +0 -1
index 944e1a2..4f0d2c7 100644
@@ -36,7 +36,6 @@ typedef void (timer_fnc_t) (void);
 int register_timer_isr (timer_fnc_t *isr_func);
 
 /* Architecture specific - can be in arch/x86/cpu/, arch/x86/lib/, or $(BOARD)/ */
-int timer_init(void);
 int dram_init_f(void);
 
 /* cpu/.../interrupts.c */
include/common.h +3 -0
index b994e70..12a1074 100644
@@ -222,6 +222,9 @@ typedef void (interrupt_handler_t)(void *);
 
 void	hang		(void) __attribute__ ((noreturn));
 
+int	timer_init(void);
+int	cpu_init(void);
+
 /* */
 phys_size_t initdram (int);
 int	display_options (void);
Signature · 1 line
1.7.6
#5 lore raw

PATCH 1/1 Unify timer_init() and cpu_init() prototypes

Dear Wolfgang Denk,

Quoted 7 lines · In message <[email protected]> you wrote:

Clean up some duplicated prototype declarations. Get rid of now useless AVR32 initcalls.h file.

Cc Albert Aribaud <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Graeme Russ <[email protected]>
Quoted 8 lines
---
 arch/arm/include/asm/u-boot-arm.h  |    3 ---
 arch/avr32/include/asm/initcalls.h |   30 ------------------------------
 arch/avr32/lib/board.c             |    1 -
 arch/x86/include/asm/u-boot-x86.h  |    1 -
 include/common.h                   |    3 +++
 5 files changed, 3 insertions(+), 35 deletions(-)
 delete mode 100644 arch/avr32/include/asm/initcalls.h

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
The more we disagree, the more chance there is that at least  one  of
us is right.
#6 lore raw

PATCH 1/1 ARM: fix error: conflicting types for 'setenv'

In reply to Wolfgang Denk

Dear Albert,

Quoted 9 lines · In message <[email protected]> I wrote:

Also remove bogus comment.

Changed commit message

---
 arch/arm/include/asm/u-boot-arm.h |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

I applied this directly, it is causing too much trouble to delay it any longer.

Hope this is OK with you.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
Veni, Vidi, VISA:
        I came, I saw, I did a little shopping.
#7 lore raw

PATCH 1/1 Fix the Double defind for setenv

In reply to Zhong Hongbo
Quoted 5 lines · On Saturday, July 30, 2011 13:28:49 Zhong Hongbo wrote:

From: seedshope <[email protected]>

setenv is defined common.h. We do not need re-defined it

Zhong hongbo <[email protected]>

please fix your git env. it is setting the author field to "seedshope" which clearly is incorrect. it should be your name.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110807/f2db7642/attachment.pgp