guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/05: gnu: ld-wrapper: Ignore the .so argument following '-dynamic-link


From: Ludovic Courtès
Subject: 03/05: gnu: ld-wrapper: Ignore the .so argument following '-dynamic-linker'.
Date: Tue, 21 Apr 2015 21:23:59 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit 4a2b74bf4ce6780bb284bbcc63d3548233b09ee6
Author: Ludovic Courtès <address@hidden>
Date:   Tue Apr 21 21:14:28 2015 +0200

    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".
---
 gnu/packages/ld-wrapper.in |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in
index ed2a51e..db662e7 100644
--- a/gnu/packages/ld-wrapper.in
+++ b/gnu/packages/ld-wrapper.in
@@ -140,34 +140,45 @@ exec @GUILE@ -c "(load-compiled \"@address@hidden") 
(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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]