guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 741f6b529e2c2fbaf61f48dd821cc0903700d591
Author: Efraim Flashner <[email protected]>
AuthorDate: Thu Aug 21 23:46:45 2025 +0300
gnu: go-1.17: Always build with gcc:lib.
* gnu/packages/golang.scm (go-1.17)[inputs]: Rewrite to not inherit from
go-1.4 and to always use gcc:lib.
[arguments]: Add the phase 'patch-gcc:lib unconditionally.
(go-1.18)[arguments]: Replace the inherited 'patch-gcc:lib phase on all
architectures.
Change-Id: I9024db846fef304b76441fe8b816740a60653d0e
Signed-off-by: Sharlatan Hellseher <[email protected]>
---
gnu/packages/golang.scm | 92 +++++++++++++++++++++++--------------------------
1 file changed, 43 insertions(+), 49 deletions(-)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 56e6ddea1e..01c9a680d8 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -563,30 +563,26 @@ in the style of communicating sequential processes
(@dfn{CSP}).")
(string-append net-base "/etc/services")))
(substitute* "src/time/zoneinfo_unix.go"
(("/usr/share/zoneinfo/") tzdata-path)))))
- ;; Keep this synchronized with the package inputs.
- ;; Also keep syncthonized with later versions of go.
- ,@(if (or (target-arm?) (target-ppc64le?))
- '((add-after 'unpack '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 = setextld\\(ldflags, compiler\\)")
- (string-append
- "ldflags = setextld(ldflags, compiler)\n"
- "ldflags = append(ldflags, \"-r\")\n"
- "ldflags = append(ldflags, \"" gcclib "\")\n")))))))
- '())
+ (add-after 'unpack '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 = setextld\\(ldflags, compiler\\)")
+ (string-append
+ "ldflags = setextld(ldflags, compiler)\n"
+ "ldflags = append(ldflags, \"-r\")\n"
+ "ldflags = append(ldflags, \"" gcclib "\")\n"))))))
;; Backported from later versions of go to workaround 64k page sizes.
,@(if (target-ppc64le?)
'((add-after 'unpack 'adjust-test-suite
@@ -706,9 +702,9 @@ in the style of communicating sequential processes
(@dfn{CSP}).")
'("AUTHORS" "CONTRIBUTORS" "CONTRIBUTING.md" "PATENTS"
"README.md" "SECURITY.md"))))))))
(inputs
- (if (member (%current-system) (package-supported-systems go-1.4))
- (package-inputs go-1.4)
- (alist-delete "gcc:lib" (package-inputs go-1.4))))
+ `(("tzdata" ,tzdata)
+ ("pcre" ,pcre)
+ ("gcc:lib" ,gcc "lib")))
(native-inputs
`(,@(if (member (%current-system) (package-supported-systems go-1.4))
`(("go" ,go-1.4))
@@ -755,28 +751,26 @@ in the style of communicating sequential processes
(@dfn{CSP}).")
((#: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")))))))
- '())))))
+ (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"))))))))))
(properties
`((compiler-cpu-architectures
("armhf" ,@%go-1.17-arm-micro-architectures)