Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66441 - in trunk/tools/build/v2: . engine/src engine/src/modules tools
From: admin_at_[hidden]
Date: 2010-11-07 14:51:11


Author: wash
Date: 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
New Revision: 66441
URL: http://svn.boost.org/trac/boost/changeset/66441

Log:
Spoke to volodya about this; these changes add support for bootstrapping the
Boost.Build system with clang. I also fixed a few things in the clang-linux
toolchain;

  - Clang doesn't support -pg.
  - Adding -O0 to turn optimization off is silly, because it is set to zero by
    default if omitted on the command line. The compiler will whine about
    unused options if you later add another -O flag. The Boost.Build UTF
    interface adds a second -O0, so you end up with two redundant command line
    options and a warning from bjam/clang for every invocation of the compiler
    when using the test framework.

Text files modified:
   trunk/tools/build/v2/bootstrap.sh | 14 +++++++++++++-
   trunk/tools/build/v2/engine/src/build.jam | 8 ++++++++
   trunk/tools/build/v2/engine/src/build.sh | 5 +++++
   trunk/tools/build/v2/engine/src/modules/order.c | 4 ++--
   trunk/tools/build/v2/tools/clang-linux.jam | 4 ++--
   5 files changed, 30 insertions(+), 5 deletions(-)

Modified: trunk/tools/build/v2/bootstrap.sh
==============================================================================
--- trunk/tools/build/v2/bootstrap.sh (original)
+++ trunk/tools/build/v2/bootstrap.sh 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
@@ -1,6 +1,7 @@
 #!/bin/sh
 # Copyright (C) 2005, 2006 Douglas Gregor.
 # Copyright (C) 2006 The Trustees of Indiana University
+# Copyright (C) 2010 Bryce Lelbach
 #
 # Distributed under the Boost Software License, Version 1.0.
 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
@@ -68,6 +69,10 @@
     TOOLSET=gcc
     ;;
     
+ clang* )
+ TOOLSET=clang
+ ;;
+
     sun* )
     TOOLSET=sun
     ;;
@@ -78,6 +83,13 @@
   esac
 fi
 
+case $TOOLSET in
+ clang*)
+ TOOLSET=clang
+ ;;
+esac
+
+
 rm -f config.log
 
 # Build bjam
@@ -104,4 +116,4 @@
 
     ./bjam install --prefix=<DIR>
 
-EOF
\ No newline at end of file
+EOF

Modified: trunk/tools/build/v2/engine/src/build.jam
==============================================================================
--- trunk/tools/build/v2/engine/src/build.jam (original)
+++ trunk/tools/build/v2/engine/src/build.jam 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
@@ -193,6 +193,14 @@
     [ opt --debug : --no_inlining ]
     -I$(--python-include) -I$(--extra-include)
     : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
+## Clang Linux 2.8+
+toolset clang clang : "-o " : -D
+ : -Wno-unused -Wno-format
+ [ opt --release : -Os ]
+ [ opt --debug : -g -O0 -fno-inline ]
+ [ opt --profile : -finline-functions -g ]
+ -I$(--python-include) -I$(--extra-include)
+ : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
 ## MacOSX Darwin, using GCC 2.9.x, 3.x
 toolset darwin cc : "-o " : -D
     :

Modified: trunk/tools/build/v2/engine/src/build.sh
==============================================================================
--- trunk/tools/build/v2/engine/src/build.sh (original)
+++ trunk/tools/build/v2/engine/src/build.sh 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
@@ -208,6 +208,11 @@
     BOOST_JAM_CC=cc
     ;;
 
+ clang*)
+ BOOST_JAM_CC="clang -Wno-unused -Wno-format"
+ BOOST_JAM_TOOLSET=clang
+ ;;
+
     tru64cxx)
     BOOST_JAM_CC=cc
     ;;

Modified: trunk/tools/build/v2/engine/src/modules/order.c
==============================================================================
--- trunk/tools/build/v2/engine/src/modules/order.c (original)
+++ trunk/tools/build/v2/engine/src/modules/order.c 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
@@ -50,8 +50,8 @@
 
         if (colors[adjacent_vertex] == white)
             do_ts(graph, adjacent_vertex, colors, result_ptr);
- else if (colors[adjacent_vertex] == gray)
- ; /* This is loop. Not sure what to do... */
+ //else if (colors[adjacent_vertex] == gray)
+ //; /* This is loop. Not sure what to do... */
     }
     colors[current_vertex] = black;
     **result_ptr = current_vertex;

Modified: trunk/tools/build/v2/tools/clang-linux.jam
==============================================================================
--- trunk/tools/build/v2/tools/clang-linux.jam (original)
+++ trunk/tools/build/v2/tools/clang-linux.jam 2010-11-07 14:51:05 EST (Sun, 07 Nov 2010)
@@ -71,7 +71,7 @@
 SPACE = " " ;
 
 # Declare flags and action for compilation.
-toolset.flags clang-linux.compile OPTIONS <optimization>off : -O0 ;
+toolset.flags clang-linux.compile OPTIONS <optimization>off : ;
 toolset.flags clang-linux.compile OPTIONS <optimization>speed : -O3 ;
 toolset.flags clang-linux.compile OPTIONS <optimization>space : -Os ;
 
@@ -85,7 +85,7 @@
 toolset.flags clang-linux.compile OPTIONS <warnings-as-errors>on : -Werror ;
 
 toolset.flags clang-linux.compile OPTIONS <debug-symbols>on : -g ;
-toolset.flags clang-linux.compile OPTIONS <profiling>on : -pg ;
+toolset.flags clang-linux.compile OPTIONS <profiling>on : ;
 toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
 
 rule compile.c++ ( targets * : sources * : properties * )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk