From: q66 <q66@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Merged]: build-style/go: allow usage with gccgo compiler
Date: Fri, 17 Apr 2020 04:53:15 +0200 [thread overview]
Message-ID: <20200417025315.CDrgATBy8cdsXfBM8kHryvxvqUTXxKaIT9cpKaWFXyY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20996@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]
There's a merged pull request on the void-packages repository
build-style/go: allow usage with gccgo compiler
https://github.com/void-linux/void-packages/pull/20996
Description:
This checks if `gcc-go-tools` have been specified in host deps and if so, use gccgo to build (`gcc-go-tools` conflicts with go).
Also, since gccgo is not a multi-compiler, we need to override `GCCGO` to get cross-builds. The gccgo for target is always installed, as it's a part of our cross-toolchains.
Basically, in summary, the behavior with this patch is:
1) Use `go` by default, always
2) If a template explicitly chooses to install `gcc-go-tools` in `hostmakedepends`, that indicates to the `build-style` that we're to build with gccgo (current behavior: conflicting packages will cause the build to fail)
Since `gcc-go-tools` provides the same regular `go` frontend as the main `go` package, the `build-style` will generally work OOTB, unchanged, and it respects `GOCACHE`, `GOARCH`, `GOOS` and so on. The only differences need to be:
1) No default `archs`; `gccgo` is available everywhere
2) No `nostrip`, since it's using a regular GNU toolchain with GCC backend, so it generates debug symbols same as usual
3) No `nopie`, as our `--enable-default-pie` for GCC applies here
4) The `GCCGO` variable needs to be set to point to the target's compiler, but otherwise `GOARCH` is still respected everywhere else, so it's handled outside the conditional block
## Usage
I have one place where I'd like to use this and that's `PopCorn`. It's a fairly trivial application and has been tested to work well under `gccgo` (I use it for stats reporting on big-endian architectures where the regular compiler doesn't exist and have been for months). To switch, we'd basically just do this:
```
--- a/srcpkgs/PopCorn/template
+++ b/srcpkgs/PopCorn/template
@@ -8,7 +8,7 @@ go_package="${go_import_path}/cmd/popcorn
${go_import_path}/cmd/popcornctl
${go_import_path}/cmd/statrepo
${go_import_path}/cmd/pqueryd"
-hostmakedepends="git"
+hostmakedepends="gcc-go-tools git"
depends="snooze"
short_desc="Package statistics system"
maintainer="Michael Aldridge <maldridge@voidlinux.org>"
```
With the `build-style` change, that just works.
prev parent reply other threads:[~2020-04-17 2:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 2:07 [PR PATCH] " q66
2020-04-15 2:16 ` the-maldridge
2020-04-15 2:17 ` the-maldridge
2020-04-15 2:21 ` q66
2020-04-15 2:21 ` q66
2020-04-15 7:58 ` travankor
2020-04-15 9:08 ` travankor
2020-04-15 14:27 ` q66
2020-04-15 18:26 ` [PR PATCH] [Updated] " q66
2020-04-15 18:27 ` q66
2020-04-15 18:27 ` q66
2020-04-15 21:17 ` travankor
2020-04-15 21:19 ` travankor
2020-04-15 21:41 ` q66
2020-04-15 22:14 ` travankor
2020-04-15 22:21 ` travankor
2020-04-15 22:36 ` q66
2020-04-16 14:41 ` Duncaen
2020-04-16 14:57 ` q66
2020-04-16 15:01 ` Duncaen
2020-04-16 15:02 ` Duncaen
2020-04-17 2:53 ` q66 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200417025315.CDrgATBy8cdsXfBM8kHryvxvqUTXxKaIT9cpKaWFXyY@z \
--to=q66@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).