summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-04-05 15:36:21 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-04-05 21:58:00 +0300
commitb22f284b251964b6443477528666954c0cf3b91f (patch)
treefe250ae803bbd1c0c7953e7742664990db9a51e3 /gnu/packages
parent6311493d7a6271bfbc51f4693857f9a12fe9965d (diff)
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.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/golang.scm27
1 files changed, 26 insertions, 1 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index daceaebb17..49b12a5e04 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