diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-20 18:03:56 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-20 18:03:56 -0400 |
commit | d6f1c6ce89c16eda7d86c319cc92f551ee352496 (patch) | |
tree | d52a9e347638ce933bc7cede46f941de746b9933 /src/sim/system.cc | |
parent | 6290f981940394a4768b566a6d55aa5e5ca5e839 (diff) | |
download | gem5-d6f1c6ce89c16eda7d86c319cc92f551ee352496.tar.xz |
x86: Fixes to avoid LTO warnings
This patch fixes a few minor issues that caused link-time warnings
when using LTO, mainly for x86. The most important change is how the
syscall array is created. Previously gcc and clang would complain that
the declaration and definition types did not match. The organisation
is now changed to match how it is done for ARM, moving the code that
was previously in syscalls.cc into process.cc, and having a class
variable pointing to the static array.
With these changes, there are no longer any warnings using gcc 4.6.3
with LTO.
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r-- | src/sim/system.cc | 9 |
1 files changed, 8 insertions, 1 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; |