Skip to content

Conversation

@obiwac
Copy link

@obiwac obiwac commented Jan 16, 2025

Previously, when using compiler wrappers (--override-compiler, as is default on macOS with SIP on), CC/CXX were set to just intercept-cc/c++, which are installed to libexec (so a priori not in PATH).

This PR mirrors what's done in analyze-build, and sets those to explicit paths to intercept-cc/c++.

@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 16, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 16, 2025

@llvm/pr-subscribers-clang

Author: Aymeric Wibo (obiwac)

Changes

Previously, when using compiler wrappers (--override-compiler, as is default on macOS with SIP on), CC/CXX were set to just intercept-cc/c++, which are installed to libexec (so a priori not in PATH).

This PR mirrors what's done in analyze-build, and sets those to explicit paths to intercept-cc/c++.


Full diff: https://github.com/llvm/llvm-project/pull/123252.diff

1 Files Affected:

  • (modified) clang/tools/scan-build-py/lib/libscanbuild/intercept.py (+5-2)
diff --git a/clang/tools/scan-build-py/lib/libscanbuild/intercept.py b/clang/tools/scan-build-py/lib/libscanbuild/intercept.py
index 59789f6001f4f7..95efb75a57fe01 100644
--- a/clang/tools/scan-build-py/lib/libscanbuild/intercept.py
+++ b/clang/tools/scan-build-py/lib/libscanbuild/intercept.py
@@ -46,8 +46,11 @@
 RS = chr(0x1E)
 US = chr(0x1F)
 
-COMPILER_WRAPPER_CC = "intercept-cc"
-COMPILER_WRAPPER_CXX = "intercept-c++"
+scanbuild_dir = os.path.dirname(os.path.realpath(__import__("sys").argv[0]))
+
+COMPILER_WRAPPER_CC = os.path.join(scanbuild_dir, "..", "libexec", "intercept-cc")
+COMPILER_WRAPPER_CXX = os.path.join(scanbuild_dir, "..", "libexec", "intercept-c++")
+
 TRACE_FILE_EXTENSION = ".cmd"  # same as in ear.c
 WRAPPER_ONLY_PLATFORMS = frozenset({"win32", "cygwin"})
 

@obiwac
Copy link
Author

obiwac commented Jan 16, 2025

@rizsotto

@rizsotto
Copy link

@obiwac LGTM!

@obiwac
Copy link
Author

obiwac commented Jan 25, 2025

Ping

4 similar comments
@obiwac
Copy link
Author

obiwac commented Feb 3, 2025

Ping

@obiwac
Copy link
Author

obiwac commented Feb 12, 2025

Ping

@obiwac
Copy link
Author

obiwac commented Mar 22, 2025

Ping

@obiwac
Copy link
Author

obiwac commented Jun 20, 2025

Ping

@obiwac
Copy link
Author

obiwac commented Aug 6, 2025

Ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants