ARM-software / gator

Sources for Arm Streamline's gator daemon, part of Arm Mobile Studio suite of performance analysis tools
https://www.arm.com/products/development-tools/graphics/arm-mobile-studio
133 stars 67 forks source link

Compilation failure with gcc-11 #28

Closed bjacklyn closed 1 year ago

bjacklyn commented 3 years ago
In file included from linux/perf/PerfBuffer.cpp:9:
./linux/perf/PerfBuffer.h:27:9: error: 'size_t' does not name a type
   27 |         size_t pageSize;
      |         ^~~~~~
./linux/perf/PerfBuffer.h:18:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
   17 | #include "Config.h"
  +++ |+#include <cstddef>
bengaineyarm commented 3 years ago

Hi @bjacklyn - thanks for this.

What tag / version are you attempting to build/use. I am not able to repro this for 7.5, 7.6, 7.7 or our current internal development build.

If you are using an older version, is their any reason you need the combination of old Streamline version + brand new GCC version?

bjacklyn commented 3 years ago

Ah I should have said the version -- it's 7.1 -- the reason for that is it's another team which decides which version of dependencies they want to use, whereas I'm just upgrading the compiler to the latest.

In the latest versions this must be transitively available from somewhere else, but I do think it's worthwhile to IWYU and it's also a trivial fix -- I've manged to workaround it by creating this patchfile in our build system:

diff --git a/daemon/linux/perf/PerfBuffer.h b/daemon/linux/perf/PerfBuffer.h
index 083ca4d..fdd0aae 100644
--- a/daemon/linux/perf/PerfBuffer.h
+++ b/daemon/linux/perf/PerfBuffer.h
@@ -9,6 +9,7 @@
 #ifndef PERF_BUFFER
 #define PERF_BUFFER

+#include <cstddef>
 #include <map>
 #include <set>
 #include <vector>
bengaineyarm commented 3 years ago

Ah I should have said the version -- it's 7.1 -- the reason for that is it's another team which decides which version of dependencies they want to use, whereas I'm just upgrading the compiler to the latest.

Ok, thanks.

In the latest versions this must be transitively available from somewhere else, but I do think it's worthwhile to IWYU and it's also a trivial fix

Yes agreed, thank for pointing it out.

I've manged to workaround it by creating this patchfile in our build system:

Great

clementperon commented 1 year ago

https://github.com/ARM-software/gator/pull/40

bengaineyarm commented 1 year ago

Resolved by #40