<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:bztemail@gmail.com" title="bzt <bztemail@gmail.com>"> <span class="fn">bzt</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Optimizing to library calls with -ffreestanding and -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=38455">bug 38455</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Optimizing to library calls with -ffreestanding and -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=38455#c10">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - Optimizing to library calls with -ffreestanding and -O0"
   href="https://bugs.llvm.org/show_bug.cgi?id=38455">bug 38455</a>
              from <span class="vcard"><a class="email" href="mailto:bztemail@gmail.com" title="bzt <bztemail@gmail.com>"> <span class="fn">bzt</span></a>
</span></b>
        <pre>Hi Tim,

I've made peace with clang not supporting some gcc features. I believe what
caused the problem is the undocumented -nolibc argument, somehow implied by
-nostartfiles (more precisely it's only documented for the GNU ld, but clearly
gcc won't generate calls to memcpy, memset etc. when used, therefore the issue
maybe not related to -ffreestanding).

I decided to go on with workarounds: I've implemented those memory functions
for all the architectures I work with, and now that I don't have linking
errors, and I don't care why memset is called in my meminit, everything is
working just fine (and there's no __builtin_trap() either with -O0). I have to
debug my run-time linker though, because lld generates a little bit different
ELF structures than GNU ld. But I'm sure that's on me, as I have made some
GNU-specific assumption in my code I was unaware of.

Anyway, I'd like to say thanks again for your help, and I think we can safely
close this issue.

Cheers,
bzt</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>