getting $LDFLAGS for a classic snap build in the plugin

Sergio Schvezov sergio.schvezov at
Sun Mar 5 13:48:24 UTC 2017

On Tue, Feb 28, 2017 at 6:11 PM, Michael Hudson-Doyle <
michael.hudson at> wrote:

> Hi,
> The magic of classic confinement snaps is all in passing special flags
> when linking an executable. If I've read things right, snapcraft does this
> by wrapping any command you execute with with some shell
> code that sets LDFLAGS.
> Unfortunately, for the go classic snap the underlying tool does not care
> at all about LDFLAGS. What I do is create a wrapper:
> #!/bin/sh
> exec gcc $LDFLAGS "$@"
> and point the go tool at that. This works but it would be a lot cleaner if
> I could just get at the linker flags in my snap's plugin. Any chance that
> could be added?

Hi there, I am sort of confused by the wording here, can you expand a bit
on what you want. When you say "snap's plugin", what do you mean?

I fear I am being dull but I honestly don't understand the question and
given that it has gone unanswered for a couple of days maybe others are
having issues parsing this as well (or maybe discussed on IRC and already
taken care of).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Snapcraft mailing list