On linux on ppc64le some of the enums in AuxVector have the same name
as macros defined in the system.
Details
Diff Detail
- Build Status
Buildable 8045 Build 8045: arc lint + arc unit
Event Timeline
Adding Code Owner (Pavel Labeth) and responsible for the relevant changes (Michael Sartain).
If you want to go this way, rename them consistently and use a different prefix (e.g. AUXV_*) please.
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp | ||
---|---|---|
11 | Do you still get the error if you remove these includes? As far as I can tell they are unused, and this part of the code should not depend on system headers anyway. If that doesn't help, then we should use a different prefix as joerg suggests. | |
113–115 | If we go about renaming them, then we should change this, as we still want to display the standard name of the entries. |
[2397/3183] Building CXX object tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeFiles/lldbPluginDynamicLoaderPosixDYLD.dir/AuxVector.cpp.o FAILED: tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeFiles/lldbPluginDynamicLoaderPosixDYLD.dir/AuxVector.cpp.o /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED -DLLDB_USE_BUILTIN_DEMANGLER -DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIM IT_MACROS -Itools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD -I/home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD -Itools/lldb/include -I/home/brosa/llvm/tools/lldb/include -Iinclude -I/home/brosa/llvm/include -I/usr/include/python2.7 -I/home/brosa/llvm/tools/clang/include -Itools/lldb/../clang/include -I/usr/include/libxml2 -I/home/brosa/llvm/tools/lldb/source/. -fPIC -fvisibility- inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virt ual-dtor -Wno-comment -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -g -fno-exceptions -fno-rtti -MD -MT tools/lldb/source/Plugins /DynamicLoader/POSIX-DYLD/CMakeFiles/lldbPluginDynamicLoaderPosixDYLD.dir/AuxVector.cpp.o -MF tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeFiles/lldbPluginDynamicLoaderPosixDYLD.dir/AuxVector .cpp.o.d -o tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeFiles/lldbPluginDynamicLoaderPosixDYLD.dir/AuxVector.cpp.o -c /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxV ector.cpp In file included from /usr/include/powerpc64le-linux-gnu/asm/elf.h:17:0, from /usr/include/powerpc64le-linux-gnu/asm/sigcontext.h:13, from /usr/include/powerpc64le-linux-gnu/bits/sigcontext.h:27, from /usr/include/signal.h:306, from /home/brosa/llvm/tools/lldb/include/lldb/lldb-types.h:17, from /home/brosa/llvm/tools/lldb/include/lldb/lldb-private-interfaces.h:17, from /home/brosa/llvm/tools/lldb/include/lldb/lldb-private.h:17, from /home/brosa/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h:21, from /home/brosa/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSite.h:22, from /home/brosa/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointSiteList.h:21, from /home/brosa/llvm/tools/lldb/include/lldb/Target/Process.h:29, from /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp:17: /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:65:5: error: expected identifier before numeric constant AT_DCACHEBSIZE = 19, ///< Data cache block size. ^ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:65:5: error: expected ‘}’ before numeric constant /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:65:5: error: expected unqualified-id before numeric constant In file included from /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp:26:0: /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:82:1: error: expected unqualified-id before ‘private’ private: ^~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:85:1: error: expected unqualified-id before ‘public’ public: ^~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:88:3: error: ‘iterator’ does not name a type iterator begin() const { return m_auxv.begin(); } ^~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:89:3: error: ‘iterator’ does not name a type iterator end() const { return m_auxv.end(); } ^~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:91:3: error: ‘iterator’ does not name a type iterator FindEntry(EntryType type) const; ^~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:93:41: error: ‘Entry’ does not name a type static const char *GetEntryName(const Entry &entry) { ^~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h: In function ‘const char* GetEntryName(const int&)’: /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:94:37: error: ‘EntryType’ does not name a type return GetEntryName(static_cast<EntryType>(entry.type)); ^~~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:94:54: error: request for member ‘type’ in ‘entry’, which is of non-class type ‘const int’ return GetEntryName(static_cast<EntryType>(entry.type)); ^~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h: At global scope: /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:97:35: error: ‘const char* GetEntryName’ redeclared as different kind of symbol static const char *GetEntryName(EntryType type); ^~~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:93:22: note: previous declaration ‘const char* GetEntryName(const int&)’ static const char *GetEntryName(const Entry &entry) { ^~~~~~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:97:35: error: ‘EntryType’ was not declared in this scope static const char *GetEntryName(EntryType type); ^~~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:99:42: error: non-member function ‘void DumpToLog(lldb_private::Log*)’ cannot have cv-qualifier void DumpToLog(lldb_private::Log *log) const; ^~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:101:1: error: expected unqualified-id before ‘private’ private: ^~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:103:3: error: ‘EntryVector’ does not name a type EntryVector m_auxv; ^~~~~~~~~~~ /home/brosa/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h:108:1: error: expected declaration before ‘}’ token }; ^
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp | ||
---|---|---|
11 | I just tried it and it doesn't help, unfortunately. |
Renaming enum consistently and updating name ENTRY_NAME macro to
correctly assign the standard names of aux vector entries.
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h | ||
---|---|---|
46 | Should I change this comment to /// Added AUXV prefix to avoid potential conflicts with system-defined MACROS ? |
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp | ||
---|---|---|
113–115 | Hmm that looks too "hacky", doesn't it? |
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp | ||
---|---|---|
113–115 | name + 4 looks prettier to me. |
source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp | ||
---|---|---|
113–115 | I think name+4 (well, 5) is fine, but if you want to keep it this way, then I'd suggest you hardcode the AUXV_ prefix into the macro (#define ENTRY_NAME(type) AUXV_##type: name = #type. This is just adds redundant magic. |
@labath @joerg @krytarowski thanks for the review. Can anyone commit this, please? I still don't have commit privileges.
I think most targets do, but they don't pull the relevant system headers in via namespace pollution.