From owner-freebsd-questions@FreeBSD.ORG Mon Jun 18 15:35:06 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6842106566C for ; Mon, 18 Jun 2012 15:35:06 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id 96ABD8FC12 for ; Mon, 18 Jun 2012 15:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Cc:Date:References:Subject:To:Content-Type; bh=WUZjQX7v0Thx+VMKwav+PW4W4VLsp/HnCmcCqkkASqo=; b=Lz2FNlnfk0mui+svNTn9mbIU/J/GPNbHbuCZL36/pIVvn4oxAj4nvRZeeiipvgeNS4AqQdzxu233Ytlfr1tHvEPTxtMFMgTTtdCDzrqxCd3bAT55CVNsLaTX05ByCchU; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Sgdym-000Obu-CL; Mon, 18 Jun 2012 10:35:05 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1340033693-94480-94479/5/2; Mon, 18 Jun 2012 15:34:53 +0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-questions@freebsd.org References: <4FCF9333.70201@speakeasy.org> <4FCF9C07.2000607@FreeBSD.org> Date: Mon, 18 Jun 2012 10:34:53 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: User-Agent: Opera Mail/12.00 (FreeBSD) X-SA-Score: -1.5 Cc: Wojciech Puchar Subject: Re: Why Clang X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 15:35:06 -0000 On Sun, 17 Jun 2012 15:13:05 -0500, Wojciech Puchar wrote: >> >> Clang is consistently faster at compiling than GCC and it is very clean >> and modular -- not bloated. > > -r-xr-xr-x 3 root wheel 37025016 12 cze 21:46 /usr/bin/clang > > well.. > # ls -la /usr/local/bin/clang -rwxr-xr-x 1 root wheel 14360344 Jun 18 09:57 /usr/local/bin/clang # ls -la /usr/bin/clang -r-xr-xr-x 3 root wheel 32578976 Jun 18 09:12 /usr/bin/clang Looks like FreeBSD's current base build includes debugging/symbols even in -RELEASE. I'm sure there's a reason for this. # ls -la /usr/bin/g++ -r-xr-xr-x 3 root wheel 199208 May 22 14:26 /usr/bin/g++ # ls -la /usr/bin/clang++ -r-xr-xr-x 3 root wheel 32578976 Jun 18 09:12 /usr/bin/clang++ # ls -la /usr/local/bin/clang++ lrwxr-xr-x 1 root wheel 5 Jun 18 09:57 /usr/local/bin/clang++ -> clang FreeBSD and Ports installation method of CLANG differs further here # stat -x /usr/bin/clang File: "/usr/bin/clang" Size: 32578976 FileType: Regular File Mode: (0555/-r-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) Device: 85,3144417526 Inode: 23483 Links: 3 Access: Tue May 22 14:27:20 2012 Modify: Mon Jun 18 09:12:53 2012 Change: Mon Jun 18 09:12:53 2012 # stat -x /usr/bin/clang++ File: "/usr/bin/clang++" Size: 32578976 FileType: Regular File Mode: (0555/-r-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/ wheel) Device: 85,3144417526 Inode: 23483 Links: 3 Access: Tue May 22 14:27:20 2012 Modify: Mon Jun 18 09:12:53 2012 Change: Mon Jun 18 09:12:53 2012 Yup, so Ports symlinks (without full path -- this should be fixed) and FreeBSD BASE uses a hardlink. # ldd /usr/local/bin/clang /usr/local/bin/clang: libLLVM-3.0.so => /usr/local/lib/libLLVM-3.0.so (0x80155e000) libthr.so.3 => /lib/libthr.so.3 (0x802ea0000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x8030c3000) libm.so.5 => /lib/libm.so.5 (0x8033d3000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8035f4000) libc.so.7 => /lib/libc.so.7 (0x803801000) # ldd /usr/bin/clang /usr/bin/clang: libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x80269e000) libm.so.5 => /lib/libm.so.5 (0x8029ae000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x802bcf000) libc.so.7 => /lib/libc.so.7 (0x802ddc000) # ls -la /usr/local/lib/libLLVM-3.0.so -rwxr-xr-x 1 root wheel 27543632 Jun 18 09:53 /usr/local/lib/libLLVM-3.0.so # ls -la /lib/libthr.so.3 -r--r--r-- 1 root wheel 101712 May 22 14:26 /lib/libthr.so.3 So from what I can tell LLVM is the monster here, not Clang (which is also of significant size, but it's 2012 so Clang isn't *that* big) None of this seems very relevant, but here's also lines of code via sloccount: # sloccount clang-3.0.src/ Totals grouped by language (dominant language first): cpp: 390865 (82.34%) ansic: 50466 (10.63%) objc: 24970 (5.26%) python: 5874 (1.24%) perl: 1951 (0.41%) lisp: 379 (0.08%) pascal: 123 (0.03%) sh: 86 (0.02%) Total Physical Source Lines of Code (SLOC) = 474,714 # sloccount llvm-3.0.src/ Totals grouped by language (dominant language first): cpp: 468021 (75.80%) asm: 109345 (17.71%) ansic: 13782 (2.23%) sh: 12848 (2.08%) ml: 4716 (0.76%) python: 4351 (0.70%) perl: 2093 (0.34%) pascal: 1566 (0.25%) exp: 389 (0.06%) lisp: 187 (0.03%) csh: 117 (0.02%) Total Physical Source Lines of Code (SLOC) = 617,415 # sloccount gcc-4.2.1/ Totals grouped by language (dominant language first): ansic: 1306440 (43.95%) ada: 584415 (19.66%) java: 583316 (19.62%) cpp: 346603 (11.66%) asm: 37548 (1.26%) f90: 36055 (1.21%) sh: 30089 (1.01%) yacc: 15006 (0.50%) exp: 11218 (0.38%) fortran: 7139 (0.24%) objc: 6921 (0.23%) perl: 3038 (0.10%) pascal: 1194 (0.04%) cs: 879 (0.03%) lex: 857 (0.03%) awk: 732 (0.02%) python: 582 (0.02%) tcl: 271 (0.01%) haskell: 93 (0.00%) lisp: 59 (0.00%) Total Physical Source Lines of Code (SLOC) = 2,972,455 So GCC 4.2.1 is nearly 3 million lines of code, but CLANG+LLVM is sitting at 1.1 million lines of code. Are you sure CLANG is the bloated project?