From 317791d7ba0692e67be27cece5111ac3c4df2b50 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Sat, 21 Jul 2018 11:06:39 -0600 Subject: [PATCH] fix build failures with gcc-8, using a rather large stick --- debian/changelog | 6 + debian/patches/build-with-gcc-8.patch | 353 ++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 360 insertions(+) create mode 100644 debian/patches/build-with-gcc-8.patch diff --git a/debian/changelog b/debian/changelog index 739faa3..dfcb65d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cc1111 (2.9.0-8) unstable; urgency=high + + * patch around build problems with gcc 8, closes: #897717 + + -- Bdale Garbee Sat, 21 Jul 2018 11:06:18 -0600 + cc1111 (2.9.0-7) unstable; urgency=low * patch from Chris Lamb to enable reproducible builds, closes: #829493 diff --git a/debian/patches/build-with-gcc-8.patch b/debian/patches/build-with-gcc-8.patch new file mode 100644 index 0000000..28e1fac --- /dev/null +++ b/debian/patches/build-with-gcc-8.patch @@ -0,0 +1,353 @@ +diff --git a/sim/ucsim/s51.src/uc51.cc b/sim/ucsim/s51.src/uc51.cc +index 1bb4eb6..669a349 100644 +--- a/sim/ucsim/s51.src/uc51.cc ++++ b/sim/ucsim/s51.src/uc51.cc +@@ -332,24 +332,24 @@ cl_51core::disass(t_addr addr, const char *sep) + switch (*(b++)) + { + case 'A': // absolute address +- sprintf(temp, "%04"_A_"x", ++ sprintf(temp, "%04x", + t_addr((addr&0xf800)| + (((code>>5)&0x07)*256 + + rom->get(addr+1)))); + break; + case 'l': // long address +- sprintf(temp, "%04"_A_"x", ++ sprintf(temp, "%04x", + t_addr(rom->get(addr+1)*256 + + rom->get(addr+2))); + break; + case 'a': // addr8 (direct address) at 2nd byte + if (!get_name(rom->get(addr+1), sfr_tbl(), temp)) +- sprintf(temp, "%02"_M_"x", rom->get(addr+1)); ++ sprintf(temp, "%02x", rom->get(addr+1)); + break; + case '8': // addr8 (direct address) at 3rd byte + if (!get_name(rom->get(addr+2), sfr_tbl(), temp)) +- sprintf(temp, "%02"_M_"x", rom->get(addr+2)); +- //sprintf(temp, "%02"_M_"x", rom->get(addr+2)); ++ sprintf(temp, "%02x", rom->get(addr+2)); ++ //sprintf(temp, "%02x", rom->get(addr+2)); + break; + case 'b': // bitaddr at 2nd byte + { +@@ -359,30 +359,30 @@ cl_51core::disass(t_addr addr, const char *sep) + if (get_name((ba<128)?((ba/8)+32):(ba&0xf8), sfr_tbl(), temp)) + { + strcat(temp, "."); +- sprintf(c, "%1"_M_"d", ba & 0x07); ++ sprintf(c, "%1d", ba & 0x07); + strcat(temp, c); + break; + } +- sprintf(temp, "%02x.%"_M_"d", (ba<128)?((ba/8)+32):(ba&0xf8), ++ sprintf(temp, "%02x.%d", (ba<128)?((ba/8)+32):(ba&0xf8), + ba & 0x07); + break; + } + case 'r': // rel8 address at 2nd byte +- sprintf(temp, "%04"_A_"x", ++ sprintf(temp, "%04x", + t_addr(addr+2+(signed char)(rom->get(addr+1)))); + break; + case 'R': // rel8 address at 3rd byte +- sprintf(temp, "%04"_A_"x", ++ sprintf(temp, "%04x", + t_addr(addr+3+(signed char)(rom->get(addr+2)))); + break; + case 'd': // data8 at 2nd byte +- sprintf(temp, "%02"_M_"x", rom->get(addr+1)); ++ sprintf(temp, "%02x", rom->get(addr+1)); + break; + case 'D': // data8 at 3rd byte +- sprintf(temp, "%02"_M_"x", rom->get(addr+2)); ++ sprintf(temp, "%02x", rom->get(addr+2)); + break; + case '6': // data16 at 2nd(H)-3rd(L) byte +- sprintf(temp, "%04"_A_"x", ++ sprintf(temp, "%04x", + t_addr(rom->get(addr+1)*256 + + rom->get(addr+2))); + break; +diff --git a/sim/ucsim/s51.src/uc390.cc b/sim/ucsim/s51.src/uc390.cc +index a81420d..0a70996 100644 +--- a/sim/ucsim/s51.src/uc390.cc ++++ b/sim/ucsim/s51.src/uc390.cc +@@ -1123,11 +1123,11 @@ cl_uc390::disass (t_addr addr, const char *sep) + break; + case 'a': // addr8 (direct address) at 2nd byte + if (!get_name (rom->get (addr + 1), sfr_tbl (), temp)) +- sprintf (temp, "%02"_M_"x", rom->get (addr + 1)); ++ sprintf (temp, "%02x", rom->get (addr + 1)); + break; + case '8': // addr8 (direct address) at 3rd byte + if (!get_name (rom->get (addr + 2), sfr_tbl (), temp)) +- sprintf (temp, "%02"_M_"x", rom->get (addr + 2)); ++ sprintf (temp, "%02x", rom->get (addr + 2)); + break; + case 'b': // bitaddr at 2nd byte + { +@@ -1137,27 +1137,27 @@ cl_uc390::disass (t_addr addr, const char *sep) + if (get_name ((ba<128) ? ((ba/8)+32) : (ba&0xf8), sfr_tbl(), temp)) + { + strcat (temp, "."); +- sprintf (c, "%1"_M_"d", ba & 0x07); ++ sprintf (c, "%1d", ba & 0x07); + strcat (temp, c); + break; + } +- sprintf (temp, "%02x.%"_M_"d", (ba<128) ? ((ba/8)+32) : (ba&0xf8), ++ sprintf (temp, "%02x.%d", (ba<128) ? ((ba/8)+32) : (ba&0xf8), + ba & 0x07); + break; + } + case 'r': // rel8 address at 2nd byte +- sprintf (temp, "%04"_A_"x", ++ sprintf (temp, "%04x", + t_addr (addr + 2 + (signed char) (rom->get (addr + 1)))); + break; + case 'R': // rel8 address at 3rd byte +- sprintf (temp, "%04"_A_"x", ++ sprintf (temp, "%04x", + t_addr (addr + 3 + (signed char) (rom->get (addr + 2)))); + break; + case 'd': // data8 at 2nd byte +- sprintf (temp, "%02"_M_"x", rom->get (addr + 1)); ++ sprintf (temp, "%02x", rom->get (addr + 1)); + break; + case 'D': // data8 at 3rd byte +- sprintf (temp, "%02"_M_"x", rom->get (addr + 2)); ++ sprintf (temp, "%02x", rom->get (addr + 2)); + break; + default: + strcpy (temp, "?"); +diff --git a/sim/ucsim/avr.src/avr.cc b/sim/ucsim/avr.src/avr.cc +index 3b021e5..efa56f4 100644 +--- a/sim/ucsim/avr.src/avr.cc ++++ b/sim/ucsim/avr.src/avr.cc +@@ -265,7 +265,7 @@ cl_avr::disass(t_addr addr, const char *sep) + int k= code&0xfff; + if (code&0x800) + k|= -4096; +- sprintf(temp, "0x%06"_A_"x", ++ sprintf(temp, "0x%06x", + rom->validate_address(k+1+(signed int)addr)); + break; + } +diff --git a/sim/ucsim/cmd.src/set.cc b/sim/ucsim/cmd.src/set.cc +index dc5cbb7..fe9562e 100644 +--- a/sim/ucsim/cmd.src/set.cc ++++ b/sim/ucsim/cmd.src/set.cc +@@ -69,7 +69,7 @@ COMMAND_DO_WORK_UC(cl_set_mem_cmd) + if (len == 0) + con->dd_printf("Error: no data\n"); + else if (start < mem->get_start_address()) +- con->dd_printf("Start address less then 0x%"_A_"x\n", ++ con->dd_printf("Start address less then 0x%x\n", + mem->get_start_address()); + else + { +diff --git a/sim/ucsim/sim.src/stack.cc b/sim/ucsim/sim.src/stack.cc +index 60e13ad..d0bb443 100644 +--- a/sim/ucsim/sim.src/stack.cc ++++ b/sim/ucsim/sim.src/stack.cc +@@ -70,7 +70,7 @@ cl_stack_op::info_head(class cl_console_base *con) + void + cl_stack_op::info(class cl_console_base *con, class cl_uc *uc) + { +- con->dd_printf("%-4s 0x%06"_A_"x-0x%06"_A_"x %d ", ++ con->dd_printf("%-4s 0x%06x-0x%06x %d ", + get_op_name(), SP_before, SP_after, abs(SP_before-SP_after)); + print_info(con); + con->dd_printf(" "); +@@ -166,7 +166,7 @@ cl_stack_call::get_op_name(void) + void + cl_stack_call::print_info(class cl_console_base *con) + { +- con->dd_printf("0x%06"_A_"x", called_addr); ++ con->dd_printf("0x%06x", called_addr); + } + + const char * +@@ -217,7 +217,7 @@ cl_stack_intr::get_op_name(void) + void + cl_stack_intr::print_info(class cl_console_base *con) + { +- con->dd_printf("0x%06"_A_"x", called_addr); ++ con->dd_printf("0x%06x", called_addr); + } + + const char * +@@ -279,7 +279,7 @@ void + cl_stack_push::print_info(class cl_console_base *con) + { + t_addr d= data; +- con->dd_printf("0x%06"_A_"x", d); ++ con->dd_printf("0x%06x", d); + } + + int +@@ -468,8 +468,8 @@ cl_error_stack_tracker_empty::~cl_error_stack_tracker_empty(void) + void + cl_error_stack_tracker_empty::print(class cl_commander_base *c) + { +- c->dd_printf("%s(0x%06"_A_"x: %s on empty stack, PC=" +- "0x06"_A_"x, SP=0x%06"_A_"x->0x%06"_A_"x\n", ++ c->dd_printf("%s(0x%06x: %s on empty stack, PC=" ++ "0x06x, SP=0x%06x->0x%06x\n", + get_type_name(), operation->get_pc(), operation->get_op_name(), + operation->get_before(), operation->get_after()); + } +@@ -494,8 +494,8 @@ cl_error_stack_tracker_unmatch::~cl_error_stack_tracker_unmatch(void) + void + cl_error_stack_tracker_unmatch::print(class cl_commander_base *c) + { +- c->dd_printf("%s(0x%06"_A_"x): %s when %s expected, " +- "SP=0x%06"_A_"x->0x%06"_A_"x\n", ++ c->dd_printf("%s(0x%06x): %s when %s expected, " ++ "SP=0x%06x->0x%06x\n", + get_type_name(), operation->get_pc(), + operation->get_op_name(), top->get_matching_name(), + operation->get_before(), operation->get_after()); +@@ -520,7 +520,7 @@ cl_error_stack_tracker_inconsistent::~cl_error_stack_tracker_inconsistent(void) + void + cl_error_stack_tracker_inconsistent::print(class cl_commander_base *c) + { +- c->dd_printf("%s(0x%06"_A_"x): %d byte(s) unread from the stack\n", ++ c->dd_printf("%s(0x%06x): %d byte(s) unread from the stack\n", + get_type_name(), operation->get_pc(), + unread_data_size); + } +diff --git a/sim/ucsim/sim.src/sim.cc b/sim/ucsim/sim.src/sim.cc +index 248ca31..7e4ca80 100644 +--- a/sim/ucsim/sim.src/sim.cc ++++ b/sim/ucsim/sim.src/sim.cc +@@ -225,7 +225,7 @@ cl_sim::stop(class cl_ev_brk *brk) + cmd->frozen_console->read_line(); + */ + //con->dd_printf("Stop at 0x%06x\n", uc->PC); +- con->dd_printf("Event `%s' at %s[0x%"_A_"x]: 0x%"_A_"x %s\n", ++ con->dd_printf("Event `%s' at %s[0x%x]: 0x%x %s\n", + brk->id, brk->get_mem()->get_name(), brk->addr, + uc->instPC, + uc->disass(uc->instPC, " ")); +diff --git a/sim/ucsim/sim.src/brk.cc b/sim/ucsim/sim.src/brk.cc +index 12b87d6..59c87b7 100644 +--- a/sim/ucsim/sim.src/brk.cc ++++ b/sim/ucsim/sim.src/brk.cc +@@ -240,7 +240,7 @@ brk_coll::del_bp(t_addr addr) + /*if (rom && + addr < rom->size) + { +- fprintf(stderr, "brk_coll::del_bp(0x%"_A_"x\n", addr);//FIXME ++ fprintf(stderr, "brk_coll::del_bp(0x%x\n", addr);//FIXME + //rom->bp_map->clear(addr); + }*/ + } +diff --git a/sim/ucsim/sim.src/obsolete.cc b/sim/ucsim/sim.src/obsolete.cc +index ef9a2c1..3195a54 100644 +--- a/sim/ucsim/sim.src/obsolete.cc ++++ b/sim/ucsim/sim.src/obsolete.cc +@@ -233,7 +233,7 @@ cl_mem::read(t_addr addr) + if (addr >= size) + { + //FIXME +- fprintf(stderr, "Address 0x%06"_A_"x is over 0x%06"_A_"x\n", addr, size); ++ fprintf(stderr, "Address 0x%06x is over 0x%06x\n", addr, size); + return(0); + } + /*if ((loc= read_locs->get_loc(addr))) +@@ -281,7 +281,7 @@ cl_mem::write(t_addr addr, t_mem val) + ((TYPE_UWORD*)mem)[addr]= (*val)&mask; + else + ((TYPE_UDWORD*)mem)[addr]= (*val)&mask;*/ +- fprintf(stderr, "FIXME cl_mem::write(0x%06"_A_"x, 0x%04"_M_"x)\n", ++ fprintf(stderr, "FIXME cl_mem::write(0x%06x, 0x%04x)\n", + addr, val); + return(0); + } +diff --git a/sim/ucsim/sim.src/test_mem_speed.cc b/sim/ucsim/sim.src/test_mem_speed.cc +index 8290b93..0533508 100644 +--- a/sim/ucsim/sim.src/test_mem_speed.cc ++++ b/sim/ucsim/sim.src/test_mem_speed.cc +@@ -54,7 +54,7 @@ do_rw_test(class cl_mem *mem, int time) + d2= mem->write(a, d2); + d= mem->read(a); + if (d != d2) +- printf("%"_M_"d written to mem and %"_M_"d read back!\n", d2, d); ++ printf("%d written to mem and %d read back!\n", d2, d); + counter+= 1; + } + } +diff --git a/sim/ucsim/sim.src/uc.cc b/sim/ucsim/sim.src/uc.cc +index 2361bf4..f7d4a57 100644 +--- a/sim/ucsim/sim.src/uc.cc ++++ b/sim/ucsim/sim.src/uc.cc +@@ -1605,7 +1605,7 @@ cl_uc::stack_write(class cl_stack_op *op) + { + class cl_error_stack_tracker_wrong_handle *e= new + cl_error_stack_tracker_wrong_handle(DD_FALSE); +- //fprintf(stderr, "%06"_A_"x cl_uc::stack_read() should be called for " ++ //fprintf(stderr, "%06x cl_uc::stack_read() should be called for " + //"%s\n", op->get_pc(), op->get_op_name()); + e->init(); + error(e); +@@ -1625,14 +1625,14 @@ cl_uc::stack_read(class cl_stack_op *op) + cl_error_stack_tracker_wrong_handle(DD_TRUE); + e->init(); + error(e); +- //fprintf(stderr, "%06"_A_"x cl_uc::stack_write() should be called for " ++ //fprintf(stderr, "%06x cl_uc::stack_write() should be called for " + //"%s\n", op->get_pc(), op->get_op_name()); + return; + } + if (!top) + { + class cl_error *e= new cl_error_stack_tracker_empty(op); +- /*printf("0x%06"_A_"x %s operation on stack but no operation was before\n ++ /*printf("0x%06x %s operation on stack but no operation was before\n + ", + op->get_pc(), op->get_op_name());*/ + e->init(); +@@ -1647,13 +1647,13 @@ cl_uc::stack_read(class cl_stack_op *op) + class cl_error *e= new cl_error_stack_tracker_unmatch(top, op); + e->init(); + error(e); +- /*printf("0x%06"_A_"x %s operation on stack but last was %s\n", ++ /*printf("0x%06x %s operation on stack but last was %s\n", + op->get_pc(), op->get_op_name(), top->get_op_name());*/ + } + int top_size= top->data_size(), op_size= op->data_size(); + if (top_size != op_size) + { +- application->debug("0x%06"_A_"x %d bytes to read out of stack " ++ application->debug("0x%06x %d bytes to read out of stack " + "but %d was pushed in last operation\n", + op->get_pc(), op_size, top_size); + } +@@ -1670,9 +1670,9 @@ cl_uc::stack_read(class cl_stack_op *op) + } + if (removed != 1) + { +- application->debug("0x%06"_A_"x %d ops removed from stack-tracker " +- "when %s happened, top pc=0x%06"_A_"x " +- "top before=0x%06"_A_"x op after=0x%06"_A_"x\n", ++ application->debug("0x%06x %d ops removed from stack-tracker " ++ "when %s happened, top pc=0x%06x " ++ "top before=0x%06x op after=0x%06x\n", + op->get_pc(), removed, op->get_op_name(), + top?(top->get_pc()):0, top?(top->get_before()):0, + op->get_after()); +@@ -1683,9 +1683,9 @@ cl_uc::stack_read(class cl_stack_op *op) + int ta= top->get_after(), oa= op->get_after(); + if (ta != oa) + { +- application->debug("0x%06"_A_"x stack still inconsistent after %s, " ++ application->debug("0x%06x stack still inconsistent after %s, " + "%d byte(s) should be read out; top after" +- "=0x%06"_A_"x op after=0x%06"_A_"x\n", ++ "=0x%06x op after=0x%06x\n", + op->get_pc(), op->get_op_name(), abs(ta-oa), + ta, oa); + class cl_error *e= diff --git a/debian/patches/series b/debian/patches/series index 0bb6163..6dc802a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ updated_makebin suppress-additional-output-when-disabling-warning-18 reproducible_build +build-with-gcc-8.patch -- 2.30.2