From 38a8aecfb882072900434499696b5c32a2274515 Mon Sep 17 00:00:00 2001 From: Rong Xu Date: Mon, 21 Jul 2014 16:47:22 -0700 Subject: [4.9] Switch gcc-4.9 to use google/gcc-4_9 branch. This source drop uses svn version r212828 of google/gcc-4.9 branch. We also cherry-picked r213062, r213063 and r213064 to fix windows build issues. All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9. The following prior commits has not been merged to google branch yet. (They are included in this commit). e7af147f979e657fe2df00808e5b4319b0e088c6, baf87df3cb2683649ba7e9872362a7e721117c23, and c231900e5dcc14d8296bd9f62b45997a49d4d5e7. Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b --- gcc-4.9/ltmain.sh | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'gcc-4.9/ltmain.sh') diff --git a/gcc-4.9/ltmain.sh b/gcc-4.9/ltmain.sh index 9503ec85d..b68ae1c1f 100644 --- a/gcc-4.9/ltmain.sh +++ b/gcc-4.9/ltmain.sh @@ -1280,6 +1280,8 @@ func_mode_compile () $opt_debug # Get the compilation command and the source file. base_compile= + shared_compile= + static_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= @@ -1303,6 +1305,20 @@ func_mode_compile () continue ;; + xcompiler-shared ) + arg_mode=normal + func_quote_for_eval "$arg" + shared_compile="$shared_compile $func_quote_for_eval_result" + continue + ;; + + xcompiler-static ) + arg_mode=normal + func_quote_for_eval "$arg" + static_compile="$static_compile $func_quote_for_eval_result" + continue + ;; + normal ) # Accept any command-line options. case $arg in @@ -1333,6 +1349,18 @@ func_mode_compile () continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. + -Xcompiler-shared) + arg_mode=xcompiler-shared # the next one goes into the + # "shared_compile" arg list + continue + ;; + + -Xcompiler-static) + arg_mode=xcompiler-static # the next one goes into the + # "static_compile" arg list + continue + ;; + -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result @@ -1516,10 +1544,10 @@ compiler." fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" + command="$base_compile $qsrcfile $pic_flag $shared_compile" else # Don't build PIC code - command="$base_compile $qsrcfile" + command="$base_compile $qsrcfile $shared_compile" fi func_mkdir_p "$xdir$objdir" @@ -1568,9 +1596,9 @@ compiler." if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" + command="$base_compile $qsrcfile$pie_flag $static_compile" else - command="$base_compile $qsrcfile $pic_flag" + command="$base_compile $qsrcfile $pic_flag $static_compile" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" @@ -1664,6 +1692,12 @@ This mode accepts the following additional options: -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler + -Xcompiler-shared FLAG + pass FLAG directly to the compiler when compiling shared + libraries + -Xcompiler-static FLAG + pass FLAG directly to the compiler when compiling static + libraries COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -2932,7 +2966,7 @@ func_extract_archives () func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" -- cgit v1.2.3