[poky] [RFC: enhance toolchain bootstrap process: v3: 0/7] enhance the toolchain bootstrap process
Richard Purdie
richard.purdie at linuxfoundation.org
Mon Jan 24 16:53:10 PST 2011
On Tue, 2011-01-25 at 01:28 +0800, Cui, Dexuan wrote:
> Richard Purdie wrote:
> > On Tue, 2011-01-18 at 21:57 +0800, Dexuan Cui wrote:
> Hi Richard, thanks very much for the review and feedback!
> BTW: I was just about to send out my "RFC v5" patches and I saw the mail. :-)
>
> During the past days, I've been busy with testing and fixing & updating my patches.
> The v5 patches are at http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/log/?h=dcui/tcbp-v5 (actually it's the same as dcui/tcbp-test currently)
> The attached v3-to-v5.diff shows the difference from v3 to v5:
>
> 1) fix several typos for "_prepend_virtclass-nativesdk": previously I used the wrong "_virtclass-nativesdk_prepend"!
>
> 2) in eglibc-initial.inc, now the line is
> STAGING_BINDIR_TOOLCHAIN_prepend = "${STAGING_DIR_NATIVE}${bindir_native}/${BASEPKG_HOST_SYS}.gcc-cross-initial:"
> Previously, I used HOST_SYS rather than BASEPKG_HOST_SYS. Actually HOST_SYS is not ok because this breaks arm/ppc builds.
>
> 3) similarly,
> in eglibc.inc:
> STAGING_BINDIR_TOOLCHAIN_prepend: HOST_SYS --> BASEPKG_HOST_SYS
> CPPFLAGS_prepend: TARGET_SYS -> BASEPKG_TARGET_SYS
> in gcc-cross-intermediate.inc:
> GCC_CROSS_INTERMEDIATE_WITH_BUILD_SYSROOT: TARGET_SYS --> BASEPKG_TARGET_SYS
>
> 4) in eglibc-initial.inc:
> use a "for t in ..." loop to replace the previous 3 statements.
>
> 5) add the code for glibc and glibc-initial similarly.
> 6) bump PRs accordingly.
>
> I'll send my current test results later.
Sounds good.
I did a bit of research and experimentation with your remaining changes
and came up with the hybrid you can see here:
http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/tt-bootstrap&id=bba04b790b0454e8bf2de8ea5a9d610e81f0a278
This is actually very similar to what you've done but I made a few
tweaks to try and improve the way it works.
Firstly instead of overloading the /lib and /usr/lib directories, I just
created a "bootstrap" sysroot, STAGING_DIR_TCBOOTSTRAP.
eglibc-initial then stages into that sysroot, as per your changes.
I then made gcc-cross-intermediate use this as both the build *and*
installation sysroot since its files don't conflict with those from
eglibc-initial.
We can then easily point eglibc to build against the bootstrap sysroot
using TOOLCHAIN_OPTIONS but install into the target.
Looking back at my patch, the change to make gcc-configure-cross.inc use
the bootstrap sysroot might not be correct, it should likely use the
libc from the main sysroot by that point.
The biggest problem I found was the sitecache.bbclass function in eglibc
as this wanted to run configure to be able to compile things yet we
don't populate the sysroot at that point so the intermediate compiler
won't fully work as it can't find a libc. I added a horrendous hack to
fudge this piece into working. A neater solution would be nice, I'm
still working on that but I'm not too optimistic.
Could you take a look at these changes and see what you think? There are
still a few details that need to be ironed out but I think it could
work.
Cheers,
Richard
More information about the poky
mailing list