build: Drop support for mescc-tools 0.5.2.

* build-aux/build-scaffold.sh (stage0_cpu_flag): Remove.  Update users.
* build-aux/cflags.sh (stage0_arch): Remove.
* build-aux/config.sh.in (numbered_arch): Remove.
* configure (main): Remove check for numbered-arch?.  Remove
substitution of @numbered-arch@.
* configure.sh (numbered_arch): Likewise.
* module/mescc.scm (%numbered-arch?): Remove.
(parse-opts): Remove support for --numbered-arch?
* module/mescc/mescc.scm (mescc:compile): Remove alignment exception for
numbered-arch?.
(infos->hex2): Likewise.
(arch-get-architecture): Remove support for numbered-arch?.
* scripts/mescc.in (numbered_arch): Remove.
* scripts/mescc.scm.in (%numbered-arch?): Remove.
("%numbered_arch"): Remove.
This commit is contained in:
Janneke Nieuwenhuizen 2023-05-03 14:47:09 +02:00
parent 1a1fbfd36c
commit ad7ce36b5b
9 changed files with 19 additions and 68 deletions

View File

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# GNU Mes --- Maxwell Equations of Software # GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> # Copyright © 2017,2018,2019,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Mes. # This file is part of GNU Mes.
# #
@ -54,15 +54,9 @@ trace "TEST exit-42"
[ $r != 42 ] && echo " => $r" [ $r != 42 ] && echo " => $r"
[ $r = 42 ] [ $r = 42 ]
if $numbered_arch; then
stage0_cpu_flag="--Architecture $stage0_arch";
else
stage0_cpu_flag="--architecture $stage0_cpu";
fi
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2" $HEX2\ trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2" $HEX2\
--little-endian\ --little-endian\
$stage0_cpu_flag\ --architecture $stage0_cpu\
--base-address 0x1000000\ --base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2\
@ -75,7 +69,7 @@ trace "TEST 0exit-42"
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2" $HEX2\ trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2" $HEX2\
--little-endian\ --little-endian\
$stage0_cpu_flag\ --architecture $stage0_cpu\
--base-address 0x1000000\ --base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2\
@ -101,7 +95,7 @@ trace "TEST hello-mes"
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2" $HEX2\ trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2" $HEX2\
--little-endian\ --little-endian\
$stage0_cpu_flag\ --architecture $stage0_cpu\
--base-address 0x1000000\ --base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2\
@ -114,7 +108,7 @@ trace "TEST 0hello-mes"
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2" $HEX2\ trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2" $HEX2\
--little-endian\ --little-endian\
$stage0_cpu_flag\ --architecture $stage0_cpu\
--base-address 0x1000000\ --base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2\ -f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2\

View File

@ -1,5 +1,5 @@
# GNU Mes --- Maxwell Equations of Software # GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> # Copyright © 2018,2019,2020,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Mes. # This file is part of GNU Mes.
# #
@ -18,19 +18,15 @@
case "$mes_cpu" in case "$mes_cpu" in
arm) arm)
stage0_arch=40
stage0_cpu=armv7l stage0_cpu=armv7l
;; ;;
x86_64) x86_64)
stage0_arch=2
stage0_cpu=amd64 stage0_cpu=amd64
;; ;;
x86) x86)
stage0_arch=1
stage0_cpu=x86 stage0_cpu=x86
;; ;;
*) *)
stage0_arch=1
stage0_cpu=$mes_cpu stage0_cpu=$mes_cpu
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
# GNU Mes --- Maxwell Equations of Software # GNU Mes --- Maxwell Equations of Software
# Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> # Copyright © 2018,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Mes. # This file is part of GNU Mes.
# #
@ -57,7 +57,6 @@ abs_top_srcdir="@abs_top_srcdir@"
arch="@arch@" arch="@arch@"
build="@build@" build="@build@"
host="@host@" host="@host@"
numbered_arch=${numbered_arch-"@numbered_arch@"}
bootstrap=${bootstrap-@bootstrap@} bootstrap=${bootstrap-@bootstrap@}
compiler=${compiler-@compiler@} compiler=${compiler-@compiler@}

