bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug when using -- command line option


From: Jan Nieuwenhuizen
Subject: Re: bug when using -- command line option
Date: Tue, 21 Dec 2021 17:53:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Gabriel Wicki writes:

Hi Gabriel,

> i'm (still) working on the riscv64 port of GNU MEScc but i think i've
> stumbled upon a bug (but maybe i'm just doing it wrong).
>
> i follow the steps described in live-bootstrap to build mes-m2

Is this a copy/fork of Mes, or are you building the wip-m2 branch?

> compile
> crt1, libc-mini, libmescc, libc (see here:
> https://github.com/fosslinux/live-bootstrap/blob/master/sysa/mes/mes.kaem#L43).
>
> live-bootstrap alias-es the following:
>
> alias mescc="${MES} --no-auto-compile -e main ${bindir}/mescc.scm -- -D 
> HAVE_CONFIG_H=1 -I include -I include/linux/x86 -c"

I haven't looked into the live bootstrap.  Why not / what happens if you
do it like we do it in Guix?  Do something like:

    ./autogen.sh
    ./configure
    make all-go
    MES=guile ./pre-inst-env mescc -v -v -c scaffold/hello.c 

> when i use this alias (adapted to use for rv64) to compile for example
> crt1.c the following (somewhat suspicious) things happen (i inserted
> indicative comments at the very beginning and the very end):
>
>  1. the first resulting file is called "-D.s", mescc then goes on to try
>  to create a "-D.o" file from it (which of course fails)

Yeah.  Using this alias, you are skipping the scripts that mes is
using.  That should work, but can be tricky and version dependent.
Using Guile and adding "pk" in bin/mescc.scm may help to debug it.

>  2. the header (i mean the part between the :_start label and the
>  beginning of actual crt1.c code) and the footer (the part after crt1.c
>  code ends until end of file) mysteriously are taken from x86's as.scm
>  (or so i believe).  check the bottom for the (gory) details

Using ./configure and ./pre-inst-env may already fix this and otherwise
the the -v -v above may help to shed some light on this.

>  3. when compiling with "--" mescc tries to actually assemble a binary
>  file (which of course fails because RV64 M1 and x86 M1 code are mixed).
>  this doesn't happen when "--" is omitted.  the "--" option does not
>  seem to be documented (?) and i seem to be unable to find it in the
>  codebase.

Note that "--" is an argument to MES, not mescc.  This alias skips the
mescc scripts and invokes MES itself.

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env mes --help
Usage: mes [OPTION]... [FILE]...
Scheme interpreter for bootstrapping the GNU system.

Options:
  [-s] FILE            load source code from FILE, and exit
  -c EXPR              evaluate expression EXPR, and exit
  --                   stop scanning arguments; run interactively
[..]
--8<---------------cut here---------------end--------------->8---

Also note that when using Guile instead of Mes, the "--" must not be
used.  This also is handled by the scripts/mescc wrapper.

> thanks for all kinds of indications/pointers/(helpful) comments and
> such!

Hope this helps, if not let us know!

Greetings,
Janneke.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]