On Sat, Oct 13, 2012 at 1:09 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank" class="cremed">dblaikie@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Fri, Oct 12, 2012 at 6:14 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>> wrote:<br>

> I'm seeing this too. CC'ing the author ubsan stuff.<br>
><br>
> Richard, I know you were OK with only supporting Clang-bootstraps, but I<br>
> don't think that's terribly viable here.<br>
<br>
</div>Just out of curiosity - why isn't that viable? I'd sort of hope to<br>
treat optional sanitizer runtimes like, say, lld or other projects<br>
that aren't necessary to bootstrap: viable candidates for C++11 & more<br>
or less anything we want to use.<br></blockquote><div><br></div><div>Mostly, because I want to keep building and installing Clang simple. When I wrote this, if someone checked out the Clang codebase following the instructions on the website, and built it using CMake, it would fail to build. The default compiler on most systems is GCC still, and so it seems unreasonable to abandon support for it...</div>
<div><br></div><div>FWIW, I'll immediately become OK with requiring a bootstrap when the build system does it for us, so that users can check out the code, build and install it in "one go". I'm mostly concerned with keeping the development process simple, not with the particulars of one host compiler vs. the other.</div>
<div><br></div><div><br></div><div>As a final note, it turned out to be very easy to fix this. I should have updated this thread. I think everything will work as of r165863.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
- David<br>
<div><div class="h5"><br>
> We should be able to build ubsan's<br>
> runtime with standards conforming code unless there is some fairly extreme<br>
> reason not to...<br>
><br>
><br>
> On Fri, Oct 12, 2012 at 7:19 AM, Mahesha HS <<a href="mailto:mahesha.llvm@gmail.com" class="cremed">mahesha.llvm@gmail.com</a>> wrote:<br>
>><br>
>> I use latest cmake+ninja which are built from latest sources.<br>
>><br>
>> =================================<br>
>> > cmake --version<br>
>><br>
>> cmake version 2.8.9.20121011-g2876<br>
>> =================================<br>
>><br>
>> --<br>
>> mahesha<br>
>><br>
>> On Fri, Oct 12, 2012 at 7:35 PM, Mahesha HS <<a href="mailto:mahesha.llvm@gmail.com" class="cremed">mahesha.llvm@gmail.com</a>><br>
>> wrote:<br>
>> > Hi All,<br>
>> ><br>
>> > I am first time trying build CLANG+LLVM using cmake+ninja build<br>
>> > system. I updated all my CLANG+LLVM sources to current trunk, and I<br>
>> > successfully built it using classic *make* build system. But, trying<br>
>> > to build the same with cmake+ninja build system resulting in following<br>
>> > build failures for compiler-rt sources.<br>
>> ><br>
>> > Am I missing something basics here?<br>
>> ><br>
>> > ====================<br>
>> > cmake command used:<br>
>> > ====================<br>
>> ><br>
>> > cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja<br>
>> > -DCMAKE_EXPORT_COMPILE_COMMANDS=ON<br>
>> > -DCMAKE_INSTALL_PREFIX=/path/to/install/dir  /path/to/llvm/src  ><br>
>> > ~/cmake.res.txt<br>
>> ><br>
>> ><br>
>> > ======================<br>
>> > Output from above command:<br>
>> > ======================<br>
>> ><br>
>> >>cat cmake.res.txt<br>
>> ><br>
>> > -- The C compiler identification is GNU 4.6.0<br>
>> > -- Check for working C compiler using: Ninja<br>
>> > -- Check for working C compiler using: Ninja -- works<br>
>> > -- Detecting C compiler ABI info<br>
>> > -- Detecting C compiler ABI info - done<br>
>> > -- The CXX compiler identification is GNU 4.6.0<br>
>> > -- Check for working CXX compiler using: Ninja<br>
>> > -- Check for working CXX compiler using: Ninja -- works<br>
>> > -- Detecting CXX compiler ABI info<br>
>> > -- Detecting CXX compiler ABI info - done<br>
>> > -- Looking for argz.h<br>
>> > -- Looking for argz.h - found<br>
>> > -- Looking for assert.h<br>
>> > -- Looking for assert.h - found<br>
>> > -- Looking for ctype.h<br>
>> > -- Looking for ctype.h - found<br>
>> > -- Looking for dirent.h<br>
>> > -- Looking for dirent.h - found<br>
>> > -- Looking for dl.h<br>
>> > -- Looking for dl.h - not found<br>
>> > -- Looking for dld.h<br>
>> > -- Looking for dld.h - not found<br>
>> > -- Looking for dlfcn.h<br>
>> > -- Looking for dlfcn.h - found<br>
>> > -- Looking for errno.h<br>
>> > -- Looking for errno.h - found<br>
>> > -- Looking for execinfo.h<br>
>> > -- Looking for execinfo.h - found<br>
>> > -- Looking for fcntl.h<br>
>> > -- Looking for fcntl.h - found<br>
>> > -- Looking for inttypes.h<br>
>> > -- Looking for inttypes.h - found<br>
>> > -- Looking for limits.h<br>
>> > -- Looking for limits.h - found<br>
>> > -- Looking for link.h<br>
>> > -- Looking for link.h - found<br>
>> > -- Looking for malloc.h<br>
>> > -- Looking for malloc.h - found<br>
>> > -- Looking for malloc/malloc.h<br>
>> > -- Looking for malloc/malloc.h - not found<br>
>> > -- Looking for memory.h<br>
>> > -- Looking for memory.h - found<br>
>> > -- Looking for ndir.h<br>
>> > -- Looking for ndir.h - not found<br>
>> > -- Looking for pthread.h<br>
>> > -- Looking for pthread.h - found<br>
>> > -- Looking for setjmp.h<br>
>> > -- Looking for setjmp.h - found<br>
>> > -- Looking for signal.h<br>
>> > -- Looking for signal.h - found<br>
>> > -- Looking for stdint.h<br>
>> > -- Looking for stdint.h - found<br>
>> > -- Looking for stdio.h<br>
>> > -- Looking for stdio.h - found<br>
>> > -- Looking for stdlib.h<br>
>> > -- Looking for stdlib.h - found<br>
>> > -- Looking for string.h<br>
>> > -- Looking for string.h - found<br>
>> > -- Looking for strings.h<br>
>> > -- Looking for strings.h - found<br>
>> > -- Looking for sys/dir.h<br>
>> > -- Looking for sys/dir.h - found<br>
>> > -- Looking for sys/dl.h<br>
>> > -- Looking for sys/dl.h - not found<br>
>> > -- Looking for sys/ioctl.h<br>
>> > -- Looking for sys/ioctl.h - found<br>
>> > -- Looking for sys/mman.h<br>
>> > -- Looking for sys/mman.h - found<br>
>> > -- Looking for sys/ndir.h<br>
>> > -- Looking for sys/ndir.h - not found<br>
>> > -- Looking for sys/param.h<br>
>> > -- Looking for sys/param.h - found<br>
>> > -- Looking for sys/resource.h<br>
>> > -- Looking for sys/resource.h - found<br>
>> > -- Looking for sys/stat.h<br>
>> > -- Looking for sys/stat.h - found<br>
>> > -- Looking for sys/time.h<br>
>> > -- Looking for sys/time.h - found<br>
>> > -- Looking for sys/types.h<br>
>> > -- Looking for sys/types.h - found<br>
>> > -- Looking for sys/uio.h<br>
>> > -- Looking for sys/uio.h - found<br>
>> > -- Looking for sys/wait.h<br>
>> > -- Looking for sys/wait.h - found<br>
>> > -- Looking for termios.h<br>
>> > -- Looking for termios.h - found<br>
>> > -- Looking for unistd.h<br>
>> > -- Looking for unistd.h - found<br>
>> > -- Looking for utime.h<br>
>> > -- Looking for utime.h - found<br>
>> > -- Looking for valgrind/valgrind.h<br>
>> > -- Looking for valgrind/valgrind.h - not found<br>
>> > -- Looking for windows.h<br>
>> > -- Looking for windows.h - not found<br>
>> > -- Looking for fenv.h<br>
>> > -- Looking for fenv.h - found<br>
>> > -- Looking for mach/mach.h<br>
>> > -- Looking for mach/mach.h - not found<br>
>> > -- Looking for mach-o/dyld.h<br>
>> > -- Looking for mach-o/dyld.h - not found<br>
>> > -- Looking for pthread_create in pthread<br>
>> > -- Looking for pthread_create in pthread - found<br>
>> > -- Looking for pthread_getspecific in pthread<br>
>> > -- Looking for pthread_getspecific in pthread - found<br>
>> > -- Looking for pthread_rwlock_init in pthread<br>
>> > -- Looking for pthread_rwlock_init in pthread - found<br>
>> > -- Looking for pthread_mutex_lock in pthread<br>
>> > -- Looking for pthread_mutex_lock in pthread - found<br>
>> > -- Looking for dlopen in dl<br>
>> > -- Looking for dlopen in dl - found<br>
>> > -- Looking for arc4random<br>
>> > -- Looking for arc4random - not found<br>
>> > -- Looking for backtrace<br>
>> > -- Looking for backtrace - found<br>
>> > -- Looking for getpagesize<br>
>> > -- Looking for getpagesize - found<br>
>> > -- Looking for getrusage<br>
>> > -- Looking for getrusage - found<br>
>> > -- Looking for setrlimit<br>
>> > -- Looking for setrlimit - found<br>
>> > -- Looking for isatty<br>
>> > -- Looking for isatty - found<br>
>> > -- Looking for index<br>
>> > -- Looking for index - found<br>
>> > -- Looking for isinf<br>
>> > -- Looking for isinf - not found<br>
>> > -- Looking for isinf<br>
>> > -- Looking for isinf - found<br>
>> > -- Looking for finite<br>
>> > -- Looking for finite - not found<br>
>> > -- Looking for isnan<br>
>> > -- Looking for isnan - not found<br>
>> > -- Looking for ceilf<br>
>> > -- Looking for ceilf - found<br>
>> > -- Looking for floorf<br>
>> > -- Looking for floorf - found<br>
>> > -- Looking for fmodf<br>
>> > -- Looking for fmodf - found<br>
>> > -- Looking for longjmp<br>
>> > -- Looking for longjmp - found<br>
>> > -- Looking for setjmp<br>
>> > -- Looking for setjmp - found<br>
>> > -- Looking for siglongjmp<br>
>> > -- Looking for siglongjmp - found<br>
>> > -- Looking for sigsetjmp<br>
>> > -- Looking for sigsetjmp - found<br>
>> > -- Looking for writev<br>
>> > -- Looking for writev - found<br>
>> > -- Looking for nearbyintf<br>
>> > -- Looking for nearbyintf - found<br>
>> > -- Looking for mallinfo<br>
>> > -- Looking for mallinfo - found<br>
>> > -- Looking for malloc_zone_statistics<br>
>> > -- Looking for malloc_zone_statistics - not found<br>
>> > -- Looking for mkdtemp<br>
>> > -- Looking for mkdtemp - found<br>
>> > -- Looking for mkstemp<br>
>> > -- Looking for mkstemp - found<br>
>> > -- Looking for mktemp<br>
>> > -- Looking for mktemp - found<br>
>> > -- Looking for closedir<br>
>> > -- Looking for closedir - found<br>
>> > -- Looking for opendir<br>
>> > -- Looking for opendir - found<br>
>> > -- Looking for readdir<br>
>> > -- Looking for readdir - found<br>
>> > -- Looking for getcwd<br>
>> > -- Looking for getcwd - found<br>
>> > -- Looking for gettimeofday<br>
>> > -- Looking for gettimeofday - found<br>
>> > -- Looking for getrlimit<br>
>> > -- Looking for getrlimit - found<br>
>> > -- Looking for posix_spawn<br>
>> > -- Looking for posix_spawn - found<br>
>> > -- Looking for pread<br>
>> > -- Looking for pread - found<br>
>> > -- Looking for rindex<br>
>> > -- Looking for rindex - found<br>
>> > -- Looking for strchr<br>
>> > -- Looking for strchr - found<br>
>> > -- Looking for sbrk<br>
>> > -- Looking for sbrk - found<br>
>> > -- Looking for srand48<br>
>> > -- Looking for srand48 - found<br>
>> > -- Looking for lrand48<br>
>> > -- Looking for lrand48 - found<br>
>> > -- Looking for drand48<br>
>> > -- Looking for drand48 - found<br>
>> > -- Looking for strtoll<br>
>> > -- Looking for strtoll - found<br>
>> > -- Looking for strtoq<br>
>> > -- Looking for strtoq - found<br>
>> > -- Looking for strerror<br>
>> > -- Looking for strerror - found<br>
>> > -- Looking for strerror_r<br>
>> > -- Looking for strerror_r - found<br>
>> > -- Looking for strerror_s<br>
>> > -- Looking for strerror_s - not found<br>
>> > -- Looking for memcpy<br>
>> > -- Looking for memcpy - found<br>
>> > -- Looking for memmove<br>
>> > -- Looking for memmove - found<br>
>> > -- Looking for setenv<br>
>> > -- Looking for setenv - found<br>
>> > -- Looking for argz_append<br>
>> > -- Looking for argz_append - found<br>
>> > -- Looking for argz_create_sep<br>
>> > -- Looking for argz_create_sep - found<br>
>> > -- Looking for argz_insert<br>
>> > -- Looking for argz_insert - found<br>
>> > -- Looking for argz_next<br>
>> > -- Looking for argz_next - found<br>
>> > -- Looking for argz_stringify<br>
>> > -- Looking for argz_stringify - found<br>
>> > -- Looking for dlerror<br>
>> > -- Looking for dlerror - found<br>
>> > -- Looking for dlopen<br>
>> > -- Looking for dlopen - found<br>
>> > -- Looking for __GLIBC__<br>
>> > -- Looking for __GLIBC__ - found<br>
>> > -- Performing Test HAVE_INT64_T<br>
>> > -- Performing Test HAVE_INT64_T - Success<br>
>> > -- Performing Test HAVE_UINT64_T<br>
>> > -- Performing Test HAVE_UINT64_T - Success<br>
>> > -- Performing Test HAVE_U_INT64_T<br>
>> > -- Performing Test HAVE_U_INT64_T - Success<br>
>> > -- Performing Test HAVE_ERROR_T<br>
>> > -- Performing Test HAVE_ERROR_T - Success<br>
>> > -- Performing Test LLVM_HAS_ATOMICS<br>
>> > -- Performing Test LLVM_HAS_ATOMICS - Success<br>
>> > -- Performing Test SUPPORTS_NO_VARIADIC_MACROS_FLAG<br>
>> > -- Performing Test SUPPORTS_NO_VARIADIC_MACROS_FLAG - Success<br>
>> > -- Target triple: x86_64-unknown-linux-gnu<br>
>> > -- Native target architecture is X86<br>
>> > -- Threads enabled.<br>
>> > -- Performing Test SUPPORTS_FPIC_FLAG<br>
>> > -- Performing Test SUPPORTS_FPIC_FLAG - Success<br>
>> > -- Building with -fPIC<br>
>> > -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG<br>
>> > -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success<br>
>> > -- Performing Test SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG<br>
>> > -- Performing Test SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed<br>
>> > -- Found PythonInterp: /usr/bin/python (found version "2.7.2")<br>
>> > -- Constructing LLVMBuild project information<br>
>> > -- Targeting ARM<br>
>> > -- Targeting CellSPU<br>
>> > -- Targeting CppBackend<br>
>> > -- Targeting Hexagon<br>
>> > -- Targeting Mips<br>
>> > -- Targeting MBlaze<br>
>> > -- Targeting MSP430<br>
>> > -- Targeting NVPTX<br>
>> > -- Targeting PowerPC<br>
>> > -- Targeting Sparc<br>
>> > -- Targeting X86<br>
>> > -- Targeting XCore<br>
>> > -- Performing Test SUPPORTS_NO_C99_EXTENSIONS_FLAG<br>
>> > -- Performing Test SUPPORTS_NO_C99_EXTENSIONS_FLAG - Success<br>
>> > -- Clang version: 3.2<br>
>> > -- Found LibXml2: /usr/lib64/libxml2.so (found version "2.7.8")<br>
>> > -- Found Subversion: /usr/bin/svn (found version "1.6.17")<br>
>> > -- Configuring done<br>
>> > -- Generating done<br>
>> > -- Build files have been written to: /current/dir<br>
>> ><br>
>> ><br>
>> > =========<br>
>> > Build Error:<br>
>> > =========<br>
>> ><br>
>> > [161/2079] Building CXX object<br>
>> ><br>
>> > projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan-i386.dir/ubsan_value.cc.o<br>
>> > FAILED: /usr/bin/c++   -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS<br>
>> > -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC<br>
>> > -fvisibility-inlines-hidden -g -Iprojects/compiler-rt/lib/ubsan<br>
>> > -I/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan<br>
>> > -Iinclude -I/local/home/mahesha/src/12th_Sep/llvm/include<br>
>> > -I/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/include<br>
>> ><br>
>> > -I/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/..<br>
>> >    -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic<br>
>> > -Wno-long-long  -fPIC -fno-builtin -fno-exceptions<br>
>> > -fomit-frame-pointer -funwind-tables -O3 -fvisibility=hidden<br>
>> > -Wno-variadic-macros -Wno-c99-extensions -m32 -MMD -MT<br>
>> ><br>
>> > projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan-i386.dir/ubsan_value.cc.o<br>
>> > -MF<br>
>> > "projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan-i386.dir/ubsan_value.cc.o.d"<br>
>> > -o<br>
>> > projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan-i386.dir/ubsan_value.cc.o<br>
>> > -c<br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc<br>
>> > In file included from<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc:15:0:<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:26:9:<br>
>> > error: expected unqualified-id before ‘__int128’<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:27:18:<br>
>> > error: expected unqualified-id before ‘__int128’<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:35:9:<br>
>> > error: ‘s128’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:36:9:<br>
>> > error: ‘u128’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:148:3:<br>
>> > error: ‘SIntMax’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:151:3:<br>
>> > error: ‘UIntMax’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:154:3:<br>
>> > error: ‘UIntMax’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:<br>
>> > In member function ‘bool __ubsan::Value::isMinusOne() const’:<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:158:58:<br>
>> > error: ‘getSIntValue’ was not declared in this scope<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:<br>
>> > In member function ‘bool __ubsan::Value::isNegative() const’:<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h:163:58:<br>
>> > error: ‘getSIntValue’ was not declared in this scope<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc:<br>
>> > At global scope:<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc:19:1:<br>
>> > error: ‘SIntMax’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc:37:1:<br>
>> > error: ‘UIntMax’ does not name a type<br>
>> ><br>
>> > /local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.cc:50:1:<br>
>> > error: ‘UIntMax’ does not name a type<br>
>> > cc1plus: warning: unrecognized command line option<br>
>> > "-Wno-c99-extensions" [enabled by default]<br>
>> ><br>
>> ><br>
>> > --<br>
>> > mahesha<br>
>><br>
>><br>
>><br>
>> --<br>
>> mahesha<br>
>><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu" class="cremed">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" class="cremed">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank" class="cremed">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</blockquote></div><br></div>