[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] etherboot: Build fixes for gcc 4.7.
# HG changeset patch # User Keir Fraser <keir@xxxxxxx> # Date 1345020081 -3600 # Node ID 6d56e31fe1e1dc793379d662a36ff1731760eb0c # Parent 1df4fdbaade0848496a8b398edab98887751de20 etherboot: Build fixes for gcc 4.7. Signed-off-by: Keir Fraser <keir@xxxxxxx> --- diff -r 1df4fdbaade0 -r 6d56e31fe1e1 tools/firmware/etherboot/patches/build_fix_1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/firmware/etherboot/patches/build_fix_1.patch Wed Aug 15 09:41:21 2012 +0100 @@ -0,0 +1,28 @@ +Fix compile error in isabus_probe with gcc 4.7 + +The copy of ipxe used during Xen tools build does not define +ISA_PROBE_ADDRS. As a result isa_extra_probe_addrs[] has a size of 0. +ISA_IOADDR() tries to access that empty array, which is detected by the +newer gcc (or perhaps the warning was just turned into an error) + +drivers/bus/isa.c: In function 'isabus_probe': +drivers/bus/isa.c:112:18: error: array subscript is above array bounds [-Werror=array-bounds] + +--- + src/drivers/bus/isa.c | 3 +++ + 1 file changed, 3 insertions(+) + +Index: ipxe/src/drivers/bus/isa.c +=================================================================== +--- ipxe.orig/src/drivers/bus/isa.c ++++ ipxe/src/drivers/bus/isa.c +@@ -97,6 +97,9 @@ static int isabus_probe ( struct root_de + int ioidx; + int rc; + ++ if ( ISA_EXTRA_PROBE_ADDR_COUNT == 0 ) ++ return 0; ++ + for_each_table_entry ( driver, ISA_DRIVERS ) { + for ( ioidx = ISA_IOIDX_MIN ( driver ) ; + ioidx <= ISA_IOIDX_MAX ( driver ) ; ioidx++ ) { diff -r 1df4fdbaade0 -r 6d56e31fe1e1 tools/firmware/etherboot/patches/build_fix_2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/firmware/etherboot/patches/build_fix_2.patch Wed Aug 15 09:41:21 2012 +0100 @@ -0,0 +1,48 @@ +fix compile error in isabus_probe with gcc4.7 + +The copy of ipxe used during Xen tools build fails to compile with gcc +4.7: +drivers/net/myri10ge.c: In function 'myri10ge_command': +drivers/net/myri10ge.c:308:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] +drivers/net/myri10ge.c:310:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] + +This patch simply turns the pad array into quantities of u32. +If thats not the right fix due to hardware limitations, I can provide a +different patch. + +--- + src/drivers/net/myri10ge.c | 6 +++--- + src/drivers/net/myri10ge_mcp.h | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +Index: ipxe/src/drivers/net/myri10ge.c +=================================================================== +--- ipxe.orig/src/drivers/net/myri10ge.c ++++ ipxe/src/drivers/net/myri10ge.c +@@ -304,10 +304,10 @@ static int myri10ge_command ( struct myr + command->response_addr.high = 0; + command->response_addr.low + = htonl ( virt_to_bus ( &priv->dma->command_response ) ); +- for ( i=0; i<36; i+=4 ) +- * ( uint32 * ) &command->pad[i] = 0; ++ for ( i=0; i<9; i++ ) ++ command->pad[i] = 0; + wmb(); +- * ( uint32 * ) &command->pad[36] = 0; ++ command->pad[9] = 0; + + /* Wait up to 2 seconds for a response. */ + +Index: ipxe/src/drivers/net/myri10ge_mcp.h +=================================================================== +--- ipxe.orig/src/drivers/net/myri10ge_mcp.h ++++ ipxe/src/drivers/net/myri10ge_mcp.h +@@ -80,7 +80,7 @@ struct mcp_cmd { + /* 16 */ + struct mcp_dma_addr response_addr; + /* 24 */ +- uint8_t pad[40]; ++ uint32_t pad[10]; + }; + typedef struct mcp_cmd mcp_cmd_t; + diff -r 1df4fdbaade0 -r 6d56e31fe1e1 tools/firmware/etherboot/patches/build_fix_3.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/firmware/etherboot/patches/build_fix_3.patch Wed Aug 15 09:41:21 2012 +0100 @@ -0,0 +1,13 @@ +diff --git a/src/drivers/infiniband/qib7322.c b/src/drivers/infiniband/qib7322.c +index b66f8ef..d8a54c9 100644 +--- a/src/drivers/infiniband/qib7322.c ++++ b/src/drivers/infiniband/qib7322.c +@@ -2120,7 +2120,7 @@ static int qib7322_ahb_write ( struct qib7322 *qib7322, unsigned int location, + */ + static int qib7322_ahb_mod_reg ( struct qib7322 *qib7322, unsigned int location, + uint32_t value, uint32_t mask ) { +- uint32_t old_value; ++ uint32_t old_value = 0; + uint32_t new_value; + int rc; + diff -r 1df4fdbaade0 -r 6d56e31fe1e1 tools/firmware/etherboot/patches/series --- a/tools/firmware/etherboot/patches/series Wed Aug 15 09:43:25 2012 +0200 +++ b/tools/firmware/etherboot/patches/series Wed Aug 15 09:41:21 2012 +0100 @@ -1,1 +1,4 @@ boot_prompt_option.patch +build_fix_1.patch +build_fix_2.patch +build_fix_3.patch _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |