diff --git a/ChangeLog b/ChangeLog
index 687b3ba2008d2847425f56f9ebb74ceac3ac8dcf..b2dd44b563c5fe7a99982a160166a316b552d2d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-02-04  Geoffrey Keating  <geoffk@apple.com>
+
+	Merge from upstream:
+
+	* ltmain.in: When setting IFS to '~', be careful about user
+	arguments that contain '~'.
+
+	2004-02-04  Peter O'Gorman  <peter@pogma.com>
+
+	* ltmain.in (infer_tag): Move tag inferrence to a shell function.
+	Also test $base_compile against $CC with escaped arguments. Bug
+	reported by Geoff Keating <geoffk@apple.com>.
+
 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
 
 	* MAINTAINERS: Remove i960 port.
diff --git a/ltmain.sh b/ltmain.sh
index 5ccf95c7d1d6bd7d4673e2dd8fd183c2aa0ba1dd..c1ef9974d0e8e0a1c866e6a6bdeb615b9ec6ec50 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -2106,9 +2106,10 @@ EOF
 	    else
 	      $show "extracting exported symbol list from \`$soname'"
 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
-	      eval cmds=\"$extract_expsyms_cmds\"
+	      cmds=$extract_expsyms_cmds
 	      for cmd in $cmds; do
 		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
 		$show "$cmd"
 		$run eval "$cmd" || exit $?
 	      done
@@ -2119,9 +2120,10 @@ EOF
 	    if test -f "$output_objdir/$newlib"; then :; else
 	      $show "generating import library for \`$soname'"
 	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
-	      eval cmds=\"$old_archive_from_expsyms_cmds\"
+	      cmds=$old_archive_from_expsyms_cmds
 	      for cmd in $cmds; do
 		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
 		$show "$cmd"
 		$run eval "$cmd" || exit $?
 	      done
@@ -3249,11 +3251,13 @@ EOF
 
 	# Do each of the archive commands.
 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	  eval cmds=\"$archive_expsym_cmds\"
+	  eval test_cmds=\"$archive_expsym_cmds\"
+	  cmds=$archive_expsym_cmds
 	else
-	  eval cmds=\"$archive_cmds\"
+	  eval test_cmds=\"$archive_cmds\"
+	  cmds=$archive_cmds
 	fi
-        if len=`expr "X$cmds" : ".*"` &&
+        if len=`expr "X$test_cmds" : ".*"` &&
            test $len -le $max_cmd_len; then
           :
         else
@@ -3329,6 +3333,7 @@ EOF
           IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
           for cmd in $concat_cmds; do
             IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
             $show "$cmd"
             $run eval "$cmd" || exit $?
           done
@@ -3346,9 +3351,9 @@ EOF
 
 	  # Do each of the archive commands.
           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-            eval cmds=\"$archive_expsym_cmds\"
-          else
-            eval cmds=\"$archive_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    cmds=$archive_cmds
           fi
 
 	  # Append the command to remove the reloadable object files
@@ -3358,6 +3363,7 @@ EOF
         IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
         for cmd in $cmds; do
           IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
           $show "$cmd"
           $run eval "$cmd" || exit $?
         done