Fixes <http://bugs.gnu.org/21941>.
* gnu/packages/ld-wrapper.in (library-search-path): New procedure.
(library-files-linked): Add 'library-path' parameter. Use it. Do not
thread it in 'fold'.
(ld-wrapper): Add call to 'library-search-path' and pass the result to
'library-files-linked'. When debugging, print the value of PATH.
Reported at <http://bugs.gnu.org/20102>.
* gnu/packages/ld-wrapper.in (library-files-linked): Rename 'path+files'
to 'path+files+args'. Thread the reverse list of previous arguments.
Add case for when the previous argument is "-dynamic-linker".