Re: [U-Boot] [PATCH] Fix breakage in SMC EEPROM standalone applications

Hi Tom,
Tom wrote:
Ben Warren wrote:
Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() global) inadvertently added ' #include "net.h" ' to the standalone programs, creating duplicate definitions of 'struct eth_device'. This patch removes the local definitions and removes other code that breaks due to the change in definition.
This patch may need refining. I see warnings in a number of arm targets
Old : err/versatile.ERR
smc91111_eeprom.c:33: error: redefinition of 'struct eth_device' make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1
New
err/versatile.ERR .../build/examples/standalone/smc91111_eeprom.o: In function `smc91111_eeprom': .../u-boot/src/u-boot-arm/examples/standalone/smc91111_eeprom.c:58: undefined reference to `memset' make[1]: *** [.../build/examples/standalone/smc91111_eeprom] Error 1
Tom
This builds cleanly for me. I am, however, using an old toolchain (gcc 4.0.0 from ELDK 4.1). Do struct member assignments use memset()? Line 58 is the closing brace and semicolon in the following:
struct eth_device dev = { .iobase = CONFIG_SMC91111_BASE };
regards, Ben

On Monday 18 January 2010 18:15:32 Ben Warren wrote:
Tom wrote:
Ben Warren wrote:
Commit 6a45e384955262882375a2785426dc65aeb636c4 (Make getenv_IPaddr() global) inadvertently added ' #include "net.h" ' to the standalone programs, creating duplicate definitions of 'struct eth_device'. This patch removes the local definitions and removes other code that breaks due to the change in definition.
This patch may need refining. I see warnings in a number of arm targets
Old : err/versatile.ERR
smc91111_eeprom.c:33: error: redefinition of 'struct eth_device' make[1]: *** [.../build/examples/standalone/smc91111_eeprom.o] Error 1
New
err/versatile.ERR .../build/examples/standalone/smc91111_eeprom.o: In function `smc91111_eeprom': .../u-boot/src/u-boot-arm/examples/standalone/smc91111_eeprom.c:58: undefined reference to `memset' make[1]: *** [.../build/examples/standalone/smc91111_eeprom] Error 1
This builds cleanly for me. I am, however, using an old toolchain (gcc 4.0.0 from ELDK 4.1). Do struct member assignments use memset()? Line 58 is the closing brace and semicolon in the following:
struct eth_device dev = { .iobase = CONFIG_SMC91111_BASE };
gcc may generate a reference to memset here because it wants to zero the other members as an optimization. this is why the smc911x_eeprom assigns things on the stack instead of using the form you show here. but i doubt this patch caused this problem directly. -mike
participants (2)
-
Ben Warren
-
Mike Frysinger