[cfe-users] compile error

Alexey Samsonov samsonov at google.com
Fri Jul 12 06:05:54 PDT 2013


Hi!

On Fri, Jul 12, 2013 at 4:34 AM, Mani <monamimani at gmail.com> wrote:

> Hi all,
>
> i have been compiling clang for months without problems, until about last
> week. Since then I can't compile.
>
> usually delete CMakeCache.txt then run
> cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_TARGETS_TO_BUILD="X86"
> -DCMAKE_C_COMPILER=/usr/local/bin/clang
> -DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ -DCMAKE_CXX_FLAGS="-std=c++11
> -stdlib=libc++" -DCMAKE_SHARED_LINKER_FLAGS="-std=c++11 -stdlib=libc++"
> -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WERROR=OFF -DLLVM_BUILD_TOOLS=ON
> -DLLVM_BUILD_EXAMPLES=OFF -DCLANG_BUILD_EXAMPLES=OFF
> -DLLVM_APPEND_VC_REV=ON /Users/Mani/Development/Projects/llvm/source
> ln -s $PWD/compile_commands.json
> /Users/Mani/Development/Projects/llvm/source
>
> and then run
> make -j10 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1
>
> Here is what i get.
>
> [ 15%] [ 16%] Built target clang_rt.x86_64
> Built target clang_rt.i386
> [ 16%]
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:799:1:
> error: 'assertion_failed__799'
>       declared as an array with a negative size
> CHECK_SIZE_AND_OFFSET(dirent, d_ino);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:726:3:
> note: expanded from macro
>       'CHECK_SIZE_AND_OFFSET'
>   COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30:
> note: expanded from macro 'COMPILER_CHECK'
> #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
>                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57:
> note: expanded from macro
>       'IMPL_COMPILER_ASSERT'
>     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
>                                                         ^~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:803:1:
> error: 'assertion_failed__803'
>       declared as an array with a negative size
> CHECK_SIZE_AND_OFFSET(dirent, d_reclen);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:728:3:
> note: expanded from macro
>       'CHECK_SIZE_AND_OFFSET'
>   COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==          \
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30:
> note: expanded from macro 'COMPILER_CHECK'
> #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
>                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57:
> note: expanded from macro
>       'IMPL_COMPILER_ASSERT'
>     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
>                                                         ^~~~~~~~~~~~~~~
> 2 errors generated.
> Built target RTLSanCommon.osx
> make[2]: ***
> [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cc.o]
> Error 1
> make[1]: ***
> [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/all]
> Error 2
> make[1]: *** Waiting for unfinished jobs….
>
> Anybody know what going on?
>

You've got a problem with compiling AddressSanitizer runtime: it
incorrectly defines "dirent" structure (normally it comes from
/usr/include/sys/dirent.h).
1) Which OS X version do you use?
2) What is the value of __DARWIN_64_BIT_INO_T on your system? (you may
check it by including sys/cdefs.h and looking at the value of this
definition).

Note that if you're not interested in ASan, you may just build clang as
follows:
"make -j10 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 clang"


> Thanks
> Emmanuel
> _______________________________________________
> cfe-users mailing list
> cfe-users at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20130712/a28cd61e/attachment.html>


More information about the cfe-users mailing list