[pypy-issue] Issue #2721: PGO build fails on macOS Sierra 10.12.4 (pypy/pypy)

Ryan Hileman issues-reply at bitbucket.org
Fri Dec 29 00:46:06 EST 2017


New issue 2721: PGO build fails on macOS Sierra 10.12.4
https://bitbucket.org/pypy/pypy/issues/2721/pgo-build-fails-on-macos-sierra-10124

Ryan Hileman:

When running: `pypy ../../rpython/bin/rpython --opt=jit --profopt` I get roughly `-lgcov not found`.

Looks like the rpython build tries to link libgcov which isn't part of llvm on macOS. I believe the equivalent Apple LLVM flags to enable gcov are `-fprofile-arcs -ftest-coverage`.

Replacing `-lgcov` with `-fprofile-arcs -ftest-coverage` seems to result in a successful profopt build, though I'm not sure how to double-check:

```
            if self.config.translation.shared:
-                mk.rule('$(PROFOPT_TARGET)', '$(TARGET) main.o',
                         ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) -o $@ $(RPATH_FLAGS) -lgcov', '$(MAKE) postcompile BIN=$(PROFOPT_TARGET)'])
+                mk.rule('$(PROFOPT_TARGET)', '$(TARGET) main.o',
                         ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) -o $@ $(RPATH_FLAGS) -fprofile-arcs -ftest-coverage', '$(MAKE) postcompile BIN=$(PROFOPT_TARGET)'])
            else:
                mk.definition('PROFOPT_TARGET', '$(TARGET)')
```




More information about the pypy-issue mailing list