bug-mes
[Top][All Lists]
Advanced

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

Re: Building TCC with the upcoming Mes 0.26


From: Timothy Sample
Subject: Re: Building TCC with the upcoming Mes 0.26
Date: Thu, 23 Nov 2023 13:36:17 -0600
User-agent: Gnus/5.13 (Gnus v5.13)

Ekaitz Zarraga <ekaitz@elenq.tech> writes:

> On 11/23/23 08:48, Janneke Nieuwenhuizen wrote:
>> Timothy Sample writes:
>>> The first was that I had to revert the ‘bootstrap.sh’ changes from
>>> commit 0d3c4ddc4bcb57db690ee8ebab106fa6fda75823.  Not sure what that’s
>>> about.
>> The commit message is prettry clear?  It's for tcc riscv64 (it only
>> knows a simplified assembly).  Do you know how this broke your build,
>> I believe Andrius even built tcc for x86?

It’s line 32 of “build-source-lib.sh”.  It tries to copy from:

    ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler

Which is “../lib/linux/x86-mes-tcc”, and which doesn’t exist.

> This makes some sense, actually.
>
> Andrius built it but not using these scripts but their own from
> live-bootstrap.
>
> So this is a very valuable feedback.
> Maybe we need to hide this part of the commit under an `if`?
>
> +(
> +    mkdir -p tcc-lib
> +    cp config.sh tcc-lib
> +    cd tcc-lib
> +    compiler=tcc
> +    if test -z "$srcdest"; then
> +        srcdest=../
> +        srcdir=../
> +    fi
> +    ${SHELL} ${srcdest}build-aux/build-source-lib.sh
> +)

I don’t pretend to understand the build system super well, but it would
fix it to hide it behind:

    if test -d ${srcdest}lib/$mes_kernel/$mes_cpu-mes-tcc

Here’s a patch for that.  I tested it and was able to do the build with
it.  I did not test that it works for the RISC-V build (I wouldn’t even
know how!).


-- Tim

>From f2b5378d072fa0e0dc4810be494327f07aa88b3e Mon Sep 17 00:00:00 2001
From: Timothy Sample <samplet@ngyro.com>
Date: Thu, 23 Nov 2023 11:57:27 -0600
Subject: [PATCH] build: Only build tcc-lib if tcc sources exist.

* build-aux/bootstrap.sh.in: Only build tcc-lib if tcc sources
exist.
---
 build-aux/bootstrap.sh.in | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/build-aux/bootstrap.sh.in b/build-aux/bootstrap.sh.in
index 8502cb6a5..5c368d22c 100644
--- a/build-aux/bootstrap.sh.in
+++ b/build-aux/bootstrap.sh.in
@@ -142,14 +142,18 @@ cp bin/mes-mescc bin/mes
     fi
     @SHELL@ ${srcdest}build-aux/build-source-lib.sh
 )
-(
-    mkdir -p tcc-lib
-    cp config.sh tcc-lib
-    cd tcc-lib
-    compiler=tcc
-    if test -z "$srcdest"; then
-        srcdest=../
-        srcdir=../
-    fi
-    ${SHELL} ${srcdest}build-aux/build-source-lib.sh
-)
+
+if test -d ${srcdest}lib/$mes_kernel/$mes_cpu-mes-tcc
+then
+    (
+        mkdir -p tcc-lib
+        cp config.sh tcc-lib
+        cd tcc-lib
+        compiler=tcc
+        if test -z "$srcdest"; then
+            srcdest=../
+            srcdir=../
+        fi
+        ${SHELL} ${srcdest}build-aux/build-source-lib.sh
+    )
+fi
-- 
2.41.0


reply via email to

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