From 1cdb582cca14dee0cc5e1bc0e2620773ec0a61c8 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 9 Feb 2024 17:07:10 -0500 Subject: [PATCH] Add a crossbuild test config for #-sb-unicode which happens to be #+win32 and exposed a bug that a no-longer-needed allowance for warnings caused it to exit with success despite a missing BASE-CHAR-P, and also that there was also a pre-existing warning in stream.lisp if #-sb-unicode. --- build-all-cores.sh | 1 + crossbuild-runner/Makefile | 5 +++++ crossbuild-runner/pass-1.lisp | 12 +++++++----- crossbuild-runner/pass-2.lisp | 2 +- src/code/stream.lisp | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build-all-cores.sh b/build-all-cores.sh index 62400cc41..4efc9107b 100755 --- a/build-all-cores.sh +++ b/build-all-cores.sh @@ -42,6 +42,7 @@ ("sparc" ("sparc-sunos" :big-endian :unix :sunos :elf) ("sparc-linux" :big-endian :unix :linux :elf)) ("x86" ("x86" :little-endian :largefile) + ("x86-ascii" :little-endian :largefile (not :sb-unicode)) ("x86-thread" :little-endian :largefile :sb-thread) ("x86-linux" :little-endian :largefile :sb-thread :linux :unix :elf :sb-thread)) ("x86-64" ("x86-64" :little-endian :avx2 :gencgc :sb-simd-pack :sb-simd-pack-256) diff --git a/crossbuild-runner/Makefile b/crossbuild-runner/Makefile index b61af77af..fbc96b8d7 100644 --- a/crossbuild-runner/Makefile +++ b/crossbuild-runner/Makefile @@ -59,6 +59,11 @@ obj/xbuild/x86/xc.core: $(DEPS1) obj/xbuild/x86.core: obj/xbuild/x86/xc.core $(SBCL) $(ARGS) x86 < $(SCRIPT2) +obj/xbuild/x86-ascii/xc.core: $(DEPS1) + $(SBCL) $(ARGS) x86-ascii x86 "(:WIN32 :SB-THREAD :SB-SAFEPOINT :LITTLE-ENDIAN :LARGEFILE (NOT :SB-UNICODE))" < $(SCRIPT1) +obj/xbuild/x86-ascii.core: obj/xbuild/x86-ascii/xc.core + $(SBCL) $(ARGS) x86-ascii < $(SCRIPT2) + obj/xbuild/x86-thread/xc.core: $(DEPS1) $(SBCL) $(ARGS) x86-thread x86 "(:WIN32 :SB-THREAD :SB-SAFEPOINT :LITTLE-ENDIAN :LARGEFILE :SB-THREAD)" < $(SCRIPT1) obj/xbuild/x86-thread.core: obj/xbuild/x86-thread/xc.core diff --git a/crossbuild-runner/pass-1.lisp b/crossbuild-runner/pass-1.lisp index 3f8e898d1..ece76b885 100644 --- a/crossbuild-runner/pass-1.lisp +++ b/crossbuild-runner/pass-1.lisp @@ -4,12 +4,14 @@ (destructuring-bind (first second third) (cdr *posix-argv*) (values first second third))) (arch-symbol (intern (string-upcase target-name) "KEYWORD")) - ;; TODO: allow subtractive features too - (add-features (read-from-string features)) + (features (read-from-string features)) + (subtract-features + (mapcan (lambda (x) (if (typep x '(cons (eql not))) (list (cadr x)))) + features)) + (add-features (remove-if-not #'symbolp features)) (build-dir (format nil "obj/xbuild/~A/" configuration-name)) (ltf (format nil "~A/local-target-features" build-dir)) (objroot (format nil "~A/from-host/" build-dir))) - ;; (format t "~&added features: ~S~%" add-features) (ensure-directories-exist objroot) (defvar *sbcl-host-obj-prefix* objroot) (let ((makeflags (sb-ext:posix-getenv "MAKEFLAGS"))) @@ -23,7 +25,7 @@ :if-does-not-exist :create :if-exists :supersede) (format t "(lambda (features) -(union features (list :crossbuild-test :os-provides-dlopen ~s~{ ~s~}~%" +(set-difference (union features (list :crossbuild-test :os-provides-dlopen ~s~{ ~s~}~%" arch-symbol add-features) ;; "features" contains the mandatory set of symbols for any build of that target. (let ((features-filename "features")) @@ -32,7 +34,7 @@ (let ((string (make-string (file-length f)))) (read-sequence string f) (write-string string)))) - (format t ")))~%")) + (format t ")) '~S))~%" subtract-features)) (load "make-host-1.lisp") (finish-output sb-sys:*stdout*) (finish-output sb-sys:*stderr*) diff --git a/crossbuild-runner/pass-2.lisp b/crossbuild-runner/pass-2.lisp index a5f62e609..c31a25979 100644 --- a/crossbuild-runner/pass-2.lisp +++ b/crossbuild-runner/pass-2.lisp @@ -45,7 +45,7 @@ sb-c::*undefined-warnings*))) (finish-output host-sb-sys:*stdout*) (finish-output host-sb-sys:*stderr*) - (when (and warnings (not (target-featurep :win32))) + (when warnings (error "Fail"))) (load "tools-for-build/corefile.lisp" :verbose nil) diff --git a/src/code/stream.lisp b/src/code/stream.lisp index da2fc8b14..573a6f582 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -2675,7 +2675,7 @@ benefit of the function GET-OUTPUT-STREAM-STRING." (setf (ansi-stream-misc stream) misc))) (defun stdstream-external-format (fd) - #-win32 (declare (ignore fd)) + (declare (ignorable fd)) (let* ((keyword (cond #+(and win32 sb-unicode) ((sb-win32::console-handle-p fd) :ucs-2)