• Re: Architecture variants for Debian / Ubuntu (5/5)

    From Michael Hudson-Doyle@1:229/2 to Guillem Jover on Thu Nov 2 16:50:01 2023
    [continued from previous message]

    &gt; &gt; On Fri, 2023-09-01 at 08:43:55 +1200, Michael Hudson-Doyle wrote:<br> &gt; &gt; &gt; Is there a better way of doing this?<br>
    &gt; &gt;<br>
    &gt; &gt; I think starting from 5, the rest are probably just details to hammer<br>
    &gt; &gt; out, but not insurmountable things.<br>

    &gt; Great. The things I see as a bit vague at a base level currently are:<br> &gt; <br>
    &gt; * Should the ISA influence the toolchain via toolchain defaults or<br> &gt; dpkg-buildflags?<br>
    &gt; * How is the default ISA for a buildd chroot selected?<br>

    So the clear downsides of either modifying the default toolchain or<br>
    having to provide an additional one is that this seems pretty heavy<br>
    weight. Also because people might want to build optimized variants<br>
    locally w/o having to mess with their already existing toolchains.<br>
    (I&#39;m not sure whether something going along the lines of<br>
    &lt;<a href="https://git.hadrons.org/cgit/debian/fakecross.git" rel="noreferrer" target="_blank">https://git.hadrons.org/cgit/debian/fakecross.git</a>&gt; could be an<br>
    option, although as mentioned above, if that would imply new triplets,<br>
    then probably not.)<br>

    So the easiest way might indeed be by controlling this via an envvar,<br></blockquote><div><br></div><div>DEB_HOST_ARCH_ISA?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);
    padding-left:1ex">
    which dpkg-buildpackage could also setup internally via a new option,<br>
    say --arch-isa=amd64v3 or similar</blockquote><div><br></div><div>--host-arch-isa would be more coherent I think.</div><div><br></div><div>I guess one could add support for --target-host-arch-isa to build a toolchain that defaults to a particular ISA.
    But well.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> to make this slightly more<br>
    discoverable. Which would be easy to use from the buildds too I guess.<br></blockquote><div><br></div><div>I also think that (conceptually) it makes sense that you might want to have an build chroot that *uses* amd64v3 binaries (because your builder is
    amd64v3) to *produce* boring old amd64 binaries (I mean, I doubt gcc built with different march is so much faster that it really matters but...)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(
    204,204,204);padding-left:1ex">
    &gt; There is also the question of whether partial coverage of an ISA is handled<br>
    &gt; by the package publisher or client side in apt but that&#39;s at least one<br>
    &gt; level higher.<br>

    Yeah, that would be of no concern to dpkg, I think.<br></blockquote><div><br></div><div>Ack.</div><div><br></div><div>So to summarise, here are the generic changes that I think need to be made to src:dpkg to support variant ISAs as a thing:</div><div
    class="gmail_quote"><br></div> * add get_host_arch_isa() to Dpkg::Arch<br> * dpkg-gencontrol records DEB_HOST_ARCH_ISA into DEBIAN/control as ArchitectureIsa<br> * dpkg-architecture emits DEB_HOST_ARCH_ISA and grows --host-arch-isa flag</div><div
    class="gmail_quote"> * dpkg-buildpackage passes --host-arch-isa to dpkg-architecture</div><div class="gmail_quote"> * dpkg-genchanges should record the ISA in the changes file somehow I guess?</div><div class="gmail_quote"> * dpkg-deb records the ISA
    in the file name</div><div class="gmail_quote"><br></div><div class="gmail_quote">Have I missed anything? (Hmm does anything need to reject unknown values found in DEB_HOST_ARCH_ISA /  --host-arch-isa? Probably...)</div><div class="gmail_quote"><br></
    <div class="gmail_quote">Conceptually slightly separately, it might make sense to add a build &quot;feature&quot; to Dpkg::Vendor::Debian to allow setting -march (and -mtune?)</div><div class="gmail_quote"><br></div><div class="gmail_quote">Then when
    we want to add support to an ISA, we add a little thing to set_build_features (in either Vendor::Debian or Vendor::Ubuntu or wherever) that maps get_host_arch_isa() to values for the march-influencing feature.</div><div class="gmail_quote"><div><br></div>
    <div>Cheers,</div><div>mwh <br></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)