bug-mes
[Top][All Lists]
Advanced

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

Re: Make mes build tcc in RISC-V


From: Janneke Nieuwenhuizen
Subject: Re: Make mes build tcc in RISC-V
Date: Sun, 05 Nov 2023 09:32:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Ekaitz Zarraga writes:

Hey

> I managed to make Mes build the bootstrappable TCC using the same
> approach guix's commencement module has.

\o/

> The patch is not complete, neither is it good, but it has some
> guidance on what it should be done. I'm not sure what's the best way
> to merge this as I don't understand totally the structure of the
> build-aux scripts.

I don't think it's so bad, what is missing?

> 1) We need to add empty crt files for riscv as the build scripts
> expect them to exist. (this can be a separate commit)

Great, can you split it?

> 2) We need to build the source lib specifically for tcc, as it doesn't
> have support for extended assembly and we had to patch all that
> out. (see bootstrap.sh.in)

Right, isn't that what this patch is doing?

> 3) build-source-lib.sh needs some special treatment because it doesn't
> build separate libraries but just libc+gnu.c, which we may need in the
> future for gcc but with the -gcc version of the code (see point 2).

Let's not try to cater for an unknown future, unless we have a real good
idea about it?

> 4) We also need to install tcc-lib (see install.sh.in) generated in
> bootstrap.sh.in.

Yes.

> 5) TODO: there are some other scripts that don't take part in the
> bootstrapping process described by the commencement module
> (configure.sh + bootstrap.sh + install.sh) I didn't add support to
> them...

Yeah, it would be nice if the regular build-aux/build.sh.in would also
cater for this, OTOH, those can never be used for bootstrapping, there
will be no need to bootstrap tcc, so possibly we're OK.

> I hope this is clear enough to choose what should be added in the
> final release and what shouldn't.  There are other comments in the
> patch that worth taking a look to.

Thanks!

> From f849f54415828f0220b7181510efd12ed6a46bf0 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz@elenq.tech>
> Date: Wed, 25 Oct 2023 20:35:57 +0200
> Subject: [PATCH] BOOTSTRAPPING FOR RISC-V 64:
>
> Kind of works but it generates all the output in /lib/ which doesn't
> leave the libc+gnu.c version for gcc later??

I don't think that's necessary, we build gcc-core using tcc and then
build either glibc or musl.

[..]

> diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh
> index 22d0fe89..f3d2a08b 100644
> --- a/build-aux/configure-lib.sh
> +++ b/build-aux/configure-lib.sh
> @@ -108,8 +108,16 @@ lib/mes/ntoab.c
>  lib/mes/oputc.c
>  lib/mes/ultoa.c
>  lib/mes/utoa.c
> +"
> +
> +# /include/mes/lib-cc.h already defines __raise.c as a macro for __TCC__
> +# if we include it in the target source lib it explodes when reading the
> +# function definition
> +if test $compiler != tcc; then
> +libmes_SOURCES="$libmes_SOURCES
>  lib/stub/__raise.c
>  "
> +fi

Please add indentation similar to other places in the file.

Otherwise, LGTM.

Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | AvatarĀ® https://AvatarAcademy.com



reply via email to

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