guix-commits
[Top][All Lists]
Advanced

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

76/244: gnu: go-1.18: Adjust patch-gcclib phase.


From: guix-commits
Subject: 76/244: gnu: go-1.18: Adjust patch-gcclib phase.
Date: Wed, 12 Apr 2023 08:47:23 -0400 (EDT)

apteryx pushed a commit to branch staging
in repository guix.

commit df973437758e52c148a677a8afbe120ab1c7ed1d
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Apr 5 15:36:21 2023 +0300

    gnu: go-1.18: Adjust patch-gcclib phase.
    
    * gnu/packages/golang.scm (go-1.18)[arguments]: Adjust the custom
    'patch-gcc:lib phase for changes in the source code.
---
 gnu/packages/golang.scm | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 261f61f7b8..31022eb1d5 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -851,7 +851,32 @@ in the style of communicating sequential processes 
(@dfn{CSP}).")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0ph3ajfq5q8j3nd91pfb25pm21aiphc58zf7fwis0h3a6nqbdyq9"))))))
+         "0ph3ajfq5q8j3nd91pfb25pm21aiphc58zf7fwis0h3a6nqbdyq9"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments go-1.17)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           ;; See the platforms using this phase in go-1.17.
+           (replace 'patch-gcc:lib
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") 
"/lib")))
+                 ;; Add libgcc to runpath
+                 (substitute* "src/cmd/link/internal/ld/lib.go"
+                   (("!rpath.set") "true"))
+                 (substitute* "src/cmd/go/internal/work/gccgo.go"
+                   (("cgoldflags := \\[\\]string\\{\\}")
+                    (string-append "cgoldflags := []string{"
+                                   "\"-Wl,-rpath=" gcclib "\""
+                                   "}"))
+                   (("\"-lgcc_s\", ")
+                    (string-append
+                     "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
+                 (substitute* "src/cmd/go/internal/work/gc.go"
+                   (("ldflags, err := setextld\\(ldflags, compiler\\)")
+                    (string-append
+                     "ldflags, err := setextld(ldflags, compiler)\n"
+                     "ldflags = append(ldflags, \"-r\")\n"
+                     "ldflags = append(ldflags, \"" gcclib "\")\n"))))))))))))
 
 (define-public go-1.19
   (package



reply via email to

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