<div dir="ltr"><div><div>Btw I just checked, my project does not require compiler-rt (though its installation instructions had asked me to install compiler-rt). However, I would be glad to answer any questions related to my specific system to debug this compilation error.<br>
</div><br></div>Thanks<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 1, 2013 at 10:26 AM, Pranav Garg <span dir="ltr"><<a href="mailto:pranav.garg2107@gmail.com" target="_blank">pranav.garg2107@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 dir="ltr"><div>yes I think that is correct. I wrote a simple program to print if sizeof(uintptr_t) != sizeof(unsigned char *) and when I compile with gcc -m64 and execute it on a 64-bit host (that is different from the 32-bit laptop on which I originally compiled the program), it says the sizes are not equal.<br>

<br></div>Thanks<span class="HOEnZb"><font color="#888888"><br>Pranav<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 1, 2013 at 9:29 AM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div>On Thu, Aug 1, 2013 at 5:32 PM, Pranav Garg <span dir="ltr"><<a href="mailto:pranav.garg2107@gmail.com" target="_blank">pranav.garg2107@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 dir="ltr"><div>Dear Alexey,<br><br></div><div>Yes I am sure that the llvm, clang and compiler-rt are synced to the same version. I downloaded them all from git <a href="http://llvm.org/docs/GettingStarted.html#git-mirror" target="_blank">http://llvm.org/docs/GettingStarted.html#git-mirror</a><br>



</div><div>I think I need compiler-rt for my project but I'll verify it again to see if I can proceed without it.<br></div><div>You are correct that compiler-rt is compiled with the just built clang. The complete command that gives an error while compiler-rt compilation is:<br>



</div><div><br>/home/pranav/smack-project/llvm/build/Release+Asserts/bin/clang -fPIC -Wall -Werror -O3 -fomit-frame-pointer -m64 --sysroot=/home/pranav/smack-project/llvm/src/projects/compiler-rt/SDKs/linux -c -o /home/pranav/smack-project/llvm/build/tools/clang/runtime/compiler-rt/clang_linux/full-x86_64/x86_64/SubDir.lib/enable_execute_stack.o /home/pranav/smack-project/llvm/src/projects/compiler-rt/lib/enable_execute_stack.c<div>


<br>
/home/pranav/smack-project/llvm/src/projects/compiler-rt/lib/enable_execute_stack.c:53:29: error: cast to 'unsigned char *' from smaller integer type 'unsigned int'<br>      [-Werror,-Wint-to-pointer-cast]<br>



        unsigned char* startPage = (unsigned char*)(p & pageAlignMask);<br></div></div></div></blockquote><div><br></div></div><div>Hm... Is it true that somewhy on your system (32-bit host, I presume), sizeof(uintptr_t) != sizeof(unsigned char *) when you build code in 64-bit mode (with -m64)?</div>

<div><div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br></div></div><div><br></div><div>Thanks<span><font color="#888888"><br>
</font></span></div><span><font color="#888888">Pranav<br></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 1, 2013 at 7:27 AM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Pranav,<div><br></div><div class="gmail_extra"><div class="gmail_quote"><div><div>On Thu, Aug 1, 2013 at 1:54 AM, Pranav Garg <span dir="ltr"><<a href="mailto:pranav.garg2107@gmail.com" target="_blank">pranav.garg2107@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 dir="ltr">Hi,<br><div><br>I see that ENABLE_WERROR is being set to off (the default value) in the config.log in the llvm build. However on grepping for WERROR in the compiler-rt folder I get the following output:<br>




</div>
<div><br>pranav@pranav:~/smack-project/llvm-3.4/src/projects/compiler-rt$ grep -Rin WERROR *<br>lib/asan/tests/CMakeLists.txt:38:  -Werror<br>lib/asan/asan_malloc_mac.cc:253:// This function is currently unused, and we build with -Werror.<br>





lib/tsan/check_cmake.sh:8:CC=clang CXX=clang++ cmake -DLLVM_ENABLE_WERROR=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON $ROOT/../../../..<br>lib/tsan/Makefile.old:3:CXXFLAGS = -fPIE -fno-rtti -g -Wall -Werror \<br>





lib/tsan/rtl/Makefile.old:1:CXXFLAGS = -fPIE -g -Wall -Werror -fno-builtin -DTSAN_DEBUG=$(DEBUG) -DSANITIZER_DEBUG=$(DEBUG)<br>lib/tsan/go/buildgo.sh:68:FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -m64 -Wall -Werror -Wno-maybe-uninitialized -fno-exceptions -fno-rtti -DTSAN_GO -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 $OSCFLAGS"<br>





