Index: scons-2.1.0/engine/SCons/Tool/link.py
===================================================================
--- scons-2.1.0.orig/engine/SCons/Tool/link.py
+++ scons-2.1.0/engine/SCons/Tool/link.py
@@ -74,8 +74,8 @@ def generate(env):
     SCons.Tool.createProgBuilder(env)
 
     env['SHLINK']      = '$LINK'
-    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
-    env['SHLINKCOM']   = '$SHLINK -o $TARGET $SHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+    env['SHLINKFLAGS'] = SCons.Util.CLVar('-shared')
+    env['SHLINKCOM']   = '$SHLINK $SHLINKFLAGS $LINKFLAGS  $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET'
     # don't set up the emitter, cause AppendUnique will generate a list
     # starting with None :-(
     env.Append(SHLIBEMITTER = [shlib_emitter])
@@ -83,7 +83,7 @@ def generate(env):
     env['LINK']        = "$SMARTLINK"
     env['LINKFLAGS']   = SCons.Util.CLVar('')
     # __RPATH is only set to something ($_RPATH typically) on platforms that support it.
-    env['LINKCOM']     = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+    env['LINKCOM']     = '$LINK $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET'
     env['LIBDIRPREFIX']='-L'
     env['LIBDIRSUFFIX']=''
     env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}'
@@ -106,7 +106,7 @@ def generate(env):
     env['LDMODULEPREFIX'] = '$SHLIBPREFIX' 
     env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' 
     env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
-    env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+    env['LDMODULECOM'] = '$LDMODULE $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET'
 
 
 
