From 8d060ef375e34953443fcfbc5085def5f0f2993c Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Mon, 21 Oct 2019 17:07:09 +0200 Subject: [PATCH] Debian 10: switch to C++14 Some libraries, e.g. protobuf, depend on C++11 now. As they are (indirectly) included in some .ah aspect headers, everything has to be compiled with C++11 enabled now. This change switches to C++14 globally. Change-Id: I56a802bd510704d668a2b2c8957e11725fbe98b7 --- cmake/bochs.cmake | 2 +- cmake/compilerconfig.cmake | 7 +++++++ simulators/bochs/bx_debug/dbg_main.cc | 28 +++++++++++++-------------- simulators/bochs/cpu/paging.cc | 2 +- simulators/bochs/gui/paramtree.cc | 4 ++-- simulators/bochs/gui/siminterface.cc | 2 +- simulators/bochs/iodev/pit_wrap.cc | 6 +++--- simulators/bochs/iodev/sb16.cc | 1 + simulators/bochs/iodev/scsi_device.cc | 6 +++--- simulators/bochs/iodev/virt_timer.cc | 2 +- simulators/bochs/memory/memory.cc | 2 +- src/core/cpn/CMakeLists.txt | 2 -- 12 files changed, 35 insertions(+), 29 deletions(-) diff --git a/cmake/bochs.cmake b/cmake/bochs.cmake index 7ecb6fe7..6b590a03 100644 --- a/cmake/bochs.cmake +++ b/cmake/bochs.cmake @@ -79,7 +79,7 @@ if(BUILD_BOCHS) set(bochs_configure_params --enable-a20-pin --enable-x86-64 --enable-cpu-level=6 --enable-ne2000 --enable-acpi --enable-pci --enable-usb --enable-trace-cache --enable-fast-function-calls --enable-host-specific-asms --enable-disasm --enable-readline --enable-clgd54xx --enable-fpu --enable-vmx=2 --enable-monitor-mwait --enable-cdrom --enable-sb16=linux --enable-gdb-stub --disable-docbook --with-nogui --with-x11 --with-wx --with-sdl CACHE STRING "Bochs configure parameters") ## Bochs CXX args for calling make - set(bochs_build_CXX CXX=${AGXX}\ -p\ ${PROJECT_SOURCE_DIR}/src\ -p\ ${PROJECT_SOURCE_DIR}/simulators\ -p\ ${PROJECT_SOURCE_DIR}/debuggers\ -p\ ${PROJECT_SOURCE_DIR}/tools\ -p\ ${PROJECT_BINARY_DIR}/src\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler\ -std=gnu++98) + set(bochs_build_CXX CXX=${AGXX}\ -p\ ${PROJECT_SOURCE_DIR}/src\ -p\ ${PROJECT_SOURCE_DIR}/simulators\ -p\ ${PROJECT_SOURCE_DIR}/debuggers\ -p\ ${PROJECT_SOURCE_DIR}/tools\ -p\ ${PROJECT_BINARY_DIR}/src\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler\ -std=gnu++14\ -Wno-narrowing) ## Bochs libtool command. set(bochs_build_LIBTOOL LIBTOOL=/bin/sh\ ./libtool\ --tag=CXX) diff --git a/cmake/compilerconfig.cmake b/cmake/compilerconfig.cmake index 065b565c..ec1527ae 100644 --- a/cmake/compilerconfig.cmake +++ b/cmake/compilerconfig.cmake @@ -1,3 +1,10 @@ +#### C++14 #### +# We need at least C++11, as some library headers begin to require it. C++14 +# has already aged sufficiently to mandate it here. +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + ##### Verbose make #### option( VERBOSE_MAKE "Verbose Makefile output" OFF) # defaults to OFF set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_MAKE}) diff --git a/simulators/bochs/bx_debug/dbg_main.cc b/simulators/bochs/bx_debug/dbg_main.cc index 0104c33b..06839b15 100644 --- a/simulators/bochs/bx_debug/dbg_main.cc +++ b/simulators/bochs/bx_debug/dbg_main.cc @@ -908,11 +908,11 @@ void bx_dbg_info_segment_regs_command(void) (unsigned) sreg.des_l, (unsigned) sreg.valid); BX_CPU(dbg_cpu)->dbg_get_gdtr(&global_sreg); - dbg_printf("gdtr:base=0x"FMT_ADDRX", limit=0x%x\n", + dbg_printf("gdtr:base=0x" FMT_ADDRX ", limit=0x%x\n", global_sreg.base, (unsigned) global_sreg.limit); BX_CPU(dbg_cpu)->dbg_get_idtr(&global_sreg); - dbg_printf("idtr:base=0x"FMT_ADDRX", limit=0x%x\n", + dbg_printf("idtr:base=0x" FMT_ADDRX ", limit=0x%x\n", global_sreg.base, (unsigned) global_sreg.limit); } @@ -1610,18 +1610,18 @@ void bx_dbg_print_watchpoints(void) // print watch point info for (i = 0; i < num_read_watchpoints; i++) { if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), read_watchpoint[i].addr, 2, buf)) - dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(%04x)\n", + dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(%04x)\n", read_watchpoint[i].addr, read_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8)); else - dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(read error)\n", + dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(read error)\n", read_watchpoint[i].addr, read_watchpoint[i].len); } for (i = 0; i < num_write_watchpoints; i++) { if (BX_MEM(0)->dbg_fetch_mem(BX_CPU(dbg_cpu), write_watchpoint[i].addr, 2, buf)) - dbg_printf("wr 0x"FMT_PHY_ADDRX" len=%d\t\t(%04x)\n", + dbg_printf("wr 0x" FMT_PHY_ADDRX " len=%d\t\t(%04x)\n", write_watchpoint[i].addr, write_watchpoint[i].len, (int)buf[0] | ((int)buf[1] << 8)); else - dbg_printf("rd 0x"FMT_PHY_ADDRX" len=%d\t\t(read error)\n", + dbg_printf("rd 0x" FMT_PHY_ADDRX " len=%d\t\t(read error)\n", write_watchpoint[i].addr, write_watchpoint[i].len); } } @@ -1861,7 +1861,7 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time) dbg_printf("(%u) ", which_cpu); if (BX_CPU(which_cpu)->protected_mode()) { - dbg_printf("[0x"FMT_PHY_ADDRX"] %04x:" FMT_ADDRX " (%s): ", + dbg_printf("[0x" FMT_PHY_ADDRX "] %04x:" FMT_ADDRX " (%s): ", phy, BX_CPU(which_cpu)->guard_found.cs, BX_CPU(which_cpu)->guard_found.eip, bx_dbg_symbolic_address(BX_CPU(which_cpu)->cr3 >> 12, @@ -1869,7 +1869,7 @@ void bx_dbg_disassemble_current(int which_cpu, int print_time) BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS))); } else { // Real & V86 mode - dbg_printf("[0x"FMT_PHY_ADDRX"] %04x:%04x (%s): ", + dbg_printf("[0x" FMT_PHY_ADDRX "] %04x:%04x (%s): ", phy, BX_CPU(which_cpu)->guard_found.cs, (unsigned) BX_CPU(which_cpu)->guard_found.eip, bx_dbg_symbolic_address_16bit(BX_CPU(which_cpu)->guard_found.eip, @@ -2250,7 +2250,7 @@ void bx_dbg_info_bpoints_command(void) dbg_printf("pbreakpoint "); dbg_printf("keep "); dbg_printf(bx_guard.iaddr.phy[i].enabled?"y ":"n "); - dbg_printf("0x"FMT_PHY_ADDRX"\n", bx_guard.iaddr.phy[i].addr); + dbg_printf("0x" FMT_PHY_ADDRX "\n", bx_guard.iaddr.phy[i].addr); } #endif } @@ -2973,7 +2973,7 @@ void bx_dbg_print_descriptor64(Bit32u lo1, Bit32u hi1, Bit32u lo2, Bit32u hi2) break; default: // task, int, trap, or call gate. - dbg_printf("target=0x%04x:"FMT_ADDRX", DPL=%d", segment, offset, dpl); + dbg_printf("target=0x%04x:" FMT_ADDRX ", DPL=%d", segment, offset, dpl); break; } } @@ -3464,7 +3464,7 @@ void bx_dbg_dump_table(void) return; } - printf("cr3: 0x"FMT_PHY_ADDRX"\n", BX_CPU(dbg_cpu)->cr3); + printf("cr3: 0x" FMT_PHY_ADDRX "\n", BX_CPU(dbg_cpu)->cr3); lin = 0; phy = 0; @@ -3476,14 +3476,14 @@ void bx_dbg_dump_table(void) if(valid) { if((lin - start_lin) != (phy - start_phy)) { if(start_lin != 1) - dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n", + dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n", start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin)); start_lin = lin; start_phy = phy; } } else { if(start_lin != 1) - dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n", + dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n", start_lin, lin - 1, start_phy, start_phy + (lin-1-start_lin)); start_lin = 1; start_phy = 2; @@ -3493,7 +3493,7 @@ void bx_dbg_dump_table(void) lin += 0x1000; } if(start_lin != 1) - dbg_printf("0x%08x-0x%08x -> 0x"FMT_PHY_ADDRX"-0x"FMT_PHY_ADDRX"\n", + dbg_printf("0x%08x-0x%08x -> 0x" FMT_PHY_ADDRX "-0x" FMT_PHY_ADDRX "\n", start_lin, 0xffffffff, start_phy, start_phy + (0xffffffff-start_lin)); } diff --git a/simulators/bochs/cpu/paging.cc b/simulators/bochs/cpu/paging.cc index e5834507..45790888 100644 --- a/simulators/bochs/cpu/paging.cc +++ b/simulators/bochs/cpu/paging.cc @@ -424,7 +424,7 @@ void BX_CPU_C::TLB_invlpg(bx_address laddr) { invalidate_prefetch_q(); - BX_DEBUG(("TLB_invlpg(0x"FMT_ADDRX"): invalidate TLB entry", laddr)); + BX_DEBUG(("TLB_invlpg(0x" FMT_ADDRX "): invalidate TLB entry", laddr)); #if BX_CPU_LEVEL >= 5 bx_bool large = 0; diff --git a/simulators/bochs/gui/paramtree.cc b/simulators/bochs/gui/paramtree.cc index 2e90e7ca..6e871d14 100755 --- a/simulators/bochs/gui/paramtree.cc +++ b/simulators/bochs/gui/paramtree.cc @@ -292,7 +292,7 @@ bx_shadow_num_c::bx_shadow_num_c(bx_param_c *parent, val.p64bit = ptr_to_real_val; if (base == BASE_HEX) { this->base = base; - this->text_format = "0x"FMT_LL"x"; + this->text_format = "0x" FMT_LL "x"; } } @@ -311,7 +311,7 @@ bx_shadow_num_c::bx_shadow_num_c(bx_param_c *parent, val.p64bit = (Bit64s*) ptr_to_real_val; if (base == BASE_HEX) { this->base = base; - this->text_format = "0x"FMT_LL"x"; + this->text_format = "0x" FMT_LL "x"; } } diff --git a/simulators/bochs/gui/siminterface.cc b/simulators/bochs/gui/siminterface.cc index 965ba0a6..3cb7dbd5 100644 --- a/simulators/bochs/gui/siminterface.cc +++ b/simulators/bochs/gui/siminterface.cc @@ -1200,7 +1200,7 @@ bx_bool bx_real_sim_c::save_sr_param(FILE *fp, bx_param_c *node, const char *sr_ fprintf(fp, node->get_format(), value); } else { if ((Bit64u)((bx_param_num_c*)node)->get_max() > BX_MAX_BIT32U) { - fprintf(fp, "0x"FMT_LL"x", (Bit64u) value); + fprintf(fp, "0x" FMT_LL "x", (Bit64u) value); } else { fprintf(fp, "0x%x", (Bit32u) value); } diff --git a/simulators/bochs/iodev/pit_wrap.cc b/simulators/bochs/iodev/pit_wrap.cc index aece228a..c96eaad4 100644 --- a/simulators/bochs/iodev/pit_wrap.cc +++ b/simulators/bochs/iodev/pit_wrap.cc @@ -136,7 +136,7 @@ void bx_pit_c::init(void) BX_DEBUG(("finished init")); - BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec)); + BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec)); BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0])); BX_DEBUG(("s.timer.get_next_event_time=%d",BX_PIT_THIS s.timer.get_next_event_time())); BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time)); @@ -191,7 +191,7 @@ void bx_pit_c::handle_timer() } BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time(); } - BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec)); + BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec)); BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0])); BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time())); BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time)); @@ -325,7 +325,7 @@ void bx_pit_c::write(Bit32u address, Bit32u dvalue, unsigned io_len) } BX_PIT_THIS s.last_next_event_time = BX_PIT_THIS s.timer.get_next_event_time(); } - BX_DEBUG(("s.last_usec="FMT_LL"d",BX_PIT_THIS s.last_usec)); + BX_DEBUG(("s.last_usec=" FMT_LL "d",BX_PIT_THIS s.last_usec)); BX_DEBUG(("s.timer_id=%d",BX_PIT_THIS s.timer_handle[0])); BX_DEBUG(("s.timer.get_next_event_time=%x",BX_PIT_THIS s.timer.get_next_event_time())); BX_DEBUG(("s.last_next_event_time=%d",BX_PIT_THIS s.last_next_event_time)); diff --git a/simulators/bochs/iodev/sb16.cc b/simulators/bochs/iodev/sb16.cc index 0583fecc..072d6fba 100644 --- a/simulators/bochs/iodev/sb16.cc +++ b/simulators/bochs/iodev/sb16.cc @@ -1,3 +1,4 @@ +#pragma clang diagnostic ignored "-Wc++11-narrowing" ///////////////////////////////////////////////////////////////////////// // $Id$ ///////////////////////////////////////////////////////////////////////// diff --git a/simulators/bochs/iodev/scsi_device.cc b/simulators/bochs/iodev/scsi_device.cc index a175f78f..04983296 100644 --- a/simulators/bochs/iodev/scsi_device.cc +++ b/simulators/bochs/iodev/scsi_device.cc @@ -663,7 +663,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun) case 0x08: case 0x28: case 0x88: - BX_DEBUG(("Read (sector "FMT_LL"d, count %d)", lba, len)); + BX_DEBUG(("Read (sector " FMT_LL "d, count %d)", lba, len)); if (lba > max_lba) goto illegal_lba; r->sector = lba; @@ -672,7 +672,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun) case 0x0a: case 0x2a: case 0x8a: - BX_DEBUG(("Write (sector "FMT_LL"d, count %d)", lba, len)); + BX_DEBUG(("Write (sector " FMT_LL "d, count %d)", lba, len)); if (lba > max_lba) goto illegal_lba; r->sector = lba; @@ -680,7 +680,7 @@ Bit32s scsi_device_t::scsi_send_command(Bit32u tag, Bit8u *buf, int lun) is_write = 1; break; case 0x35: - BX_DEBUG(("Syncronise cache (sector "FMT_LL"d, count %d)", lba, len)); + BX_DEBUG(("Syncronise cache (sector " FMT_LL "d, count %d)", lba, len)); // TODO: flush cache break; case 0x43: diff --git a/simulators/bochs/iodev/virt_timer.cc b/simulators/bochs/iodev/virt_timer.cc index d46c2426..cd785709 100644 --- a/simulators/bochs/iodev/virt_timer.cc +++ b/simulators/bochs/iodev/virt_timer.cc @@ -529,7 +529,7 @@ void bx_virt_timer_c::timer_handler(void) printf("useconds: " FMT_LL "u, ", temp1); printf("expect ticks: " FMT_LL "u, ", temp2); printf("ticks: " FMT_LL "u, ", temp3); - printf("diff: "FMT_LL "u\n", temp4); + printf("diff: " FMT_LL "u\n", temp4); } # endif diff --git a/simulators/bochs/memory/memory.cc b/simulators/bochs/memory/memory.cc index 5cc8377e..f38e23eb 100644 --- a/simulators/bochs/memory/memory.cc +++ b/simulators/bochs/memory/memory.cc @@ -185,7 +185,7 @@ inc_one: } else { // access outside limits of physical memory, ignore - BX_DEBUG(("Write outside the limits of physical memory (0x"FMT_PHY_ADDRX") (ignore)", a20addr)); + BX_DEBUG(("Write outside the limits of physical memory (0x" FMT_PHY_ADDRX ") (ignore)", a20addr)); } } diff --git a/src/core/cpn/CMakeLists.txt b/src/core/cpn/CMakeLists.txt index 137e9573..0c931b23 100644 --- a/src/core/cpn/CMakeLists.txt +++ b/src/core/cpn/CMakeLists.txt @@ -4,8 +4,6 @@ set(SRCS DatabaseCampaign.cc ) -set_source_files_properties(JobServer.cc CampaignManager.cc PROPERTIES COMPILE_FLAGS -std=c++14) - find_package(MySQL REQUIRED) include_directories(${MYSQL_INCLUDE_DIR})