How to run lit tests on Mac OSX without gcc?

Jon Degenhardt via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat Aug 26 09:12:56 PDT 2017


On Saturday, 26 August 2017 at 15:54:30 UTC, Thomas Mader wrote:
> On Saturday, 26 August 2017 at 14:55:23 UTC, Johan Engelen 
> wrote:
>> This is strange; is it the only lit test that fails? Or do all 
>> lit tests fail that need to link?
>>
>> I am developing (almost exclusively) on Mac and the lit tests 
>> definitely work. LDC uses "gcc" for linking, also on Mac, 
>> where it forwards to clang (with minor tweak). This is not 
>> particular to the lit tests. Does "gcc" not work on your 
>> commandline?
>
> No there is no gcc available because I am trying to make a Nix 
> (https://nixos.org/nix/) package which is a pure and 
> deterministic approach to building packages.
> Because of that only the dependencies which are defined 
> explicitly are available for the build.
> In my case I haven't added gcc as an dependency because I 
> thought it would work without it.
>
> But if I understand you correctly than it isn't possible to 
> link without gcc because it's needed for the redirect and there 
> is no possibility for an override?

OS X with xcode installed normally has a 'gcc' command in usr/bin 
that points to clang. I have both clang and real gcc (via 
macports) installed on my system. The version is /usr/bin is 
clang. This allows build systems to refer to 'gcc'. Not sure what 
part of the xcode setup is involved, perhaps command line tools 
setup? On my system:

$ /usr/bin/gcc --version
Configured with: 
--prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


More information about the digitalmars-d-ldc mailing list