i386 fixes for lang/sbcl, from maintainer joshe@

This commit is contained in:
sthen 2019-03-21 22:06:53 +00:00
parent 472ec1fd86
commit a7444a2fe2
4 changed files with 58 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.39 2019/02/23 18:23:13 sthen Exp $
# $OpenBSD: Makefile,v 1.40 2019/03/21 22:06:53 sthen Exp $
# not yet ported to other arches
ONLY_FOR_ARCHS = amd64 i386 powerpc
BROKEN-i386 = persistent "Some of the contrib modules did not build successfully or pass their self-tests"
USE_WXNEEDED = Yes
REVISION = 0
COMMENT= compiler and runtime system for ANSI Common Lisp

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-src_compiler_generic_genesis_lisp,v 1.1 2019/03/21 22:06:54 sthen Exp $
Fix build on i386 when the text segment is more than 2GB from the dynamic space,
such as when linked with lld.
Index: src/compiler/generic/genesis.lisp
--- src/compiler/generic/genesis.lisp.orig
+++ src/compiler/generic/genesis.lisp
@@ -2118,9 +2118,12 @@ core and return a descriptor to it."
;; Never record it. (FIXME: this is a problem for relocatable heap)
nil)
(:relative ; (used for arguments to X86 relative CALL instruction)
- (setf (bvref-32 gspace-data gspace-byte-offset)
- (the (signed-byte 32)
- (- addr (+ gspace-base gspace-byte-offset 4)))) ; 4 = size of rel32off
+ (let ((difference (- addr (+ gspace-base gspace-byte-offset 4)))) ; 4 = size of rel32off
+ (setf (bvref-32 gspace-data gspace-byte-offset)
+ (the (signed-byte 32)
+ (if (< difference #x-80000000)
+ (ldb (byte 32 0) difference)
+ difference))))
;; Relative fixups are recorded if without the object.
;; Except that read-only space contains calls to asm routines,
;; and we don't record those fixups.

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-src_compiler_x86_parms_lisp,v 1.1 2019/03/21 22:06:54 sthen Exp $
Move the static spaces to an address which should be available under
both ld.bfd and ld.lld
Index: src/compiler/x86/parms.lisp
--- src/compiler/x86/parms.lisp.orig
+++ src/compiler/x86/parms.lisp
@@ -204,7 +204,7 @@
#!+sunos (!gencgc-space-setup #x20000000 :dynamic-space-start #x48000000)
#!+freebsd (!gencgc-space-setup #x01000000 :dynamic-space-start #x58000000)
#!+dragonfly (!gencgc-space-setup #x01000000 :dynamic-space-start #x58000000)
-#!+openbsd (!gencgc-space-setup #x3d000000 :dynamic-space-start #x8d000000)
+#!+openbsd (!gencgc-space-setup #x11000000 :dynamic-space-start #x8d000000)
#!+netbsd (!gencgc-space-setup #x20000000 :dynamic-space-start #x60000000)
#!+darwin (!gencgc-space-setup #x04000000 :dynamic-space-start #x10000000)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-tests_run-compiler_sh,v 1.1 2019/03/21 22:06:54 sthen Exp $
Tests must be built with -fPIC to pass on i386
Index: tests/run-compiler.sh
--- tests/run-compiler.sh.orig
+++ tests/run-compiler.sh
@@ -35,6 +35,7 @@ while [ $# -gt 0 ]; do
Linux-PowerPC) new=-fPIC ;;
NetBSD-PowerPC) new=-fPIC ;;
NetBSD-X86-64) new=-fPIC ;;
+ OpenBSD-X86) new=-fPIC ;;
OpenBSD-PowerPC) new=-fPIC ;;
OpenBSD-X86-64) new=-fPIC ;;
SunOS-SPARC) new=-fPIC ;;