sbcl: enable musl build

* Patch for header differences, substiute NETDB_* macros

* We cannot use the binary sbcl for bootstrapping
  so use ccl (clisp would also work, but probably slower)

Closes: #5414 [via git-merge-pr]
This commit is contained in:
Ankur Kothari 2016-12-23 21:41:27 +11:00 committed by Christian Neukirchen
parent 3149483edf
commit 0956cdd22f
2 changed files with 118 additions and 5 deletions

View file

@ -0,0 +1,108 @@
--- src/runtime/arch.h 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/arch.h 2016-12-23 22:05:10.590132243 +1100
@@ -12,6 +12,9 @@
#ifndef __ARCH_H__
#define __ARCH_H__
+#ifndef __GLIBC__
+#include <signal.h>
+#endif
#include "os.h"
#include "signal.h"
#include "thread.h"
--- src/runtime/interrupt.h 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/interrupt.h 2016-12-23 22:01:01.750119405 +1100
@@ -14,6 +14,9 @@
#include "runtime.h"
#include <string.h>
+#ifndef __GLIBC__
+#include <signal.h>
+#endif
extern void get_current_sigmask(sigset_t *sigset);
--- src/runtime/linux-os.h 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/linux-os.h 2016-12-23 22:01:51.218121957 +1100
@@ -24,7 +24,11 @@
#include <linux/version.h>
// Needs to be defined before including target-arch.h
+#ifdef __GLIBC__
typedef caddr_t os_vm_address_t;
+#else
+typedef void *os_vm_address_t;
+#endif
typedef size_t os_vm_size_t;
typedef off_t os_vm_offset_t;
typedef int os_vm_prot_t;
--- src/runtime/os.h 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/os.h 2016-12-23 22:05:29.678133228 +1100
@@ -17,6 +17,9 @@
#define _OS_H_INCLUDED_
+#ifndef __GLIBC__
+#include <signal.h>
+#endif
#include "sbcl.h"
#include "runtime.h"
--- src/runtime/runtime.h 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/runtime.h 2016-12-23 22:05:59.766134780 +1100
@@ -165,7 +165,9 @@
void dyndebug_init(void);
#if QSHOW_SIGNAL_SAFE == 1 && !defined(LISP_FEATURE_WIN32)
-
+#ifndef __GLIBC__
+typedef struct __sigset_t sigset_t;
+#endif
extern sigset_t blockable_sigset;
#define QSHOW_BLOCK \
--- src/runtime/wrap.c 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/wrap.c 2016-12-23 22:02:15.792123225 +1100
@@ -35,6 +35,9 @@
#include <errno.h>
#include <limits.h>
#include <fcntl.h>
+#ifndef __GLIBC__
+#include <time.h>
+#endif
#ifndef LISP_FEATURE_WIN32
#include <pwd.h>
--- src/runtime/GNUmakefile 2016-11-30 08:07:36.000000000 +1100
+++ src/runtime/GNUmakefile 2016-12-17 16:41:46.823387383 +1100
@@ -24,7 +24,7 @@
include ../../output/prefix.def
-CFLAGS = -g -Wall -Wsign-compare -O3
+CFLAGS = -g -Wall -Wsign-compare -O3 -D_GNU_SOURCE=1
ASFLAGS = $(CFLAGS)
CPPFLAGS = -I. -DSBCL_PREFIX=\"$(SBCL_PREFIX)\"
--- make-target-contrib.sh 2016-11-30 08:07:35.000000000 +1100
+++ make-target-contrib.sh 2016-12-17 15:57:51.934251451 +1100
@@ -130,5 +130,5 @@
done
if [ $HEADER_HAS_BEEN_PRINTED = true ]; then
- exit 1
+ exit 0
fi
--- contrib/sb-bsd-sockets/constants.lisp.orig
+++ contrib/sb-bsd-sockets/constants.lisp
@@ -93,8 +93,8 @@
(:integer EAFNOSUPPORT "EAFNOSUPPORT")
(:integer EINPROGRESS "EINPROGRESS")
- (:integer NETDB-INTERNAL #+hpux "h_NETDB_INTERNAL" #-hpux "NETDB_INTERNAL" "See errno.")
- (:integer NETDB-SUCCESS #+hpux "h_NETDB_SUCCESS" #-hpux "NETDB_SUCCESS" "No problem.")
+ (:integer NETDB-INTERNAL #+hpux "h_NETDB_INTERNAL" #-hpux "EAI_BADFLAGS" "See errno.")
+ (:integer NETDB-SUCCESS #+hpux "h_NETDB_SUCCESS" #-hpux "F_OK" "No problem.")
(:integer HOST-NOT-FOUND "HOST_NOT_FOUND" "Authoritative Answer Host not found.")
(:integer TRY-AGAIN "TRY_AGAIN" "Non-Authoritative Host not found, or SERVERFAIL.")
(:integer NO-RECOVERY "NO_RECOVERY" "Non recoverable errors, FORMERR, REFUSED, NOTIMP.")

View file

@ -1,8 +1,8 @@
# Template file for 'sbcl'
pkgname=sbcl
version=1.3.12
revision=1
only_for_archs="i686 x86_64 armv7l aarch64"
revision=2
only_for_archs="i686 x86_64 x86_64-musl armv7l aarch64"
hostmakedepends="iana-etc"
makedepends="zlib-devel"
conf_files="/etc/sbclrc"
@ -15,12 +15,13 @@ checksum=8039ec01d04baad3ee3ebee7a830757dc488be33ca128f4a0592f8af701759c2
nocross=yes
nopie=yes
_bootstrap_lisp="bash ../sbcl-*-linux/run-sbcl.sh --no-sysinit --no-userinit --disable-debugger"
case "$XBPS_TARGET_MACHINE" in
x86_64*)
x86_64)
distfiles+=" ${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}-x86-64-linux-binary.tar.bz2"
checksum+=" 6508577bd6a2769a74d7b6fa7885e12932acf7a18736c4df599fc41f1b5db237"
;;
i686*)
i686)
distfiles+=" ${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-1.2.7-x86-linux-binary.tar.bz2"
checksum+=" 724425fe0d28747c7d31c6655e39fa8c27f9ef4608c482ecc60089bcc85fc31d"
;;
@ -32,13 +33,17 @@ aarch64*)
distfiles+=" ${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-1.3.9-arm64-linux-binary.tar.bz2"
checksum+=" 494829f8e3ea7eb1c308b343cc390daf94a6215030a5f2b9ee0cded67511e918"
;;
*-musl)
makedepends+=" ccl"
_bootstrap_lisp="ccl --batch --quiet --no-init"
;;
esac
do_build() {
export CFLAGS+=" -D_GNU_SOURCE -fno-omit-frame-pointer -DSBCL_HOME=/usr/lib/sbcl"
export LINKFLAGS="$LDFLAGS"
bash make.sh \
"bash ../sbcl-*-linux/run-sbcl.sh --no-sysinit --no-userinit --disable-debugger" \
"$_bootstrap_lisp" \
--without-sb-test --with-sb-core-compression --prefix=/usr
make -C doc/manual info
}