<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Instrumentation-based PGO doesn't work on OS X (?)"
   href="https://llvm.org/bugs/show_bug.cgi?id=23129">23129</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Instrumentation-based PGO doesn't work on OS X (?)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm trying to follow the
<a href="http://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization">http://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization</a>
instructions for building ninja. I can't seem to get it to work -- either I'm
holding it wrong, or it broke when it got reshuffled.

I'm doing:

$ git clone <a href="https://github.com/martine/ninja.git">https://github.com/martine/ninja.git</a>
Cloning into 'ninja'...
remote: Counting objects: 8458, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 8458 (delta 15), reused 0 (delta 0), pack-reused 8422
Receiving objects: 100% (8458/8458), 1.86 MiB | 635.00 KiB/s, done.
Resolving deltas: 100% (5974/5974), done.
Checking connectivity... done.
$ cd ninja
$ CXX=/Users/thakis/src/llvm-build/bin/clang++ CFLAGS="-stdlib=libstdc++
-fprofile-instr-generate -isysroot $(xcrun -show-sdk-path)"
LDFLAGS='-stdlib=libstdc++ -fprofile-instr-generate' ./configure.py 
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to
src/*.in.cc will not affect your build.
wrote build.ninja.
$ ninja -v
[1/24] /Users/thakis/src/llvm-build/bin/clang++ -MMD -MT build/build.o -MF
build/build.o.d -g -Wall -Wextra -Wno-deprecated -Wno-unused-parameter
-fno-rtti -fno-exceptions -fvisibility=hidden -pipe
-Wno-missing-field-initializers '-DNINJA_PYTHON="python"' -O2 -DNDEBUG
-fdiagnostics-color -DNINJA_HAVE_BROWSE -stdlib=libstdc++
-fprofile-instr-generate -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
-c src/build.cc -o build/build.o
# ... (omitted, just wanted to show that the flags are there)
[24/24] /Users/thakis/src/llvm-build/bin/clang++ -Lbuild -stdlib=libstdc++
-fprofile-instr-generate -o ninja build/ninja.o -lninja
$ ./ninja manifest_parser_perftest
[2/2] LINK manifest_parser_perftest
Nicos-MBP-8:ninja thakis$ ./manifest_parser_perftest 
Creating manifest data...done.
1128ms (hash: c617022)
1117ms (hash: c617022)
1145ms (hash: c617022)
1131ms (hash: c617022)
1148ms (hash: c617022)
min 1117ms  max 1148ms  avg 1133.8ms
$ ls -l default.profraw 
-rw-r--r--  1 thakis  staff  0 Apr  5 13:56 default.profraw



Note that default.profraw is getting generated, but it ends up empty.</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>