Skip to content

Conversation

ssaakaash
Copy link

Problem

The webrtc-sys build script was using Command::new("clang") to discover compiler library paths. On a system with Homebrew's llvm package installed, this command could resolve to /usr/local/bin/clang instead of the required Xcode toolchain compiler.

This caused the script to pass incorrect library search paths to the linker, resulting in errors like:

ld: warning: search path '/usr/local/lib/clang/22/lib/darwin' not found
ld: library 'clang_rt.osx' not found

Solution

The fix is to change Command::new("clang") to Command::new("cc") within the configure_darwin_sysroot function in build.rs.

On macOS, cc is the system's default compiler alias and is guaranteed to respect the toolchain set by xcode-select. This ensures that even if other versions of clang are in the PATH, the build script will always get the correct search paths from the active Xcode toolchain.

This makes the build process more robust and resilient to variations in the user's local environment.

@CLAassistant
Copy link

CLAassistant commented Aug 31, 2025

CLA assistant check
All committers have signed the CLA.

@davidzhao
Copy link
Member

it would appear this change would break the build script, could you take a look?

@ssaakaash
Copy link
Author

Don't know why the tests failed in the workflow, it doesn't break the current build script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants