<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 29, 2016 at 8:02 AM Joseph Rushton Wakeling <<a href="mailto:joseph.wakeling@webdrake.net">joseph.wakeling@webdrake.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 28.08.2016 23:21, Joseph Rushton Wakeling wrote:<br>
> Just to make sure I don't head off in completely the wrong direction, is there a<br>
> straightforward (or at least, advisable) way to include gcc and the C standard<br>
> libraries in a snap, perhaps deriving from existing Ubuntu packages? I imagine<br>
> this doesn't have a ready solution yet, but just to make sure...<br>
<br>
OK, I discovered `stage-packages` ;-) This is turning into a little bit of a<br>
rabbit warren, but looks promising: including gcc and libc6 got me to the point<br>
where the complaints have moved from the availability of gcc to:<br>
<br>
/snap/ldc2/x1/usr/bin/ld: cannot find crt1.o: No such file or directory<br>
/snap/ldc2/x1/usr/bin/ld: cannot find crti.o: No such file or directory<br>
/snap/ldc2/x1/usr/bin/ld: cannot find -lrt<br>
/snap/ldc2/x1/usr/bin/ld: cannot find -ldl<br>
/snap/ldc2/x1/usr/bin/ld: cannot find -lpthread<br>
/snap/ldc2/x1/usr/bin/ld: cannot find -lm<br>
/snap/ldc2/x1/usr/bin/ld: cannot find -lc<br>
/snap/ldc2/x1/usr/bin/ld: cannot find crtn.o: No such file or directory<br></blockquote><div><br></div><div>I've been looking into doing this too, for llgo (Go compiler frontend for LLVM).</div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">You need libc6-dev also. After including that, </span><span style="line-height:1.5">I was then met with another issue: libc.so is a linker script, and that uses absolute paths to point at the real libraries. </span><span style="line-height:1.5">I haven't solved that yet. If it's possible to override files in a staged package, you could just provide a replacement linker script.</span><br></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Cheers,</span></div><div><span style="line-height:1.5">Andrew</span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As far as I can see the libraries are installed, but presumably something is<br>
missing from various bits of config to tell gcc where to look for them.<br>
<br>
No doubt I'll be able to work it out after sleeping on it ... :-P<br>
<br>
--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><br>
</blockquote></div></div>