[PATCH] D124857: [AIX][PGO] Enable linux style PGO on AIX
wael yehia via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 11:32:22 PDT 2022
w2yehia added inline comments.
================
Comment at: compiler-rt/lib/profile/InstrProfilingPlatformLinux.c:253
+// variables in each of the above 3 sections.
+COMPILER_RT_VISIBILITY int dummy_cnts[0] COMPILER_RT_SECTION(
+ COMPILER_RT_SEG INSTR_PROF_CNTS_SECT_NAME);
----------------
MaskRay wrote:
> w2yehia wrote:
> > MaskRay wrote:
> > > This has a -Wzero-length-array warning in -pedantic mode.
> > sorry but what's the correct way to resolve this on all platforms?
> > I see -Wno-pedantic is used when building this file `if(FUCHSIA OR UNIX)`. Should I add `-Wno-pedantic` if such flag is supported by the build compiler in general?
> Many people don't build AIX so this isn't a problem for them (most build bots).
>
> If you want suppress the warning for the AIX specific code, you may use
> ```
> #pragma GCC diagnostic ignored "-Wpedantic"
> ```
> This works with both GCC and Clang. I do not know how IBM XL/C behaves.
Right, I forgot this is guarded by the _AIX macro.
Since we already build with -Wno-pedantic on AIX, I don't need to suppress anything, right?
Here's the code in cmake that adds it. AIX is UNIX.
```
compiler-rt/lib/profile/CMakeLists.txt:
89 if(FUCHSIA OR UNIX)
90 set(EXTRA_FLAGS
91 -fPIC
92 -Wno-pedantic)
93 endif()
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124857/new/
https://reviews.llvm.org/D124857
More information about the llvm-commits
mailing list