diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2023-04-05 15:36:21 +0300 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-04-14 15:12:12 -0400 |
commit | 8a17609dd02ff1d54bb32a158cead6bcba06a145 (patch) | |
tree | df00025d7107abdc35363ee3d172f93041563f3c /gnu/packages/golang.scm | |
parent | 4e9c9a63cc6e51b9755dbe2845bdb6fb8d3abce0 (diff) | |
download | guix-8a17609dd02ff1d54bb32a158cead6bcba06a145.tar.gz |
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/golang.scm')
-rw-r--r-- | gnu/packages/golang.scm | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 24dae34e20..2b75730dcd 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -864,29 +864,27 @@ in the style of communicating sequential processes (@dfn{CSP}).") (substitute-keyword-arguments (package-arguments go-1.17) ((#:phases phases) `(modify-phases ,phases - (delete 'adjust-test-suite) - ,@(if (or (target-arm?) (target-ppc64le?)) - '((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"))))))) - '()))))))) + ;; 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 |