<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/14/15 11:44 AM, kiran pawar
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAK55ByNy3_Mi=xSymzopQioMbjtZLc3Tmq0RnyESsYSyqCyr6A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi John,<br>
          Yes I am working with Nikhil.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Excellent.<br>
    <br>
    <blockquote
cite="mid:CAK55ByNy3_Mi=xSymzopQioMbjtZLc3Tmq0RnyESsYSyqCyr6A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>I compiled Clang 3.2 in Cygwin using gcc ( note- with clang
          there were lot of errors during compilation). Going ahead,
          Installation is successful for me.<br>
          <br>
        </div>
        <div>However there new issue with SAFECode clang installed in
          cygwin.<br>
          <br>
        </div>
        <div>If you check below snippet it looks like clang invoke gcc
          which in-turn fails to recognize ‘-fmemsafety’ and so
          sample.exe is not created.<br>
        </div>
        <div>Any clue why clang fallback to gcc ? On my linux machine I
          do not see gcc invocation. <br>
        </div>
      </div>
    </blockquote>
    <br>
    My best guess is that the Clang compiler driver is written to use
    gcc to link object files together (as opposed to calling ld
    directly).  Note that Clang runs clang to create
    /tmp/sample-T1WCmN.s (which I assume is the assembly code created by
    Clang).  When I modified Clang to pass the "-fmemsafety" option from
    the Clang compiler driver to the Clang compiler (yes, Clang runs
    *itself* to compile code), I must have done it in a way that also
    causes Clang to pass "-fmemsafety" to the linker command line also
    (which works if Clang is performing the link but not if GCC is).<br>
    <br>
    Take a look at safecode/tools/clang/lib/Driver/Tools.cpp.  The
    method Clang::ConstructJob() adds the "-fmemsafety" option to the
    command line.  You may need to modify Tools.cpp so that the code
    that constructs the link command line remove this option (and other
    SAFECode options).<br>
    <br>
    That's my best guess at the moment.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAK55ByNy3_Mi=xSymzopQioMbjtZLc3Tmq0RnyESsYSyqCyr6A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
          ==============<br>
          $ clang -v -g -fmemsafety -o sample sample.c
          -L/home/kpawar/SAFECode/LLVM_INSTALL/lib
          -I/home/kpawar/SAFECode/LLVM_INSTALL/include<br>
          clang version 3.2 (: <a moz-do-not-send="true"
href="http://llvm.org/svn/llvm-project/safecode/branches/release_32/tools/clang">http://llvm.org/svn/llvm-project/safecode/branches/release_32/tools/clang</a>)
          (llvm/branches/release_32 ^/llvm/branches/release_32 250143)<br>
          Target: i386-pc-cygwin<br>
          Thread model: posix<br>
           "/home/kpawar/SAFECode/LLVM_INSTALL/bin/clang" -cc1 -triple
          i386-pc-cygwin -S -disable-free -main-file-name sample.c
          -mrelocation-model static -mdisable-fp-elim -fmath-errno
          -mconstructor-aliases -target-cpu pentium4
          -target-linker-version 2.25.2 -momit-leaf-frame-pointer -v -g
          -resource-dir
          /home/kpawar/SAFECode/LLVM_INSTALL/bin/../lib/clang/3.2 -I
          /home/kpawar/SAFECode/LLVM_INSTALL/include -fmodule-cache-path
          /var/tmp/clang-module-cache -fno-dwarf-directory-asm
          -fdebug-compilation-dir /home/kpawar/Documents -ferror-limit
          19 -fmessage-length 237 -fmemsafety -mstackrealign
          -fno-use-cxa-atexit -fobjc-runtime=gcc
          -fdiagnostics-show-option -fcolor-diagnostics -o
          /tmp/sample-T1WCmN.s -x c sample.c<br>
          clang -cc1 version 3.2 based upon LLVM 3.2svn default target
          i386-pc-cygwin<br>
          ignoring nonexistent directory "/usr/local/include"<br>
          #include "..." search starts here:<br>
          #include <...> search starts here:<br>
           /home/kpawar/SAFECode/LLVM_INSTALL/include<br>
 /home/kpawar/SAFECode/LLVM_INSTALL/bin/../lib/clang/3.2/include<br>
           /usr/include/w32api<br>
           /usr/include<br>
          End of search list.<br>
           "<b>/usr/bin/gcc" -v -fmemsafety
            -L/home/kpawar/SAFECode/LLVM_INSTALL/lib -I
            /home/kpawar/SAFECode/LLVM_INSTALL/include -c -m32 -o
            /tmp/sample-5Zz17i.o -x assembler /tmp/sample-T1WCmN.s<br>
            Using built-in specs.</b><br>
          COLLECT_GCC=/usr/bin/gcc<br>
          gcc: error: unrecognized command line option ‘-fmemsafety’<br>
          Target: i686-pc-cygwin<br>
          Configured with:
          /cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.i686/src/gcc-4.9.3/configure
          --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-4.9.3-1.i686/src/gcc-4.9.3
          --prefix=/usr --exec-prefix=/usr --localstatedir=/var
          --sysconfdir=/etc --docdir=/usr/share/doc/gcc
          --htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin
          --host=i686-pc-cygwin --target=i686-pc-cygwin
          --without-libiconv-prefix --without-libintl-prefix
          --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc
          --enable-static --enable-version-specific-runtime-libs
          --enable-bootstrap --enable-__cxa_atexit --with-dwarf2
          --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions
          --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
          --enable-graphite --enable-threads=posix --enable-libatomic
          --enable-libgomp --disable-libitm --enable-libquadmath
          --enable-libquadmath-support --enable-libssp --enable-libada
          --enable-libjava --enable-libgcj-sublibs --disable-java-awt
          --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar
          --with-gnu-ld --with-gnu-as
          --with-cloog-include=/usr/include/cloog-isl
          --without-libiconv-prefix --without-libintl-prefix
          --with-system-zlib --enable-linker-build-id<br>
          Thread model: posix<br>
          gcc version 4.9.3 (GCC)<br>
          clang: error: assembler (via gcc) command failed with exit
          code 1 (use -v to see invocation)<br>
          <br>
          ============<br>
        </div>
        <div><br>
        </div>
        ~ Kiran<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Oct 14, 2015 at 7:06 PM, John
          Criswell <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote">
            <div>
              <div>Dear Kiran,<br>
                <br>
                Egads!  It looks like /usr/bin/clang is crashing.  This
                isn't a bug in SAFECode; it's a bug in Clang.<br>
                <br>
                What version of Clang are you using in Cygwin to compile
                SAFECode?<br>
                <br>
                One thing you should try is compiling Clang 3.2 in
                Cygwin (either using gcc or clang).  SAFECode Clang is
                standard Clang modified with a few new command-line
                options to run the SAFECode transformation passes.  If
                unmodified Clang 3.2 won't compile on Cygwin, then
                SAFECode Clang for LLVM 3.2 won't compile either.<br>
                <br>
                BTW, are you working with Nikhil?<br>
                <br>
                Regards,<br>
                <br>
                John Criswell
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    On 10/13/15 11:29 PM, kiran pawar wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>Hi John,<br>
                        </div>
                        That worked for me. I am using llvm 3.2 only and
                        following <a moz-do-not-send="true"
                          href="http://safecode.cs.illinois.edu/docs/Install.html"
                          target="_blank">http://safecode.cs.illinois.edu/docs/Install.html</a><br>
                        <br>
                      </div>
                      <div>So for I am able to make inside
                        llvm/projects/poolalloc by doing such cosmetic
                        changes.<br>
                      </div>
                      <div>Now, when I tried to make inside
                        llvm/projects/safecode, I see another error.<br>
                      </div>
                      <div><br>
                        kpawar@KPAWAR-LT
                        ~/SAFECode/LLVM_SRC/llvm/projects/safecode<br>
                        $ /usr/bin/clang -cc1 -triple
                        i386-pc-windows-cygnus -emit-obj -disable-free
                        -disable-llvm-verifier -main-file-name
                        Parser.cpp -mrelocation-model static
                        -relaxed-aliasing -fmath-errno -masm-verbose
                        -mconstructor-aliases -target-cpu pentium4
                        -target-linker-version 2.25 -dwarf-column-info
                        -coverage-file
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -resource-dir
                        /usr/bin/../lib/clang/i686-pc-cygwin/3.5.2
                        -dependency-file
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.d.tmp

                        -MP -MT
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -MT
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.d

                        -D _DEBUG -D _GNU_SOURCE -D
                        __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS
                        -D __STDC_LIMIT_MACROS -D SAFECODE -D SAFECODE
                        -I /home/kpawar/SAFECode/LLVM_SRC/llvm/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -O3 -Woverloaded-virtual -Wcast-qual -Wall
                        -Wno-deprecated -Wall -Wno-long-long -Wall -W
                        -Wno-unused-parameter -Wwrite-strings
                        -Wcovered-switch-default -pedantic
                        -fdebug-compilation-dir
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse

                        -ferror-limit 19 -fmessage-length 271
                        -fvisibility-inlines-hidden -mstackrealign
                        -fno-rtti -fobjc-runtime=gcc
                        -fdiagnostics-show-option -fcolor-diagnostics
                        -vectorize-loops -vectorize-slp -o
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -x c++  tools/clang/lib/Parse/Parser.cpp<br>
                        <b>Stack dump:</b><br>
                        0.      Program arguments: /usr/bin/clang -cc1
                        -triple i386-pc-windows-cygnus -emit-obj
                        -disable-free -disable-llvm-verifier
                        -main-file-name Parser.cpp -mrelocation-model
                        static -relaxed-aliasing -fmath-errno
                        -masm-verbose -mconstructor-aliases -target-cpu
                        pentium4 -target-linker-version 2.25
                        -dwarf-column-info -coverage-file
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -resource-dir
                        /usr/bin/../lib/clang/i686-pc-cygwin/3.5.2
                        -dependency-file
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.d.tmp

                        -MP -MT
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -MT
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.d

                        -D _DEBUG -D _GNU_SOURCE -D
                        __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS
                        -D __STDC_LIMIT_MACROS -D SAFECODE -D SAFECODE
                        -I /home/kpawar/SAFECode/LLVM_SRC/llvm/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include

                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -I
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/poolalloc/include
                        -O3 -Woverloaded-virtual -Wcast-qual -Wall
                        -Wno-deprecated -Wall -Wno-long-long -Wall -W
                        -Wno-unused-parameter -Wwrite-strings
                        -Wcovered-switch-default -pedantic
                        -fdebug-compilation-dir
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse

                        -ferror-limit 19 -fmessage-length 271
                        -fvisibility-inlines-hidden -mstackrealign
                        -fno-rtti -fobjc-runtime=gcc
                        -fdiagnostics-show-option -fcolor-diagnostics
                        -vectorize-loops -vectorize-slp -o
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/Release+Asserts/Parser.o

                        -x c++ tools/clang/lib/Parse/Parser.cpp<br>
                        1.     
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include/clang/Sema/DeclSpec.h:855:3:

                        current parser token 'SourceLocation'<br>
                        2.     
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include/clang/Sema/DeclSpec.h:38:1:

                        parsing namespace 'clang'<br>
                        3.     
                        /home/kpawar/SAFECode/LLVM_SRC/llvm/projects/safecode/tools/clang/lib/Parse/../../include/clang/Sema/DeclSpec.h:783:1:

                        parsing struct/union/class body 'UnqualifiedId'<br>
                        <br>
                        <br>
                        <br>
                      </div>
                      ~ Kiran<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Tue, Oct 13, 2015 at
                        11:16 PM, John Criswell <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:jtcriswel@gmail.com"
                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:jtcriswel@gmail.com">jtcriswel@gmail.com</a></a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote">
                          <div>
                            <div>Dear Kiran,<br>
                              <br>
                              Which version of LLVM/SAFECode are you
                              using?  Is it LLVM 3.2?<br>
                              <br>
                              I'm guessing that you're using LLVM 3.2
                              and trying to compile safecode/tools/LTO
                              (that's the only component that links in
                              AssistDS.a).  You could try changing the
                              following line:<br>
                              <br>
                              $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/libAssistDS.a:

$(POOLALLOC_OBJDIR)/$(BuildMode)/lib/AssistDS.a<br>
                              <br>
                              ... to:<br>
                              <br>
                              $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/libAssistDS.a:

$(POOLALLOC_OBJDIR)/$(BuildMode)/lib/libAssistDS.a<br>
                              <br>
                              You'll need to fix the problem for other
                              libraries for which SAFECode creates links
                              in its own object tree (such as
                              libpoolalloc.a).<br>
                              <br>
                              That might fix the problem on Cygwin.<br>
                              <br>
                              Regards,<br>
                              <br>
                              John Criswell
                              <div>
                                <div><br>
                                  <br>
                                  On 10/13/15 2:36 AM, kiran pawar via
                                  llvm-dev wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>
                                  <div dir="ltr">
                                    <div>
                                      <div>
                                        <div>
                                          <div>Hi,<br>
                                          </div>
                                          On Linux I observed<br>
                                          <br>
                                          [root@localhost poolalloc]#
                                          find . -name *.a<br>
./Release+Asserts/lib/LLVMDataStructure.a<br>
./Release+Asserts/lib/poolalloc.a<br>
./Release+Asserts/lib/AssistDS.a<br>
./Release+Asserts/lib/libpoolalloc_fl_rt.a<br>
./Release+Asserts/lib/libpoolalloc_rt.a<br>
./Release+Asserts/lib/libpa_pre_rt.a<br>
./Release+Asserts/lib/libcount.a<br>
                                          <br>
                                          <br>
                                        </div>
                                        On cygwin I observed <br>
                                        <br>
                                        kpawar@KPAWAR-LT
                                        ~/SAFECode/LLVM_SRC/llvm/projects/poolalloc<br>
                                        $ find . -name *.a<br>
./Release+Asserts/lib/libAssistDS.a<br>
                                        ./Release+Asserts/lib/libcount.a<br>
./Release+Asserts/lib/libLLVMDataStructure.a<br>
./Release+Asserts/lib/libpa_pre_rt.a<br>
./Release+Asserts/lib/libpoolalloc.a<br>
./Release+Asserts/lib/libpoolalloc_fl_rt.a<br>
./Release+Asserts/lib/libpoolalloc_rt.a<br>
./Release+Asserts/lib/libtypechecks_rt.a<br>
                                        <br>
                                        <br>
                                      </div>
                                      This creates issue to
                                      llvm/safecode since it tries to
                                      search libraries named as
                                      poolalloc.a, AssistDS.a etc. Any
                                      solution for this ?<br>
                                      <br>
                                    </div>
                                    ~ Kiran<br>
                                    <div>
                                      <div><br>
                                        <br>
                                      </div>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a moz-do-not-send="true" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><span>
</span></pre>
                              <span> </span></blockquote>
                            <span> <br>
                              <br>
                              <pre cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
                            </span></div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                  <br>
                  <pre cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>