src
- Clang now the default on x86
2012年11月5日にFreeBSD 10-CURRENTのデフォルトコンパイラをGCCからLLVM Clangへ変更するという当初のアナウンス通り、
10-CURRENTのデフォルトコンパイラがLLVM Clangへ変更されました。amd64とi386のコンパイラが次のようにcc(1)、 c++(1)、 cpp(1)はclang(1)が実体へと置き換わっています。 # uname -v | cut -c 1-65 FreeBSD 10.
0-CURRENT #8 r242822: Fri Nov 9 21:56:12 JST 2012 # which cc c++ cpp /usr/ bin/ cc /usr/ bin/ c++ /usr/ bin/ cpp # cc --version FreeBSD clang version 3. 2 (trunk 162107) 20120817 Target: x86_ 64-unknown-freebsd10. 0 Thread model: posix # c++ --version FreeBSD clang version 3. 2 (trunk 162107) 20120817 Target: x86_ 64-unknown-freebsd10. 0 Thread model: posix # cpp --version FreeBSD clang version 3. 2 (trunk 162107) 20120817 Target: x86_ 64-unknown-freebsd10. 0 Thread model: posix # カーネルおよびユーザランドのビルドに使われるコンパイラがclang(1)へ変更されるほか、
Ports Collectionのビルドにも次のようにclang(1)が使われるようになります。 # cd /usr/
ports/ sysutils/ tree/ # make install clean ===> License GPLv2 accepted by the user ===> tree-1. 6.0 depends on file: /usr/ local/ sbin/ pkg - found ===> Extracting for tree-1. 6.0 ===> Patching for tree-1. 6.0 ===> Applying FreeBSD patches for tree-1. 6.0 ===> tree-1. 6.0 depends on executable: gmake - found ===> Configuring for tree-1. 6.0 ===> Building for tree-1. 6.0 cc -O2 -pipe -fno-strict-aliasing -c -o tree. o tree. c tree. c:481:62: warning: format specifies type 'long long' but the argument has type 'off_ t' (aka 'long') [-Wformat] if (duflag) fprintf(outfile," <size>%lld</size>\n", size); ~~~~ ^~~~ %ld tree. c:1107:87: warning: format specifies type 'long long' but the argument has type 'off_ t' (aka 'long') [-Wformat] ... sizeof(off_ t) == sizeof(long long)? " %11lld" : " %9ld", size); ~~~~~~ ^~~~ %11ld 2 warnings generated. cc -O2 -pipe -fno-strict-aliasing -c -o unix. o unix. c cc -O2 -pipe -fno-strict-aliasing -c -o html. o html. c cc -O2 -pipe -fno-strict-aliasing -c -o xml. o xml. c xml. c:301:49: warning: format specifies type 'long long' but the argument has type 'off_ t' (aka 'long') [-Wformat] if (sflag) fprintf(outfile, " size=\"%lld\"", ent->size); ~~~~ ^~~~~~~~~ %ld 1 warning generated. cc -O2 -pipe -fno-strict-aliasing -c -o hash. o hash. c cc -O2 -pipe -fno-strict-aliasing -c -o color. o color. c cc -O2 -pipe -fno-strict-aliasing -c -o strverscmp. o strverscmp. c cc -o tree tree. o unix. o html. o xml. o hash. o color. o strverscmp. o ===> Installing for tree-1. 6.0 ===> Generating temporary packing list install -s -o root -g wheel -m 555 tree /usr/ local/ bin install -o root -g wheel -m 444 doc/ tree. 1 /usr/ local/ man/ man1 install -o root -g wheel -m 444 /usr/ ports/ sysutils/ tree/ work/ tree-1. 6.0/ CHANGES /usr/ ports/ sysutils/ tree/ work/ tree-1. 6.0/ README /usr/ local/ share/ doc/ tree ===> Compressing manual pages for tree-1. 6.0 ===> Registering installation for tree-1. 6.0 Installing tree-1. 6.0... done ===> Cleaning for tree-1. 6.0 # clang(1)をデフォルトのコンパイラとして使用したくない場合には、
次の設定を/etc/ make. confや/etc/ src. confに適宜追加します。make. confはPorts Collectionおよびカーネル/ユーザランドにおけるビルドに、 src. confはカーネル/ユーザランドのビルド時に読み込まれます。 WITHOUT_
CLANG_ IS_ CC=YES amd64およびi386以外のコンパイラについては当面GCCがデフォルトとして使われます。切り替わったばかりで、
clang(1)が原因と見られるエラーの発生などが報告されています。clang(1)ではビルドできないソフトウェアがPorts Collectionにあるなど、 運用で利用する段階ではなく、 開発者が利用する段階にあります。 Ports Collectionではclang(1)でビルドできないソフトウェア向けにGCCでビルドするように切り替えるオプションを提供するなど回避策の提供をはじめています。