unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* wip-arm-bootstrap: Reduced binary seed bootstrap
@ 2020-12-20 12:30 Jan Nieuwenhuizen
  2020-12-21 10:10 ` Jan Nieuwenhuizen
  2020-12-22 15:10 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2020-12-20 12:30 UTC (permalink / raw)
  To: guix-devel, Danny Milosavljevic; +Cc: bug-mes

Hi!

I pushed an initial wip-arm-bootstrap that builds up to tcc-boot:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix build -e '(@@ (gnu packages commencement) tcc-boot)'
--8<---------------cut here---------------end--------------->8---

Danny did a terrific job on armhf-linux support for GNU Mes and we are
getting close to release v0.23.  What's known to be missing is "setjmp"
support for tcc/gcc.  And, of course, for the Reduced binary seed
bootstrap to work on ARM!

In the previous status report

    https://lists.gnu.org/archive/html/bug-mes/2020-12/msg00002.html

I was stuck trying to get floats to work in tinycc but last weekend I
finally managed to bootstrap tcc, with long longs and floats enabled.
(this all took quite some effort).  Moving this into Guix should have
been almost trivial...but some silly "things" happened such as me
working off a dirty mes build tree; took me several days to find.

Anyway, the problem I'm looking at now is that while tcc-boot builds on
an ARM box, it does not build on aarch64-linux, i.e. this

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix build --system=armhf-linux \
  -e '(@@ (gnu packages commencement) tcc-boot0)'
--8<---------------cut here---------------end--------------->8---

fails on overdrive1.

What's next?

  * Fix the aarch64-linux problem,
  * the current wip-arm-bootstrap is based on master: it needs to be
    rebased on core-updates,
  * the rest of the bootstrap needs attention,
  * which probably means supporting "setjmp" in the Mes C Library on ARM
  * remove binary seeds for binutils, gcc, glibc, coreutils&co,
  * verify the x86 bootstrap still works,
  * and the current version of tcc-boot0 applies two inexplicable hacks
      477134b1 HACK bootstrappable: ARM: "tccgen_ok".
      33b60f03 HACK bootstrappable: ARM: "tccpp_ok".
    that would be great to understand and get rid of,
  * and IWBN to fix Gash's stacktraces on failing exec
  configure: error: 'mescc' failed to compile conftest.c.
Backtrace:
In unknown file:
   ?: 19 [apply-smob/1 #<catch-closure 410f30>]
[..]
In gash/shell.scm:
 165: 1 [sh:exec-let () "./conftest" "triplet"]
In unknown file:
   ?: 0 [execle "./conftest" # "./conftest" ...]

ERROR: In procedure execle:
ERROR: In procedure execle: No such file or directory

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wip-arm-bootstrap: Reduced binary seed bootstrap
  2020-12-20 12:30 wip-arm-bootstrap: Reduced binary seed bootstrap Jan Nieuwenhuizen
@ 2020-12-21 10:10 ` Jan Nieuwenhuizen
  2020-12-22 15:10 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2020-12-21 10:10 UTC (permalink / raw)
  To: guix-devel; +Cc: bug-mes

Jan Nieuwenhuizen writes:

Hello,

> I pushed an initial wip-arm-bootstrap that builds up to tcc-boot:

Just a headsup: I have reset wip-arm-bootstrap.  This version actually
builds tcc-boot using mes-boot (the previous one only worked when
cheating by using %bootstrap-guile).

Also, the aarch64-linux problem has been fixed, so that this

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix build --system=armhf-linux \
 -e '(@@ (gnu packages commencement) tcc-boot)'
--8<---------------cut here---------------end--------------->8---

now works on overdrive1.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wip-arm-bootstrap: Reduced binary seed bootstrap
  2020-12-20 12:30 wip-arm-bootstrap: Reduced binary seed bootstrap Jan Nieuwenhuizen
  2020-12-21 10:10 ` Jan Nieuwenhuizen
@ 2020-12-22 15:10 ` Ludovic Courtès
  2020-12-23 12:14   ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-12-22 15:10 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, bug-mes