9
configure vendored
View File

@ -556,12 +556,7 @@ Some influential environment variables:
(and (file-exists? "/bin/sh") "/bin/sh") (and (file-exists? "/bin/sh") "/bin/sh")
(file-name "sh" deps) (file-name "sh" deps)
"sh")) "sh"))
(hex2 (file-name "hex2" deps)) (hex2 (file-name "hex2" deps)))
(numbered-arch? (begin
(stdout "checking for stage0 architecture flag... ")
(let ((numbered? (and hex2 (string-contains (gulp-pipe (string-append hex2 " --help 2>&1" )) "--Architecture 12345"))))
(stdout (if numbered? "numbered\n" "named\n"))
numbered?))))
(define* (substitute file-name pairs (define* (substitute file-name pairs
#:key (target (if (string-suffix? ".in" file-name) #:key (target (if (string-suffix? ".in" file-name)
@ -655,7 +650,6 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@LDFLAGS@" . ,(or (getenv "LDFLAGS") "-static -g")) ("@LDFLAGS@" . ,(or (getenv "LDFLAGS") "-static -g"))
("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") "")) ("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") ""))
("@M1FLAGS@" . ,(or (getenv "M1FLAGS") "")) ("@M1FLAGS@" . ,(or (getenv "M1FLAGS") ""))
("@numbered_arch@" . ,(if numbered-arch? "true" "false"))
,@(map ,@(map
(lambda (o) (lambda (o)
@ -724,7 +718,6 @@ GNU Mes is configured for
libc: " mes-libc " libc: " mes-libc "
kernel: " mes-kernel " kernel: " mes-kernel "
system: " mes-system " system: " mes-system "
tools: " (if numbered-arch? "numbered" "named") " arch
bootstrap: " (if with-bootstrap? "yes" "no") " bootstrap: " (if with-bootstrap? "yes" "no") "
courageous: " (if with-courage? "yes" "no") " courageous: " (if with-courage? "yes" "no") "

View File

@ -99,13 +99,6 @@ else
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')} GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')}
fi fi
numbered_arch=false
mes_tools=named
if ( $HEX2 --help 2>&1 ) | grep -q "\-\-Architecture 12345"; then
numbered_arch=true
mes_tools=numbered
fi
bindir=$(eval echo ${bindir-$prefix/bin}) bindir=$(eval echo ${bindir-$prefix/bin})
datadir=$(eval echo ${datadir-$prefix/share}) datadir=$(eval echo ${datadir-$prefix/share})
docdir=$(eval echo ${docdir-$datadir/doc/mes}) docdir=$(eval echo ${docdir-$datadir/doc/mes})
@ -172,7 +165,6 @@ subst () {
-e s,"@M2_PLANET@,$M2_PLANET,"\ -e s,"@M2_PLANET@,$M2_PLANET,"\
-e s,"@KAEM@,$KAEM,"\ -e s,"@KAEM@,$KAEM,"\
-e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\ -e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\
-e s,"@numbered_arch@,$numbered_arch,"\
-e s,"@SHELL@,$SHELL,"\ -e s,"@SHELL@,$SHELL,"\
$1 > $2 $1 > $2
} }

View File

@ -1,5 +1,5 @@
;;; GNU Mes --- Maxwell Equations of Software ;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016,2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of GNU Mes. ;;; This file is part of GNU Mes.
;;; ;;;
@ -42,7 +42,6 @@
(define %includedir (or (getenv "%includedir") "include")) (define %includedir (or (getenv "%includedir") "include"))
(define %libdir (or (getenv "%libdir") ".")) (define %libdir (or (getenv "%libdir") "."))
(define %version (or (getenv "%version") "0.0")) (define %version (or (getenv "%version") "0.0"))
(define %numbered-arch? (and=> (getenv "%numbered_arch") (lambda (x) (equal? x "true"))))
(when (and=> (getenv "V") (lambda (v) (and (= (string-length v) 1) (> (string->number v) 1)))) (when (and=> (getenv "V") (lambda (v) (and (= (string-length v) 1) (> (string->number v) 1))))
(format (current-error-port) "mescc[~a]...\n" %scheme)) (format (current-error-port) "mescc[~a]...\n" %scheme))
@ -78,7 +77,6 @@
(nostartfiles) (nostartfiles)
(nostdinc) (nostdinc)
(nostdlib) (nostdlib)
(numbered-arch?)
(preprocess (single-char #\E)) (preprocess (single-char #\E))
(static) (static)
(std (value #t)) (std (value #t))
@ -109,7 +107,6 @@ Options:
-dumpmachine display the compiler's target machine -dumpmachine display the compiler's target machine
--base-address=ADDRESS --base-address=ADDRESS
use BaseAddress ADDRESS [0x1000000] use BaseAddress ADDRESS [0x1000000]
--numbered-arch mescc-tools use numbered arch
-D DEFINE[=VALUE] define DEFINE [VALUE=1] -D DEFINE[=VALUE] define DEFINE [VALUE=1]
-E preprocess only; do not compile, assemble or link -E preprocess only; do not compile, assemble or link
-g add debug info (call stack in GDB) -g add debug info (call stack in GDB)
@ -173,8 +170,6 @@ General help using GNU software: <http://gnu.org/gethelp/>
(options (if arch (acons 'arch arch options) options)) (options (if arch (acons 'arch arch options) options))
(kernel (option-ref options 'kernel %host-kernel)) (kernel (option-ref options 'kernel %host-kernel))
(options (acons 'kernel kernel options)) (options (acons 'kernel kernel options))
(numbered-arch? (option-ref options 'numbered-arch? %numbered-arch?))
(options (acons 'numbered-arch? numbered-arch? options))
(dumpmachine? (option-ref options 'dumpmachine #f)) (dumpmachine? (option-ref options 'dumpmachine #f))
(preprocess? (option-ref options 'preprocess #f)) (preprocess? (option-ref options 'preprocess #f))
(print-libgcc-file-name? (option-ref options 'print-libgcc-file-name #f)) (print-libgcc-file-name? (option-ref options 'print-libgcc-file-name #f))

View File

@ -1,5 +1,5 @@
;;; GNU Mes --- Maxwell Equations of Software ;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016,2017,2018,2019,2020,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 W. J. van der Laan <laanwj@protonmail.com> ;;; Copyright © 2021 W. J. van der Laan <laanwj@protonmail.com>
;;; ;;;
;;; This file is part of GNU Mes. ;;; This file is part of GNU Mes.
@ -79,12 +79,8 @@
(else (replace-suffix input-base ".s")))) (else (replace-suffix input-base ".s"))))
(infos (map (cut file->info options <>) files)) (infos (map (cut file->info options <>) files))
(verbose? (count-opt options 'verbose)) (verbose? (count-opt options 'verbose))
(numbered-arch? (option-ref options 'numbered-arch? #f))
(align (filter-map (multi-opt 'align) options)) (align (filter-map (multi-opt 'align) options))
(align (if (null? align) '(functions) (map string->symbol align))) (align (if (null? align) '(functions) (map string->symbol align))))
(align (if (not numbered-arch?) align
;; function alignment not supported by MesCC-Tools 0.5.2
(filter (negate (cut eq? <> 'functions)) align))))
(when verbose? (when verbose?
(format (current-error-port) "dumping: ~a\n" M1-file-name)) (format (current-error-port) "dumping: ~a\n" M1-file-name))
(with-output-to-file* M1-file-name (with-output-to-file* M1-file-name
@ -173,12 +169,8 @@
(options (acons 'compile #t options)) ; ugh (options (acons 'compile #t options)) ; ugh
(options (acons 'output hex2-file-name options)) (options (acons 'output hex2-file-name options))
(verbose? (count-opt options 'verbose)) (verbose? (count-opt options 'verbose))
(numbered-arch? (option-ref options 'numbered-arch? #f))
(align (filter-map (multi-opt 'align) options)) (align (filter-map (multi-opt 'align) options))
(align (if (null? align) '(functions) (map string->symbol align))) (align (if (null? align) '(functions) (map string->symbol align))))
(align (if (not numbered-arch?) align
;; function alignment not supported by MesCC-Tools 0.5.2
(filter (negate (cut eq? <> 'functions)) align))))
(when verbose? (when verbose?
(format (current-error-port) "dumping: ~a\n" M1-file-name)) (format (current-error-port) "dumping: ~a\n" M1-file-name))
(with-output-to-file* M1-file-name (with-output-to-file* M1-file-name
@ -373,13 +365,11 @@
((equal? arch "x86_64") "x86_64.M1")))) ((equal? arch "x86_64") "x86_64.M1"))))
(define (arch-get-architecture options) (define (arch-get-architecture options)
(let* ((arch (arch-get options)) (let ((arch (arch-get options)))
(numbered-arch? (option-ref options 'numbered-arch? #f)) (list "--architecture"
(flag (if numbered-arch? "--Architecture" "--architecture"))) (cond ((equal? arch "arm") "armv7l")
(list flag ((equal? arch "x86") "x86")
(cond ((equal? arch "arm") (if numbered-arch? "40" "armv7l")) ((equal? arch "x86_64") "amd64")))))
((equal? arch "x86") (if numbered-arch? "1" "x86"))
((equal? arch "x86_64") (if numbered-arch? "2" "amd64"))))))
(define (multi-opt option-name) (lambda (o) (and (eq? (car o) option-name) (cdr o)))) (define (multi-opt option-name) (lambda (o) (and (eq? (car o) option-name) (cdr o))))
(define (count-opt options option-name) (define (count-opt options option-name)

View File

@ -1,7 +1,7 @@
#! @BASH@ #! @BASH@
# GNU Mes --- Maxwell Equations of Software # GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> # Copyright © 2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Mes. # This file is part of GNU Mes.
# #
@ -49,8 +49,6 @@ includedir=${includedir-@includedir@}
export includedir export includedir
libdir=${libdir-@libdir@} libdir=${libdir-@libdir@}
export libdir export libdir
numbered_arch=${numbered_arch=@numbered_arch@}
export numbered_arch
if [ ! -f $bindir/mescc.scm ]; then if [ ! -f $bindir/mescc.scm ]; then
bindir=$(dirname $0) bindir=$(dirname $0)

View File

@ -2,7 +2,7 @@
--no-auto-compile -e main -L @guile_site_dir@ -C @guile_site_ccache_dir@ -s --no-auto-compile -e main -L @guile_site_dir@ -C @guile_site_ccache_dir@ -s
!# !#
;;; GNU Mes --- Maxwell Equations of Software ;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016,2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of GNU Mes. ;;; This file is part of GNU Mes.
;;; ;;;
@ -48,18 +48,12 @@
(define %kernel (if (string-prefix? "@mes_kernel" "@mes_kernel@") %kernel (define %kernel (if (string-prefix? "@mes_kernel" "@mes_kernel@") %kernel
"@mes_kernel@")) "@mes_kernel@"))
(define %numbered-arch? (if (getenv "numbered_arch") (and=> (getenv "numbered_arch")
(lambda (x) (equal? x "true")))
(if (string-prefix? "@numbered_arch" "@numbered_arch@") #f
(equal? "@numbered_arch@" "true"))))
(setenv "%prefix" %prefix) (setenv "%prefix" %prefix)
(setenv "%includedir" %includedir) (setenv "%includedir" %includedir)
(setenv "%libdir" %libdir) (setenv "%libdir" %libdir)
(setenv "%version" %version) (setenv "%version" %version)
(setenv "%arch" %arch) (setenv "%arch" %arch)
(setenv "%kernel" %kernel) (setenv "%kernel" %kernel)
(setenv "%numbered_arch" (if %numbered-arch? "true" "false"))
(cond-expand (cond-expand
(mes (mes