lib/sanitizer_common/sanitizer_platform_limits_posix.cc:410:  unsigned IOCTL_FDWERRORCLR = FDWERRORCLR;<br>lib/sanitizer_common/sanitizer_platform_limits_posix.cc:411:  unsigned IOCTL_FDWERRORGET = FDWERRORGET;<br>lib/sanitizer_common/sanitizer_platform_limits_posix.h:442:  extern unsigned IOCTL_FDWERRORCLR;<br>





lib/sanitizer_common/sanitizer_platform_limits_posix.h:443:  extern unsigned IOCTL_FDWERRORGET;<br>lib/sanitizer_common/tests/CMakeLists.txt:36:  -Wall -Werror -Werror=sign-compare)<br>lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc:177:  _(FDWERRORCLR, NONE, 0);<br>





lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc:178:  _(FDWERRORGET, WRITE, struct_floppy_write_errors_sz);<br>make/options.mk:10:CFLAGS := -Wall -Werror<br>make/platform/clang_linux.mk:85:CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer<br>





make/platform/clang_darwin.mk:109:CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer<br>make/platform/multi_arch.mk:10:CFLAGS := -Wall -Werror<br>make/platform/darwin_fat.mk:42:CFLAGS := -Wall -Werror<br><br></div><div>I see that -DLLVM_ENABLE_WERROR is being set in the script "lib/tsan/check_cmake.sh". Should I disable -DLLVM_ENABLE_WERROR at this point?<br>





</div><div><br></div><div>Thanks<span><font color="#888888"><br>Pranav<br></font></span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 31, 2013 at 3:24 PM, Matt Arsenault <span dir="ltr"><<a href="mailto:arsenm2@gmail.com" target="_blank">arsenm2@gmail.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can disable -Werror by adding the cmake flag -DLLVM_ENABLE_WERROR=OFF, which should let it just ignore that (that's also the default, so you must have turned it on somewhere)<br>






<div><div><br>
On Jul 31, 2013, at 13:09 , Pranav Garg <<a href="mailto:pranav.garg2107@gmail.com" target="_blank">pranav.garg2107@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I am trying to build llvm along with clang and compiler-rt. When I run make, I am getting the following compilation error (I tried compiling llvm-3.2, which is what I need for my project, but also tried llvm-3.3 and the current llvm source from the git repository).<br>






><br>
> ...<br>
>   COMPILE:   clang_linux/full-x86_64/x86_64: /home/pranav/smack-project/llvm/src/projects/compiler-rt/lib/enable_execute_stack.c<br>
> /home/pranav/smack-project/llvm/src/projects/compiler-rt/lib/enable_execute_stack.c:53:29: error: cast to 'unsigned char *' from smaller integer type 'unsigned int'<br>
>       [-Werror,-Wint-to-pointer-cast]<br>
>         unsigned char* startPage = (unsigned char*)(p & pageAlignMask);<br>
>                                    ^<br>
> /home/pranav/smack-project/llvm/src/projects/compiler-rt/lib/enable_execute_stack.c:54:27: error: cast to 'unsigned char *' from smaller integer type 'unsigned int'<br>
>       [-Werror,-Wint-to-pointer-cast]<br>
>         unsigned char* endPage = (unsigned char*)((p+TRAMPOLINE_SIZE+pageSize) & pageAlignMask);<br>
>                                  ^<br>
> 2 errors generated.<br></div></div></blockquote></div></div></div></div></blockquote><div><br></div></div></div><div>This is weird. In configure+make build all sources from projects/compiler-rt are compiled with just-built Clang, so -Werror should work fine for you,</div>




<div>no matter which host compiler you have. Are you sure llvm, clang and compiler-rt checkouts are synced to the same revision?</div><div>As a workaround, you may try to remove compiler-rt checkout if you don't need it for now.</div>



<div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div>
> ...<br>
><br>
> On gcc --version I get the following output:<br>
>         gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3<br>
> My operating system is a Ubuntu 12.04.1 LTS. On typing uname -a I get:<br>
>         Linux pranav 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012 i686 i686 i386 GNU/Linux<br>
><br>
> Any ideas as to how to resolve this compilation error?<br>
><br>
> Thanks<br>
> Pranav<br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>