Add -lstdc++ to the link line for C++ programs.
authorReid Spencer <rspencer@reidspencer.com>
Sat, 11 Nov 2006 10:22:48 +0000 (10:22 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 11 Nov 2006 10:22:48 +0000 (10:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31678 91177308-0d34-0410-b5e6-96231b3b80d8

utils/findmisopt

index dc564849457394a25f3b434fe9c32801ab7a66c1..2f5745b0ea45084817fc5d90c8e9551d1952fb32 100755 (executable)
@@ -60,7 +60,7 @@ llvm-dis "$bcfile" -o "$ll" -f || exit 1
 
 # Generate the non-optimized program
 llc "$bcfile" -o "$s" -f || exit 1
-gcc "$s" -o "$prog" || exit 1
+gcc "$s" -o "$prog" -lstdc++ -lc -lm || exit 1
 
 # Define the list of optimizations to run
 all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge"
@@ -71,7 +71,7 @@ function tryit {
   opt $switches_to_use "$bcfile" -o "$optbc" -f || exit
   llvm-dis "$optbc" -o "$optll" -f || exit
   llc "$optbc" -o "$opts" -f || exit
-  gcc "$opts" -o "$optprog" || exit
+  gcc "$opts" -o "$optprog" -lstdc++ -lc -lm || exit
   "$prog" $args > "$out"
   ex1=$?
   "$optprog" $args > "$optout"