All the waf compilers put LINKFLAGS at the very beginning of the command
before any source or object files, whereas they put LIB/LIBPATH at the very
end. It seems like the latter is the correct place to put them, as some
compilers fail when the link flags are at the beginning (e.g. see
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html). I'm not
that familiar with the details of linking so I wanted to ask here if
there's a reason for that before filing a bug report.
Here's the relevant line for e.g. the C compiler:
./Tools/c.py:17: run_str='${LINK_CC} ${LINKFLAGS} ${CCLNK_SRC_F}${SRC}
${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH}
${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH}
${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER}
${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB}'