<div dir="ltr">Applied thusly:<div><br></div><div><div>dzur:~/sources/llvm> git svn dcommit </div><div>Committing to <a href="https://llvm.org/svn/llvm-project/llvm/trunk">https://llvm.org/svn/llvm-project/llvm/trunk</a> ...</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>M<span class="Apple-tab-span" style="white-space:pre">   </span>Makefile.rules</div><div>Committed r231128</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><br><div class="gmail_quote">On Fri, Feb 27, 2015 at 3:22 PM Bill Rushmore <<a href="mailto:bill.rushmore@oracle.com">bill.rushmore@oracle.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Thanks for the suggestion.  Here's an updated version that's a bit
    cleaner.</div><div bgcolor="#FFFFFF" text="#000000"><br>
    <br>
    Bill</div><div bgcolor="#FFFFFF" text="#000000"><br>
    <br>
    <div>On 2/27/2015 2:25 PM, Eric Christopher
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">I think you want:<br>
        <br>
        <div>@@ -638,10 +641,13 @@</div>
        <div>   ifeq ($(HOST_OS),Darwin)</div>
        <div>     LD.Flags += -Wl,-dead_strip</div>
        <div>   else</div>
        <div>-    ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))</div>
        <div>+    ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW
          SunOS))</div>
        <div>       LD.Flags += -Wl,--gc-sections</div>
        <div>     endif</div>
        <div>   endif</div>
        <div>+  ifeq ($(HOST_OS),SunOS)</div>
        <div>+    LD.Flags += -Wl,-z -Wl,discard-unused=sections</div>
        <div>+  endif </div>
        <div><br>
        </div>
        <div>to have and else ifeq under darwin and then else ifneq for
          the Cygwin bits.</div>
        <div><br>
        </div>
        <div>At any rate the SunOS bit should be hoisted.</div>
        <div><br>
        </div>
        <div>-eric</div>
      </div>
      <br>
      <div class="gmail_quote">On Fri, Feb 27, 2015 at 1:36 PM Bill
        Rushmore <<a href="mailto:bill.rushmore@oracle.com" target="_blank">bill.rushmore@oracle.com</a>>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> Here's the updated
            patch with the new flags for Solaris.</div>
          <div bgcolor="#FFFFFF" text="#000000"><br>
            <br>
            Bill</div>
          <div bgcolor="#FFFFFF" text="#000000"><br>
            <br>
            <div>On 2/27/2015 11:15 AM, Eric Christopher wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Thanks!<br>
                <br>
                -eric</div>
              <br>
              <div class="gmail_quote">On Fri, Feb 27, 2015 at 11:11 AM
                Bill Rushmore <<a href="mailto:bill.rushmore@oracle.com" target="_blank">bill.rushmore@oracle.com</a>>

                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div bgcolor="#FFFFFF" text="#000000"> Eric,<br>
                    <br>
                    The Solaris linker's equivalent is (sorry I didn't
                    realize this earlier): <br>
                    <pre>-Wl,-z -Wl,discard-unused=sections

</pre>
                    We can use -ffunction-section/-fdata-sections with
                    Solaris' GCC. We also need to pass
                    -falign-functions=8.<br>
                    <br>
                    I will rework the patch with these changes, test it,
                    and then resend. <br>
                  </div>
                  <div bgcolor="#FFFFFF" text="#000000"> <br>
                    Bill</div>
                  <div bgcolor="#FFFFFF" text="#000000"><br>
                    <br>
                    <div>On 2/27/2015 10:27 AM, Eric Christopher wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">Hi Bill,<br>
                        <br>
                        Will the sun linker gc the sections itself then?
                        or do we need to avoid using
                        -ffunction-section/-fdata-sections as well?
                        <div><br>
                        </div>
                        <div>-eric</div>
                      </div>
                      <br>
                      <div class="gmail_quote">On Fri, Feb 27, 2015 at
                        10:09 AM bill rushmore <<a href="mailto:bill.rushmore@oracle.com" target="_blank">bill.rushmore@oracle.com</a>>


                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a very simple
                          patch for Makefile.rules that solves the
                          problem of<br>
                          trying to build on Solaris.  The issue is that
                          Solaris' gcc uses the<br>
                          Solaris linker and that linker doesn't have
                          the --gc-sections flag.<br>
                          This patch fixes Bug 18517.<br>
                          <br>
                          Bill Rushmore<br>
_______________________________________________<br>
                          llvm-commits mailing list<br>
                          <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
                          <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
                        </blockquote>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </blockquote>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div></blockquote></div></div></div>