<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I also encounter this issue and I think your fix will not work.</div><div><br></div><div>While it fixes compilation, it introduce a latent bug as now the structure definition in asan no longer match the one readdir expects.</div><div><br></div><div>When  compiling for 10.6 and later, OS X implicitly replace call to readdir (and other functions) by readdir$INODE64 call which properly handle the 64bit structure, but call to readdir will always use the old structure.</div><div><br></div><div>So if using 64 bit version of the dirent struct, ASAN should interpose readdir$INODE64 and not readdir symbol.</div><div><br></div><div><br><div><div>Le 16 juil. 2013 à 13:58, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Emmanuel!<div><br></div><div>I found out what the problem was: we defined dirent structure for Mac OS X 10.5, and in your case the runtime was compiled with -mmacosx-version-min=10.7.</div><div>This problem should be fixed by r186404.<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 13, 2013 at 10:25 PM, Emmanuel Thivierge <span dir="ltr"><<a href="mailto:monamimani@gmail.com" target="_blank">monamimani@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi,</div><div><br></div><div>Thanks a lot for your help.</div><div><br></div><div>
My version of osX is 10.8.4</div><div>And the define __DARWIN_64_BIT_INO_T is define to 1.</div><div><br></div><div>I hope this help.</div><div><br></div><div>The reason I am compiling Address sanitizer is that I might need it is i run into problems while developing.</div>
<div><br></div><div>Thanks again</div><div><br></div><div>Emmanuel</div><div><div class="h5"><br><div><div>On 2013-07-12, at 9:05 AM, Alexey Samsonov <<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">Hi!<div><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 12, 2013 at 4:34 AM, Mani <span dir="ltr"><<a href="mailto:monamimani@gmail.com" target="_blank">monamimani@gmail.com</a>></span> wrote:<br>

<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">Hi all,<br>
<br>
i have been compiling clang for months without problems, until about last week. Since then I can't compile.<br>
<br>
usually delete CMakeCache.txt then run<br>
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<br>


ln -s $PWD/compile_commands.json /Users/Mani/Development/Projects/llvm/source<br>
<br>
and then run<br>
make -j10 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1<br>
<br>
Here is what i get.<br>
<br>
[ 15%] [ 16%] Built target clang_rt.x86_64<br>
Built target clang_rt.i386<br>
[ 16%] /Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:799:1: error: 'assertion_failed__799'<br>
      declared as an array with a negative size<br>
CHECK_SIZE_AND_OFFSET(dirent, d_ino);<br>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:726:3: note: expanded from macro<br>
      'CHECK_SIZE_AND_OFFSET'<br>
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \<br>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'<br>
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)<br>
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro<br>
      'IMPL_COMPILER_ASSERT'<br>
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]<br>
                                                        ^~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:803:1: error: 'assertion_failed__803'<br>
      declared as an array with a negative size<br>
CHECK_SIZE_AND_OFFSET(dirent, d_reclen);<br>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:728:3: note: expanded from macro<br>
      'CHECK_SIZE_AND_OFFSET'<br>
  COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==          \<br>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'<br>
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)<br>
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
/Users/Mani/Development/Projects/llvm/source/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro<br>
      'IMPL_COMPILER_ASSERT'<br>
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]<br>
                                                        ^~~~~~~~~~~~~~~<br>
2 errors generated.<br>
Built target RTLSanCommon.osx<br>
make[2]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/sanitizer_platform_limits_posix.cc.o] Error 1<br>
make[1]: *** [projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.osx.dir/all] Error 2<br>
make[1]: *** Waiting for unfinished jobs….<br>
<br>
Anybody know what going on?<br></blockquote><div><br></div><div>You've got a problem with compiling AddressSanitizer runtime: it incorrectly defines "dirent" structure (normally it comes from /usr/include/sys/dirent.h).</div>

<div>1) Which OS X version do you use?</div><div>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).</div><div> <br></div>

<div>Note that if you're not interested in ASan, you may just build clang as follows:</div><div>"make -j10 ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 clang"</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>
Thanks<br>
Emmanuel<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@cs.uiuc.edu" target="_blank">cfe-users@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div></div>
</blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>
_______________________________________________<br>cfe-users mailing list<br><a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></div></body></html>