[PATCH] D9600: Add scan-build python implementation

Laszlo Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 5 08:49:28 PST 2016


rizsotto.mailinglist added a comment.

sorry for the delay, hard to get free time these days. ;)


================
Comment at: tools/scan-build-py/libscanbuild/intercept.py:146
@@ +145,3 @@
+        })
+    elif sys.platform == 'darwin':
+        logging.debug('intercept gonna preload libear on OSX')
----------------
dcoughlin wrote:
> Can you change this to default to compiler-wrapper interposition on Darwin with a command-line flag to force library-based interposition?
> 
> Library-based interposition will fail silently if SIP is enabled, so this should be detected when that flag is passed so the user is informed. You can detect whether SIP is enabled on Darwin by checking whether (1) there is a binary called 'csrutil' in the path and, if so, (2) whether the output of executing 'csrutil status' contains 'System Integrity Protection status: enabled'.
> 
> 
ok, implemented the SIP check. (also added SELinux check, which behaves the same as SIP.)

about the default behavior: `scan-build` command has the other compiler-wrapper (run compiler & analyzer) and flags can turn this module on. `intercept-build` default is the library-based and flag can turn the compiler-wrapper interposition on... i would keep it this way. (and also not make platform dependent switches into the code.)


http://reviews.llvm.org/D9600





More information about the cfe-commits mailing list