diff options
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/system.cc | 9 | ||||
-rw-r--r-- | src/sim/system.hh | 10 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc index 61c6decf7..1f63dbf33 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -54,7 +54,6 @@ #include "cpu/thread_context.hh" #include "debug/Loader.hh" #include "debug/WorkItems.hh" -#include "kern/kernel_stats.hh" #include "mem/abstract_mem.hh" #include "mem/physical.hh" #include "params/System.hh" @@ -63,6 +62,14 @@ #include "sim/full_system.hh" #include "sim/system.hh" +/** + * To avoid linking errors with LTO, only include the header if we + * actually have a definition. + */ +#if THE_ISA != NULL_ISA +#include "kern/kernel_stats.hh" +#endif + using namespace std; using namespace TheISA; diff --git a/src/sim/system.hh b/src/sim/system.hh index 595892385..1db28f212 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -56,15 +56,21 @@ #include "base/misc.hh" #include "base/statistics.hh" #include "config/the_isa.hh" -#include "cpu/pc_event.hh" #include "enums/MemoryMode.hh" -#include "kern/system_events.hh" #include "mem/mem_object.hh" #include "mem/port.hh" #include "mem/port_proxy.hh" #include "mem/physical.hh" #include "params/System.hh" +/** + * To avoid linking errors with LTO, only include the header if we + * actually have the definition. + */ +#if THE_ISA != NULL_ISA +#include "cpu/pc_event.hh" +#endif + class BaseCPU; class BaseRemoteGDB; class GDBListener; |