How to run lit tests on Mac OSX without gcc?

Thomas Mader via digitalmars-d-ldc digitalmars-d-ldc at
Sat Aug 26 15:31:17 PDT 2017

On Saturday, 26 August 2017 at 16:49:02 UTC, David Nadlinger 
> You shouldn't need the "real" gcc on OS X – in fact I'd 
> discourage using it for a package distributed to other people, 
> as it might come with unexpected compatibility issues.
> I've (re)installed quite a few macOS machines with developer 
> tools over the last couple of years, and every time, both 
> /usr/bin/cc and /usr/bin/gcc ended up pointing to a Clang 
> wrapper. You might want to track down what's going wrong.

You are right and I probably wouldn't be able to get that merged 
into upstream this way too.

The thing with Nix is that every dependency need to be fixed at 
build time and can't change anymore.
I was able to find the code where the path to gcc is searched for 
linking and I just replaced "gcc" with "clang" in driver/tool.cpp.
Since the CC environment flag is properly set by nix with the 
full path to clang, it can be found and no gcc is needed at all.

I wonder though why there is a special case for FreeBSD in there 
with clang but not for Mac OSX.

More information about the digitalmars-d-ldc mailing list