rizsotto / scan-build

Clang's scan-build re-implementation in python
Other
362 stars 34 forks source link

Doesn't work when building emacs on macOS #106

Closed wyuenho closed 6 years ago

wyuenho commented 6 years ago

I'm on macOS 10.13.6 High Sierra. I've installed scan-build to a virtualenv created by pyenv, using Python 3.7.0. When I run

$ scan-build make install

under the emacs source tree, compile_commands.json is empty. The only way to make this work is run bear with SIP disabled. Bear's doc seems to suggest scan-build will work if LD_PRELOAD and DYLD_INSERT_LIBRARIES, but autotools don't override them do they? The logs make prints out don't seem to show these envvars being used, what else could go wrong?

rizsotto commented 6 years ago

Thanks for the report. The new OSX has statically linked make, which does not work with the dynamic linker. (Prove me with file $(which make).) And yes, SIP might be another issue. As a workaround I would suggest to use build tools (make, cc and ld) installed from brew. (The SIP policies are not enforced to these binaries. And these tools won't be statically linked either.) Please reopen this ticket if it's not helping.