ld-wrapper: Ignore .so files specified after "-plugin" for RUNPATH purposes.

Reported by Mark H Weaver
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20102#58>.

* gnu/packages/ld-wrapper.in (library-files-linked): Handle "-plugin"
  similarly to "-dynamic-linker".
This commit is contained in:
Ludovic Courtès 2015-06-14 01:00:27 +02:00
parent 16cae799db
commit b5616bc33d

View file

@ -143,12 +143,16 @@ exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line))
(define path+files+args (define path+files+args
(fold (lambda (argument result) (fold (lambda (argument result)
(match result (match result
((library-path library-files ("-dynamic-linker" . rest)) ((library-path library-files
;; When passed '-dynamic-linker ld.so', ignore 'ld.so'. ((and flag
;; See <http://bugs.gnu.org/20102>. (or "-dynamic-linker" "-plugin"))
. rest))
;; When passed '-dynamic-linker ld.so', ignore 'ld.so'; when
;; passed '-plugin liblto_plugin.so', ignore
;; 'liblto_plugin.so'. See <http://bugs.gnu.org/20102>.
(list library-path (list library-path
library-files library-files
(cons* argument "-dynamic-linker" rest))) (cons* argument flag rest)))
((library-path library-files previous-args) ((library-path library-files previous-args)
(cond ((string-prefix? "-L" argument) ;augment the search path (cond ((string-prefix? "-L" argument) ;augment the search path
(list (append library-path (list (append library-path