LLDB fails to build under GNU/Linux powerpc: if g++-4.9 -I/«PKGBUILDDIR»/build-llvm/include -I/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi -I/«PKGBUILDDIR»/include -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/../../include -I/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/../../include -I/«PKGBUILDDIR»/tools/clang/include -I/«PKGBUILDDIR»/build-llvm/tools/clang/include -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/../../source -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/../../source/Utility -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/../../source/Plugins/Process/Utility -I/«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/../../source/Plugins/Process/POSIX -I/usr/include/python2.7 -I/usr/include/powerpc-linux-gnu/python2.7 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -ffunction-sections -fdata-sections -Wcast-qual -fno-strict-aliasing -std=c++0x -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-unknown-pragmas -Wno-sign-compare -Wno-sign-compare -Wno-unused-function -Wno-maybe-uninitialized -Wno-missing-field-initializers -c -MMD -MP -MF "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.d.tmp" -MT "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.o" -MT "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.d" /«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp -o /«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.o ; \ then /bin/mv -f "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.d.tmp" "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.d"; else /bin/rm "/«PKGBUILDDIR»/build-llvm/tools/lldb/tools/lldb-mi/Release/MICmnLogMediumFile.d.tmp"; exit 1; fi /«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp: In member function 'bool CMICmnLogMediumFile::FileFormFileNamePath()': /«PKGBUILDDIR»/tools/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp:225:20: error: 'CMIUtilSystem' was not declared in this scope if( CMIUtilSystem().GetLogFilesPath( strPathName ) ) ^ Full log: https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-snapshot&arch=powerpc&ver=1%3A3.5~svn213451-1&stamp=1405816471
Something very odd is going on. In: tools/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp If I add two static asserts just before the relevant SystemLinux inclusion I get: static_assert(__linux__ == 1, "__linux__ == 1 failed"); static_assert(__linux == 1, "__linux == 1 failed"); #if defined( _MSC_VER ) #include "MIUtilSystemWindows.h" #elif defined( __FreeBSD__ ) || defined( __linux__ ) #include "MIUtilSystemLinux.h" #elif defined( __APPLE__ ) #include "MIUtilSystemOsx.h" #endif // defined( _MSC_VER ) I get: /home/xnox/llvm-toolchain-3.5-3.5~+rc1/tools/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp:31:15: error: '__linux' was not declared in this scope static_assert(__linux == 1, "__linux == 1 failed"); So __linux__ is defined, and __linux is not. I typically saw everyone use __linux__, but looks like it should be defined on powerpc if it's defined on all other arches.
Looks like there is something wrong with the powerpc g++-4.9 compiler: $ g++-4.9 -dM -E - < /dev/null | grep linux #define __linux 1 #define __linux__ 1 #define __gnu_linux__ 1 #define linux 1 $ g++-4.9 -std=c++0x -dM -E - < /dev/null | grep linux #define __linux__ 1 #define __gnu_linux__ 1
As per, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28314 __linux__ should be used, instead of __linux. I'll provide a patch.
Created attachment 12837 [details] Use __linux__ instead of __linux
Looks great. Many thanks. Do you need someone to commit that for you?
(In reply to comment #5) > Looks great. Many thanks. > Do you need someone to commit that for you? My test build is still running here. And yes, I will need someone to sponsor/commit this patch. I don't have any commit rights in llvm.
Your tests are OK ?
(In reply to comment #7) > Your tests are OK ? Yeap, all is good. After I test mesa, in Ubuntu we will probably switch to 3.5 by default now. https://launchpad.net/ubuntu/+source/llvm-toolchain-3.5/1:3.5~+rc1-1ubuntu2/+build/6222106
(In reply to comment #8) > (In reply to comment #7) > > Your tests are OK ? > > Yeap, all is good. Thanks, Commit as r214291. > After I test mesa, in Ubuntu we will probably switch to > 3.5 by default now. That sounds premature and too early for me. You should wait at least for the final version.
Is this for 3.5?
Yes
(In reply to comment #11) > Yes Done. Thanks!