David,
I tested changes of the form...
+++ llvm34.info 2014-05-23 19:33:22.000000000 -0400
@@ -442,7 +442,9 @@
echo "######## START of BOOTSTRAP STAGE 2: building llvm/clang with stage
1 clang"
# reuse CC and CXX from stage 1.5
STAGE2_CMAKE_OPTIONS=( \
- -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -cxx-isystem
$libcxx_abs_srcdir/include" )
+ -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -cxx-isystem
$libcxx_abs_srcdir/include" \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="-O3 -DNDEBUG -fno-slp-vectorize" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -DNDEBUG -fno-slp-vectorize" )
STAGE2_LLVM_LDFLAGS=( "-L$libcxx_stage_dir" )
# if not bootstrapping libc++, use system C++ library (buried in XCode)
# if test "$darwin_vers" -ge 13
to reduce the optimizations used to generate the stage2 and stage3
compilers in llvm34 and this doesn't eliminate the unwanted stage4
bootstrap on 10.7 and 10.8. The following set of reduced optimization
levels have been tested on 10.8 against llvm34-3.4.1-0a and all still
result in a stage4 bootstrap…
-O3 -DNDEBUG -fno-slp-vectorize
-O3 -DNDEBUG -fno-vectorize
-O2 -DNDEBUG
-O1 -DNDEBUG
However I do see that on both 10.7 and 10.8, stage1 is built against
libstdc++ rather than libc++. The following change, which enforces the use
of the system libc++ in the stage1 bootstrap, eliminates the occurrence of
a stage4 bootstrap on both 10.7 and 10.8.
--- llvm34.info.orig 2014-05-23 17:40:20.000000000 -0400
+++ llvm34.info 2014-05-23 22:35:38.000000000 -0400
@@ -325,7 +325,7 @@
-DCMAKE_INSTALL_PREFIX:PATH=$fink_root/opt/llvm-$brv \
-DCMAKE_BUILD_TYPE:STRING=$build_type )
- STAGE1_CMAKE_OPTIONS=( -DCMAKE_C_FLAGS=-fno-common
-DCMAKE_CXX_FLAGS=-fno-common )
+ STAGE1_CMAKE_OPTIONS=( -DCMAKE_C_FLAGS=-fno-common
-DCMAKE_CXX_FLAGS="-fno-common -std=c++11 -stdlib=libc++" )
# trying to disable optimization flags on non-trustworthy compilers
# worked around in recompile_known_units(), and now using RelWithDebInfo
ccvers=`$CXX -v 2>&1 | tail -n 1 | cut -d\ -f3`
The fact that I have never seen a stage4 bootstrap occur on 10.9 (which has
always built stage1 as -std=c++11 -stdlib=libc++) argues that the current
mixing of libstdc++ in stage1 and libc++ later is at fault and the solution
is to stop doing that.
I would also note that even in Xcode 5.1.1 on 10.8, Apple is building
the system clang++ compiler against libc++ even though the compiler
defaults to -stdlib=libstdc++ for the 10.8 SDK behavior.
% otool -L
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
| grep "c++"
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
120.0.0)
So I would argue that the convention for building 3.4svn on darwin is to
use the libc++ shared library throughout the bootstrap process. In our
case, the main difference is that the final clang++ compiler is built and
linked against the libc++-3.5 of the llvm34 package rather than the system
libc++. Which is a good thing considering the age of the system libc++ in
10.8 and especially 10.7.
Jack
ps While I realize that this solution doesn't help you eliminate the stage4
bootstrap pre-10.7. it is the most sensible and direct fix for llvm34 in
the 10.7 tree. We just need to add a BuildDepends (xcode >= 4.6) to
llvm34.info in addition to the above change to STAGE1_CMAKE_OPTIONS.
Considering that llvm 3.5svn now requires a c++ shared library with c++-11
support (gcc 4.7 or later), we will have to switch to the -std=c++11
-stdlib=libc++ anyway for llvm35 in the 10.7 tree.
pps In the llvm34 info file for the 10.7 tree, you will also want to yank
out the hack supporting the stage4 bootstrap and properly emit a fatal
bootstrap error message if the stage2 and stage3 comparison fails.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel