[cfe-dev] [LLVMdev] cmake+ninja build error for compiler-rt sources

Mahesha HS mahesha.llvm at gmail.com
Tue Oct 16 07:52:13 PDT 2012


On Sat, Oct 13, 2012 at 1:52 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Sat, Oct 13, 2012 at 1:09 AM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> On Fri, Oct 12, 2012 at 6:14 PM, Chandler Carruth <chandlerc at google.com>
>> wrote:
>> > I'm seeing this too. CC'ing the author ubsan stuff.
>> >
>> > Richard, I know you were OK with only supporting Clang-bootstraps, but I
>> > don't think that's terribly viable here.
>>
>> Just out of curiosity - why isn't that viable? I'd sort of hope to
>> treat optional sanitizer runtimes like, say, lld or other projects
>> that aren't necessary to bootstrap: viable candidates for C++11 & more
>> or less anything we want to use.
>
>
> 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...
>
> 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.
>
>
> 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.

I am still getting compiler errors for compiler-rt sources as below.
Do not know, if the first argument to IsNullLiteralHelper() is to be
passed as '0' instead of false, in the below lines.

==========================================
/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/asan/tests/asan_noinst_test.cc:
In member function ‘virtual void
AddressSanitizerInterface_GetAllocatedSizeAndOwnershipTest_Test::TestBody()’:
/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/asan/tests/asan_noinst_test.cc:373:3:
error: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’
[-Werror=conversion-null]
/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/asan/tests/asan_noinst_test.cc:375:3:
error: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’
[-Werror=conversion-null]
/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/asan/tests/asan_noinst_test.cc:380:3:
error: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’
[-Werror=conversion-null]
/local/home/mahesha/src/12th_Sep/llvm/projects/compiler-rt/lib/asan/tests/asan_noinst_test.cc:386:3:
error: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’
[-Werror=conversion-null]
cc1plus: all warnings being treated as errors

ninja: build stopped: subcommand failed.
==========================================

--
mahesha



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



-- 
mahesha




More information about the cfe-dev mailing list