bug-mes
[Top][All Lists]
Advanced

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

Re: arm/aarch64 with Mes 0.23


From: Jan Nieuwenhuizen
Subject: Re: arm/aarch64 with Mes 0.23
Date: Sat, 01 May 2021 16:17:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Vagrant Cascadian writes:

Hello Vagrant,

> On 2021-03-14, Jan Nieuwenhuizen wrote:
>> and now also for armhf-linux and aarch-linux.
>
> On armhf mes-gcc builds fine (yay!)

yay!

> but I was having trouble building mes-mescc. When I pass
> --with-bootstrap to configure, it ends with:
>
>   + /<<PKGBUILDDIR>>/bin/mes --no-auto-compile -e main -L
>   /usr/share/guile/site/3.0 -C /usr/lib/guile/3.0/site-ccache /<\
>   <PKGBUILDDIR>>/scripts/mescc.scm -- -m 32 -v -static -nostdinc -nostdlib
>   -fno-builtin -marm -L . -static -nostdlib -o \
>   bin/mes-mescc crt1.o gc.o hash.o lib.o math.o mes.o module.o posix.o
>   reader.o string.o struct.o vector.o -lc
>   mescc[mes]...
>   error:mescc: file not found:
>   "linux/arm-mes/elfarm-footer-single-main.hex2":()
>   exiting...

Oops.

> Where's elfarm-footer-single-main.hex2 supposed to come from?

It isn't ;).  It's the result of arch/bits confusion when the `-marm'
option was added.  Also, --with-bootstrap did not learn yet about
the new libmescc.a.  Both fixed in attached patch (and on master).

> I wasn't able to build aarc64-linux with 0.23 at all on Debian:
>
>   platform not supported: aarch64-linux-mes
>   See "Porting GNU Mes" in the manual, or try --with-courage

Ah, that's right, and expected.  The NEWS was a bit too optimistic here:
in Guix we expect to use armhf-linux to bootstrap aarch64-linux, just as
we do for x86_64-linux.

Thanks for testing this, and reporting it!

Greetings,
Janneke

>From 3a5a7d1e560afcddf2b3fbd65cb7e29afdf610b9 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Sat, 1 May 2021 15:40:56 +0200
Subject: [PATCH] mescc: Support --bootstrap build on ARM.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

The ARM port added the `-marm' option to mescc, where previously only
-m32' (the default) and `-m64' were supported.

Reported by Vagrant Cascadian <vagrant@reproducible-builds.org>.

* module/mescc/mescc.scm (arch-get-machine): When machine is "arm",
return "32".
* build-aux/build-mes.sh (LIBS)[mescc]: Add -lmescc.
---
 build-aux/build-mes.sh |  5 ++++-
 module/mescc/mescc.scm | 11 ++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/build-aux/build-mes.sh b/build-aux/build-mes.sh
index f4cc4229f..4ced2ed09 100755
--- a/build-aux/build-mes.sh
+++ b/build-aux/build-mes.sh
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # GNU Mes --- Maxwell Equations of Software
-# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+# Copyright © 2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 #
 # This file is part of GNU Mes.
 #
@@ -60,5 +60,8 @@ then
   # See <https://www.openwall.com/lists/musl/2018/05/09/1>.
   LIBS="${LIBS} -lgcc -lc"
 fi
+if [ "$compiler" = "mescc" ]; then
+   LIBS="${LIBS} -lc -lmescc"
+fi
 link bin/mes-$compiler
 cp bin/mes-$compiler bin/mes
diff --git a/module/mescc/mescc.scm b/module/mescc/mescc.scm
index bb2bd6ae0..265215e95 100644
--- a/module/mescc/mescc.scm
+++ b/module/mescc/mescc.scm
@@ -1,5 +1,5 @@
 ;;; GNU Mes --- Maxwell Equations of Software
-;;; Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen 
<janneke@gnu.org>
+;;; Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen 
<janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Mes.
 ;;;
@@ -359,10 +359,11 @@
 
 (define (arch-get-machine options)
   (let* ((machine (option-ref options 'machine #f))
-         (arch (option-ref options 'arch #f)))
-    (or machine
-        (if (member arch '("x86_64")) "64"
-            "32"))))
+         (arch (option-ref options 'arch #f))
+         (machine (or machine arch "32")))
+    (cond ((member machine '("x86_64")) "64")
+          ((member machine '("arm")) "32")
+          (else "32"))))
 
 (define (arch-get-m1-macros options)
   (let ((arch (arch-get options)))
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

-- 
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]