<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 6 March 2017 at 02:48, Sergio Schvezov <span dir="ltr"><<a href="mailto:sergio.schvezov@canonical.com" target="_blank">sergio.schvezov@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On Tue, Feb 28, 2017 at 6:11 PM, Michael Hudson-Doyle <span dir="ltr"><<a href="mailto:michael.hudson@canonical.com" target="_blank">michael.hudson@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>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 BasePlugin.run() with some shell code that sets LDFLAGS.</div><div><br></div><div>Unfortunately, for the go classic snap the underlying tool does not care at all about LDFLAGS. What I do is create a wrapper:</div><div><br></div><div>#!/bin/sh</div><div>exec gcc $LDFLAGS "$@"</div><div><br></div><div>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?</div></div></blockquote><br></span>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?<br><br></div><div class="gmail_quote">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).<br></div></div></div>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">My snap uses a custom plugin to build, so by "my snap's plugin" I meanĀ <a href="https://git.launchpad.net/~mwhudson/+git/gosnap/tree/snap/plugins/x_gobuild.py?h=go1.8">https://git.launchpad.net/~mwhudson/+git/gosnap/tree/snap/plugins/x_gobuild.py?h=go1.8</a>. In that code, I want to access the flags that need to be passed to the linker to make classic snaps link against the core snap rather than the usual path (-Wl,-z,nodefib, -Wl,-rpath,xxx, etc). Currently, as I read things, it can't (well not without very silly hacks).</div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">mwh</div></div>