summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-21 21:14:28 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-21 21:14:28 +0200
commit4a2b74bf4ce6780bb284bbcc63d3548233b09ee6 (patch)
tree47bc12668bbe977abc82a882a36e6f5b476e8828
parent4267c637d63ac7c48fe8206623ca976fc0dd742a (diff)
downloadpatches-4a2b74bf4ce6780bb284bbcc63d3548233b09ee6.tar
patches-4a2b74bf4ce6780bb284bbcc63d3548233b09ee6.tar.gz
gnu: ld-wrapper: Ignore the .so argument following '-dynamic-linker'.
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".
-rw-r--r--gnu/packages/ld-wrapper.in39
1 files changed, 25 insertions, 14 deletions
diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in
index ed2a51ea67..db662e7d76 100644
--- a/gnu/packages/ld-wrapper.in
+++ b/gnu/packages/ld-wrapper.in
@@ -140,34 +140,45 @@ exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line))
(define (library-files-linked args)
;; Return the file names of shared libraries explicitly linked against via
;; `-l' or with an absolute file name in ARGS.
- (define path+files
+ (define path+files+args
(fold (lambda (argument result)
(match result
- ((library-path . library-files)
+ ((library-path library-files ("-dynamic-linker" . rest))
+ ;; When passed '-dynamic-linker ld.so', ignore 'ld.so'.
+ ;; See <http://bugs.gnu.org/20102>.
+ (list library-path
+ library-files
+ (cons* argument "-dynamic-linker" rest)))
+ ((library-path library-files previous-args)
(cond ((string-prefix? "-L" argument) ;augment the search path
- (cons (append library-path
+ (list (append library-path
(list (string-drop argument 2)))
- library-files))
+ library-files
+ (cons argument previous-args)))
((string-prefix? "-l" argument) ;add library
(let* ((lib (string-append "lib"
(string-drop argument 2)
".so"))
(full (search-path library-path lib)))
- (if full
- (cons library-path
- (cons full library-files))
- result)))
+ (list library-path
+ (if full
+ (cons full library-files)
+ library-files)
+ (cons argument previous-args))))
((and (string-prefix? %store-directory argument)
(shared-library? argument)) ;add library
- (cons library-path
- (cons argument library-files)))
+ (list library-path
+ (cons argument library-files)
+ (cons argument previous-args)))
(else
- result)))))
- (cons '() '())
+ (list library-path
+ library-files
+ (cons argument previous-args)))))))
+ (list '() '() '())
args))
- (match path+files
- ((path . files)
+ (match path+files+args
+ ((path files arguments)
(reverse files))))
(define (rpath-arguments library-files)