<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello Renato,<br>
      <br>
      On 08/12/2013 08:36 PM, Renato Golin wrote:<br>
    </div>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">On 12 August 2013 18:31, Jeroen Hofstee <span
          dir="ltr"><<a moz-do-not-send="true"
            href="mailto:llvm@myspectrum.nl" target="_blank">llvm@myspectrum.nl</a>></span>
        wrote:<br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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">
              <div text="#000000" bgcolor="#FFFFFF">
                <div>U-boot uses 'register volatile gd_t *gd asm ("r8")'
                  to access data which needs<br>
                </div>
                to be available before and after relocation. This is a
                global definition and gcc<br>
                is compiled with -ffixed-r8 in order to prevent using
                r8.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Ok, it's better than I feared, but worse than I hoped
              for.</div>
            <div><br>
            </div>
            <div>Why is U-boot using R8 and not R9 as described in the
              AAPCS?</div>
            <div><br>
            </div>
            <div>After a few Google searches, it seems that -ffixed-r8
              seems to be (almost?) exclusively used by u-boot, which is
              worrying, and not the kind of thing LLVM wants to
              implement. But, as you say, keeping R9 ARM-wide fixed is
              an AAPCS rule, so we're in the safe there.</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Don't worry nor fear, see
    <a class="moz-txt-link-freetext" href="http://lists.denx.de/pipermail/u-boot/2013-August/160604.html">http://lists.denx.de/pipermail/u-boot/2013-August/160604.html</a><br>
     <br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>From an EABI point of view, I'm happy with making that
              flag global, but you'll have to juggle Clang vs. LLVM
              patches to keep breaking stuff to a minimum.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Yes, that is why proposed to send both patches through llvm-commits,
    so it<br>
    can be applied at the same time to keep the bots and users happy.<br>
     <br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div> You'll also have to check with Darwin folks if that's
              ok with them as well.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I did on IRC and is on cc. And besides the rename of the hidden
    flag, nothing changed for IOS.<br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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">
              <div text="#000000" bgcolor="#FFFFFF">
                    __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr));<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>This should also work with GCC without the -ffixed-r8
              flag, but with the respective AAPCS variant for R9, right?
              It sounds like a good patch for u-boot.<br>
            </div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Well not in this shape, it will treat clang and gcc differently
    (there is no reason to<br>
    punish gcc for clang not supporting global registers), to keep
    current behaviour<br>
    for U-boot (but a bit of topic here). Scheduled for the next merge
    window after<br>
    I have the llvm patches in. <br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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">
              <div text="#000000" bgcolor="#FFFFFF">
                See above, and the initial commit. I want r9 to always
                be left alone. IOS doesn't<br>
                for some reasons I do not know, but it is not for AAPCS.
                (and if I have to guess,<br>
                it is related to their r9 usage depending on the
                target). <br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>I have to say, I'm a bit lost on the v6 thing. I don't
              mind much how you're going to use it as long as you don't
              change the current behaviour on all platforms (ie. don't
              change the default flag status on Clang or the default
              state on LLVM for any target).</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Nothing changes, only arm on non IOS gets a new hidden flag.<br>
    <br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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">
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="im"><span style="color:rgb(34,34,34)">No,
                    not manually at least, just build it on Linux and
                    verified u-boot works.</span></div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>This is good news, but not enough. After you build
              Clang/LLVM, do a "make check-all". That will cover the
              basics, and hopefully there will be tests on the R9
              behaviour for Darwin.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    make check-all output:<br>
    <br>
    Testing Time: 40.08s<br>
      Expected Passes    : 13181<br>
      Expected Failures  : 53<br>
      Unsupported Tests  : 1724<br>
    <br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>But that's still very limited, so it'd be good to run
              the test-suite to make sure that the correct flags are
              being passed down on complex build environments (ie. to
              check for regressions).</div>
            <div><br>
            </div>
            <div>This is the test-suite how to, it's very simple:</div>
            <div><a moz-do-not-send="true"
                href="http://llvm.org/docs/lnt/quickstart.html">http://llvm.org/docs/lnt/quickstart.html</a><br>
            </div>
            <div><br>
            </div>
            <div>AFAIK, you can't run them cross to ARM, so you'll have
              to run it on an ARM board. You can cross-compile
              Clang/LLVM and copy the install dir to the board and point
              the --cc and --cxx to that, or you can build Clang/LLVM on
              the board itself (easier, but takes longer).</div>
            <div><br>
            </div>
            <div>Here are some instructions on how to build it on ARM
              (to limit the number of stuff you have to compile):</div>
            <div><a moz-do-not-send="true"
                href="http://llvm.org/docs/HowToBuildOnARM.html">http://llvm.org/docs/HowToBuildOnARM.html</a><br>
            </div>
            <div><br>
            </div>
            <div>If you're building it natively, make sure you "make
              check-all", too.</div>
            <div><br>
            </div>
            <div>FYI, a Chromebook build on those conditions takes about
              50 min to build + 10 min for check-all + 1 hour for the
              test-suite.</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    mmm, this is a bit more difficult since the target has no compiler
    and only 512Mb flash.<br>
    <blockquote
cite="mid:CAMSE1keW_GZHKVAZRd0-5_ZQidRBvhPiMEEwhKmFUL+R+8Hj7w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <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">
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="im"><span style="color:rgb(34,34,34)">I
                    grepped for the usage of these flags inside llvm /
                    clang, but there is</span><br>
                </div>
                nothing interesting there. I do not have a darwin / ios
                build env.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>This could be one of the features that is interesting
              to Apple only, Jim can comment on that better than me. He
              could also test your patch locally on Darwin targets.</div>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    Yes, the rename of the Darwin flag is the only concern to me. Which
    Jim said was fine, just asking for confirmation.<br>
    <br>
    Regards,<br>
    Jeroen<br>
    <br>
    <br>
  </body>
</html>