Hello!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> I pushed an initial wip-arm-bootstrap that builds up to tcc-boot:
>
> ./pre-inst-env guix build -e '(@@ (gnu packages commencement) tcc-boot)'
>
>
> Danny did a terrific job on armhf-linux support for GNU Mes and we are
> getting close to release v0.23.  What's known to be missing is "setjmp"
> support for tcc/gcc.  And, of course, for the Reduced binary seed
> bootstrap to work on ARM!

Woohoo, thumbs up for this great milestone, hackers! 🎉

> Anyway, the problem I'm looking at now is that while tcc-boot builds on
> an ARM box, it does not build on aarch64-linux, i.e. this
>
> ./pre-inst-env guix build --system=armhf-linux \
>   -e '(@@ (gnu packages commencement) tcc-boot0)'
>
> fails on overdrive1.

That’s “interesting”.  Did you eventually find a lead?

>   configure: error: 'mescc' failed to compile conftest.c.
> Backtrace:
> In unknown file:
>    ?: 19 [apply-smob/1 #<catch-closure 410f30>]
> [..]
> In gash/shell.scm:
>  165: 1 [sh:exec-let () "./conftest" "triplet"]
> In unknown file:
>    ?: 0 [execle "./conftest" # "./conftest" ...]
>
> ERROR: In procedure execle:
> ERROR: In procedure execle: No such file or directory

Looks like the ELF interpreter on ‘conftest’ might be wrong?

Thanks for the update, it’s exciting!

Ludo’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wip-arm-bootstrap: Reduced binary seed bootstrap
  2020-12-22 15:10 ` Ludovic Courtès
@ 2020-12-23 12:14   ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2020-12-23 12:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, bug-mes

Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>> I pushed an initial wip-arm-bootstrap that builds up to tcc-boot:
>>
>> ./pre-inst-env guix build -e '(@@ (gnu packages commencement) tcc-boot)'
>>
>>
>> Danny did a terrific job on armhf-linux support for GNU Mes and we are
>> getting close to release v0.23.  What's known to be missing is "setjmp"
>> support for tcc/gcc.  And, of course, for the Reduced binary seed
>> bootstrap to work on ARM!
>
> Woohoo, thumbs up for this great milestone, hackers! 🎉

Thanks!!

>> Anyway, the problem I'm looking at now is that while tcc-boot builds on
>> an ARM box, it does not build on aarch64-linux, i.e. this
>>
>> ./pre-inst-env guix build --system=armhf-linux \
>>   -e '(@@ (gnu packages commencement) tcc-boot0)'
>>
>> fails on overdrive1.
>
> That’s “interesting”.  Did you eventually find a lead?

Yes, I added '|| BOOTSTRAP' in tccelf.c:

--8<---------------cut here---------------start------------->8---
#if defined (TCC_ARM_EABI) || BOOTSTRAP
    ehdr.e_ident[EI_OSABI] = 0;
    ehdr.e_flags = EF_ARM_EABI_VER4;
    if (file_type == TCC_OUTPUT_EXE || file_type == TCC_OUTPUT_DLL)
        ehdr.e_flags |= EF_ARM_HASENTRY;
    if (s1->float_abi == ARM_HARD_FLOAT)
        ehdr.e_flags |= EF_ARM_VFP_FLOAT;
    else
        ehdr.e_flags |= EF_ARM_SOFT_FLOAT;
#else
    ehdr.e_ident[EI_OSABI] = ELFOSABI_ARM;
#endif
--8<---------------cut here---------------end--------------->8---

this should be investigated a bit further.  Compiling with TCC_ARM_EABI
fails (which should work, really), but for this linking stage we need it
set to produce an aarch64-linux-compatible ELF header.  Dunno!

> Thanks for the update, it’s exciting!

You're welcome!  Meanwhile, I built gcc-core-mesboot0 (2.95.3).
However, that's using bash from %bootstrap-coreutils&co.

The last thing I did was to investigate into bash-2.05b and found that
bash depends on a working setjmp/longjmp for tinycc.  I tried several
versions of macro substitution on x86 instead of setjmp/longjmp, but
that doesn't seem possible: subshells and such.  So Danny, would you
like to look at that?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-23 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-20 12:30 wip-arm-bootstrap: Reduced binary seed bootstrap Jan Nieuwenhuizen
2020-12-21 10:10 ` Jan Nieuwenhuizen
2020-12-22 15:10 ` Ludovic Courtès
2020-12-23 12:14   ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).