rpms/sbcl/devel sbcl-0.8.18-default-sbcl-home.patch, NONE, 1.1 sbcl-0.9.4-ADDR_NO_RANDOMIZE.patch, NONE, 1.1 sbcl-0.9.4-optflags.patch, NONE, 1.1 sbcl.sh, NONE, 1.1 sbcl.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Rex Dieter (rdieter) fedora-extras-commits at redhat.com
Mon Sep 12 12:36:47 UTC 2005


Author: rdieter

Update of /cvs/extras/rpms/sbcl/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23518/devel

Modified Files:
	.cvsignore sources 
Added Files:
	sbcl-0.8.18-default-sbcl-home.patch 
	sbcl-0.9.4-ADDR_NO_RANDOMIZE.patch sbcl-0.9.4-optflags.patch 
	sbcl.sh sbcl.spec 
Log Message:
auto-import sbcl-0.9.4-4 on branch devel from sbcl-0.9.4-4.src.rpm

sbcl-0.8.18-default-sbcl-home.patch:

--- NEW FILE sbcl-0.8.18-default-sbcl-home.patch ---
Index: make-target-1.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-target-1.sh,v
retrieving revision 1.12
diff -u -r1.12 make-target-1.sh
--- make-target-1.sh	10 Sep 2004 15:36:17 -0000	1.12
+++ make-target-1.sh	3 Jan 2005 06:44:55 -0000
@@ -15,6 +15,29 @@
 
 echo //entering make-target-1.sh
 
+# Allow the definition of INSTALL_ROOT and/or SBCL_HOME to correctly
+# set the hard-coded SBCL_HOME macro in src/runtime/runtime.c
+
+DEFAULT_SBCL_HOME=${DEFAULT_SBCL_HOME:-/usr/local/lib/sbcl/}
+
+# Strip off any trailing / on the name; we'll add this later but don't
+# need two
+DEFAULT_SBCL_HOME=${DEFAULT_SBCL_HOME%/}
+
+export DEFAULT_SBCL_HOME
+
+file=src/runtime/sbcl-home.h
+echo "/* This is a machine-generated file.            */" > $file
+echo "/* Please do not edit it by hand.               */" >> $file
+echo "/* Change the default SBCL_HOME by setting the  */" >> $file
+echo "/* DEFAULT_SBCL_HOME environment variable prior */" >> $file
+echo "/* to building. See make-target-1.sh for more   */" >> $file
+echo "/* information.                                 */" >> $file
+echo "#ifndef SBCL_HOME" >> $file
+echo "#define SBCL_HOME \"$DEFAULT_SBCL_HOME/\"" >> $file
+echo "#endif" >> $file
+
+
 # Build the runtime system and symbol table (.nm) file.
 #
 # (This C build has to come after the first genesis in order to get
Index: src/runtime/runtime.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/runtime.c,v
retrieving revision 1.43
diff -u -r1.43 runtime.c
--- src/runtime/runtime.c	29 Oct 2004 09:00:39 -0000	1.43
+++ src/runtime/runtime.c	3 Jan 2005 06:47:51 -0000
@@ -61,9 +61,7 @@
 #include "interr.h"
 #endif
 
-#ifndef SBCL_HOME
-#define SBCL_HOME "/usr/local/lib/sbcl/"
-#endif
+#include "sbcl-home.h"
 
 
 /* SIGINT handler that invokes the monitor (for when Lisp isn't up to it) */

sbcl-0.9.4-ADDR_NO_RANDOMIZE.patch:

--- NEW FILE sbcl-0.9.4-ADDR_NO_RANDOMIZE.patch ---
--- sbcl-0.9.4/src/runtime/os.h.ADDR_NO_RANDOMIZE	2005-07-14 10:41:20.000000000 -0500
+++ sbcl-0.9.4/src/runtime/os.h	2005-08-30 12:16:42.781282788 -0500
@@ -50,7 +50,7 @@
 
 /* Do anything we need to do when starting up the runtime environment
  * in this OS. */
-extern void os_init(void);
+extern void os_init(char *argv[], char *envp[]);
 
 /* Install any OS-dependent low-level signal handlers which are needed
  * by the runtime environment. E.g. the signals raised by a violation
--- sbcl-0.9.4/src/runtime/linux-os.c.ADDR_NO_RANDOMIZE	2005-08-12 14:08:19.000000000 -0500
+++ sbcl-0.9.4/src/runtime/linux-os.c	2005-08-30 12:17:31.208291595 -0500
@@ -44,6 +44,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <linux/version.h>
+#include <linux/personality.h>
 
 #include "validate.h"
 #include "thread.h"
@@ -92,7 +93,7 @@
 int linux_no_threads_p = 0;
 
 void
-os_init(void)
+os_init(char *argv[], char *envp[])
 {
     /* Conduct various version checks: do we have enough mmap(), is
      * this a sparc running 2.2, can we do threads? */
@@ -117,7 +118,7 @@
         FSHOW((stderr,"linux kernel %d.%d predates 2.4;\n enabling workarounds for SPARC kernel bugs in signal handling.\n", major_version,minor_version));
         linux_sparc_siginfo_bug = 1;
 #endif
-    }
+    }   
 #ifdef LISP_FEATURE_SB_THREAD
     futex_wait(futex,-1);
     if(errno==ENOSYS)  linux_no_threads_p = 1;
@@ -125,6 +126,36 @@
         fprintf(stderr,"Linux with NPTL support (e.g. kernel 2.6 or newer) required for \nthread-enabled SBCL.  Disabling thread support.\n\n");
 #endif
     os_vm_page_size = getpagesize();
+   
+    /* KLUDGE: Disable memory randomization on new Linux kernels
+     * by setting a personality flag and re-executing. (We need
+     * to re-execute, since the memory maps that can conflict with
+     * the SBCL spaces have already been done at this point).
+     */
+#if defined(LISP_FEATURE_X86)
+    if ((major_version == 2) && (minor_version >= 6) || (major_version >= 3)) {
+       long pers = personality(-1);
+       /* 0x40000 aka. ADDR_NO_RANDOMIZE */
+       if (!(pers & 0x40000)) {
+	 if (personality(pers | 0x40000) != -1) {
+	     /* Use /proc/self/exe instead of trying to figure out the
+	      * executable path from PATH and argv[0], since that's reliable.
+	      */
+	     char buf[PATH_MAX+1];
+	     int rc = readlink("/proc/self/exe", buf, PATH_MAX);
+             if ( rc > 0 ) {
+	       buf[rc]=0;
+	       execve(buf, argv, envp);
+	     }
+	  }
+	  /* Either changing the personality or execve() failed. Either
+	   * way we might as well continue, and hope that the random
+	   * memory maps are ok this time around.
+	   */
+	  fprintf(stderr, "WARNING: Couldn't re-execute SBCL with the proper personality flags (maybe /proc isn't mounted?). Trying to continue anyway.\n");
+       }
+    }     
+#endif   
 }
 
 
--- sbcl-0.9.4/src/runtime/osf1-os.c.ADDR_NO_RANDOMIZE	2005-07-14 10:41:20.000000000 -0500
+++ sbcl-0.9.4/src/runtime/osf1-os.c	2005-08-30 12:16:42.783282706 -0500
@@ -51,7 +51,8 @@
 
 
 
-void os_init(void)
+void
+os_init(char *argv[], char *envp[])
 {
     os_vm_page_size = getpagesize();
 }
--- sbcl-0.9.4/src/runtime/bsd-os.c.ADDR_NO_RANDOMIZE	2005-07-14 10:41:11.000000000 -0500
+++ sbcl-0.9.4/src/runtime/bsd-os.c	2005-08-30 12:16:42.784282665 -0500
@@ -51,7 +51,8 @@
 static void netbsd_init();
 #endif /* __NetBSD__ */
 
-void os_init(void)
+void
+os_init(char *argv[], char *envp[])
 {
     os_vm_page_size = getpagesize();
 
--- sbcl-0.9.4/src/runtime/runtime.c.ADDR_NO_RANDOMIZE	2005-08-30 12:16:42.778282911 -0500
+++ sbcl-0.9.4/src/runtime/runtime.c	2005-08-30 12:16:42.785282623 -0500
@@ -194,7 +194,7 @@
     /* KLUDGE: os_vm_page_size is set by os_init(), and on some
      * systems (e.g. Alpha) arch_init() needs need os_vm_page_size, so
      * it must follow os_init(). -- WHN 2000-01-26 */
-    os_init();
+    os_init(argv, envp);
     arch_init();
     gc_init();
     validate();
--- sbcl-0.9.4/src/runtime/sunos-os.c.ADDR_NO_RANDOMIZE	2005-08-19 07:15:16.000000000 -0500
+++ sbcl-0.9.4/src/runtime/sunos-os.c	2005-08-30 12:16:42.786282582 -0500
@@ -53,7 +53,8 @@
 int KLUDGE_MAYBE_MAP_ANON = 0x0;
 int kludge_mmap_fd = -1; /* default for MAP_ANON */
 
-void os_init(void)
+void
+os_init(char *argv[], char *envp[])
 {
     struct utsname name;
     int major_version;

sbcl-0.9.4-optflags.patch:

--- NEW FILE sbcl-0.9.4-optflags.patch ---
--- sbcl-0.9.4/src/runtime/GNUmakefile.optflags	2005-08-19 07:15:15.000000000 -0500
+++ sbcl-0.9.4/src/runtime/GNUmakefile	2005-08-30 10:24:17.010651427 -0500
@@ -22,7 +22,8 @@
 DEPEND_FLAGS = -MM
 GREP = grep
 
-CFLAGS = -g -Wall -O3
+#CFLAGS = -g -Wall -O3
+CFLAGS = $(RPM_OPT_FLAGS)
 ASFLAGS = $(CFLAGS)
 CPPFLAGS = -I.
 


--- NEW FILE sbcl.sh ---
#!/bin/sh

if [ -z "$SBCL_HOME" ] ; then
SBCL_HOME=/usr/lib/sbcl
export SBCL_HOME
fi

if [ -z "$SBCL_SETARCH" ] ; then
BCL_SETARCH="setarch i386 -R"
fi

exec ${SBCL_SETARCH} ${SBCL_HOME}/sbcl ${1+"$@"}


--- NEW FILE sbcl.spec ---
# $Id: sbcl.spec,v 1.8 2003/11/12 16:47:44 rexdieter Exp $

## Default to using a local bootstrap, 
## define one of the following to override 
## (non sbcl bootstraps untested)
#define bootstrap sbcl
#define bootstrap cmucl
#define bootstrap clisp

%if "%{?fedora}" >= "3"
BuildRequires:setarch
Requires:setarch
%define setarch setarch %{_target_cpu}
%endif

#  Could test for setarch >= 1.7 instead
%if "%{?fedora}" >= "4"
%define setarch setarch %{_target_cpu} -R
%endif

Name: 	 sbcl
Summary: Steel Bank Common Lisp
Version: 0.9.4
Release: 4%{?dist}

License: BSD/MIT
Group: 	 Development/Languages
URL:	 http://sbcl.sourceforge.net/
Source0:  http://dl.sourceforge.net/sourceforge/sbcl/sbcl-%{version}-source.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#ExclusiveArch: %{ix86} x86_64

Source1: sbcl.sh

%if "%{?bootstrap}" == "%{nil}"
# local Bootstrap binaries
Source10: http://dl.sourceforge.net/sourceforge/sbcl/sbcl-%{version}-x86-linux-binary.tar.bz2
%ifarch %{ix86}
%define bootstrap_src -a 10 
%endif
Source11: http://dl.sourceforge.net/sourceforge/sbcl/sbcl-%{version}-x86-64-linux-binary.tar.bz2
%ifarch %{x86_64}
%define bootstrap_src -a 11 
%endif
# Latest powerpc-linux bootstrap (untested)
Source12: http://dl.sourceforge.net/sourceforge/sbcl/sbcl-0.8.15-powerpc-linux-binary.tar.bz2
%ifarch ppc 
%define bootstrap_src -a 12
%endif

%endif

Patch1: sbcl-0.8.18-default-sbcl-home.patch
# See http://sourceforge.net/mailarchive/message.php?msg_id=12787069
Patch2: sbcl-0.9.4-ADDR_NO_RANDOMIZE.patch
Patch3: sbcl-0.9.4-optflags.patch

%{?bootstrap:BuildRequires: %{?bootstrap}}

Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
# doc generation
BuildRequires: ghostscript
BuildRequires: texinfo

%description
Steel Bank Common Lisp (SBCL) is a Open Source development environment
for Common Lisp. It includes an integrated native compiler,
interpreter, and debugger.


%prep
%setup -q %{?bootstrap_src} 

#sed -i -e "s|/usr/local/lib/sbcl/|%{_libdir}/sbcl/|" src/runtime/runtime.c
#or patch to use SBCL_HOME env var
%patch1 -p0 -b .default-sbcl-home
%patch2 -p1 -b .ADDR_NO_RANDOMIZE
%patch3 -p1 -b .optflags

# http://article.gmane.org/gmane.lisp.steel-bank.general/340
# enable threads (was only for >= 2.6, but code has checks to disable for <= 2.4)
## FIXME(?): per section 2.2 of INSTALL, should create/use customize-target-features.lisp
## to customize features -- Rex
#define kernel_ver %(uname -r | cut -d- -f1 | cut -d. -f-2 )
#if "%{?kernel_ver}" >= "2.6"
%ifarch %{ix86} %{x86_64}
sed -i -e "s|; :sb-thread|:sb-thread|" base-target-features.lisp-expr
%endif
#endif

%if "%{?bootstrap}" == "%{nil}"
mkdir sbcl-bootstrap
pushd sbcl-%{version}-*-linux
chmod +x install.sh
INSTALL_ROOT=`pwd`/../sbcl-bootstrap ./install.sh
popd
%endif


%build
export DEFAULT_SBCL_HOME=%{_libdir}/sbcl

%if "%{?bootstrap}" == "%{nil}"
export SBCL_HOME=`pwd`/sbcl-bootstrap/lib/sbcl
export PATH=`pwd`/sbcl-bootstrap/bin:${PATH}
%endif

%{?setarch} ./make.sh %{?bootstrap}

# docs
make -C doc/manual html info


%check || :
%if "%{?_with_check:1}" == "1"
pushd tests 
%{?setarch} sh ./run-tests.sh 
popd
%endif


%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_mandir}}
export INSTALL_ROOT=$RPM_BUILD_ROOT%{_prefix}
unset SBCL_HOME ||:
%{?setarch} sh ./install.sh

# app-wrapper for using setarch
%if 0
%if "%{?setarch}" != "%{nil}"
mv $RPM_BUILD_ROOT%{_bindir}/sbcl $RPM_BUILD_ROOT%{_libdir}/sbcl/sbcl
install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/sbcl
sed -i -e "s|^SBCL_SETARCH=.*|SBCL_SETARCH=\"%{setarch}\"|" $RPM_BUILD_ROOT%{_bindir}/sbcl
%endif
%endif

## Unpackaged files
rm -rf $RPM_BUILD_ROOT%{_docdir}/sbcl
rm -f  $RPM_BUILD_ROOT%{_infodir}/dir

# CVS crud
find $RPM_BUILD_ROOT -name CVS -type d | xargs rm -rf
find $RPM_BUILD_ROOT -name '.cvsignore' | xargs rm -f
# from make check
find $RPM_BUILD_ROOT -name 'test-passed' | xargs rm -f
# 
find $RPM_BUILD_ROOT -name '*.c' | xargs chmod 644 


%post
/sbin/install-info %{_infodir}/sbcl.info %{_infodir}/dir ||:
/sbin/install-info %{_infodir}/asdf.info %{_infodir}/dir ||:


%postun
if [ $1 -eq 0 ]; then
  /sbin/install-info --delete %{_infodir}/sbcl.info %{_infodir}/dir ||:
  /sbin/install-info --delete %{_infodir}/asdf.info %{_infodir}/dir ||:
fi


%files
%defattr(-,root,root)
%doc BUGS COPYING README CREDITS NEWS TLA TODO
%doc SUPPORT STYLE PRINCIPLES
%doc doc/manual/sbcl
%doc doc/manual/asdf
%{_bindir}/*
%{_libdir}/sbcl/
%{_mandir}/man?/*
%{_infodir}/*


%clean
rm -rf $RPM_BUILD_ROOT


%changelog
* Tue Aug 30 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.4-4
- safer NO_ADDR_RANDOMIZE patch
- use %%{?setarch} in %%check too

* Tue Aug 30 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.4-3
- patch to avoid need to use setarch/app-wrapper
- fix app-wrapper (quote SBCL_SETARCH)
- include ppc bootstrap (oldish 0.8.15, untested)

* Mon Aug 29 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.4-2
- rm -f /usr/share/info/dir
- fix perms on packaged .c files
- include all bootstrap binaries
- Requires(post,preun): /sbin/install-info
- sbcl.sh app-wrapper (when using setarch)

* Sat Aug 27 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.4-1
- 0.9.4

* Fri Aug 26 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.3-2
- fc3: setarch %%{target_cpu}
- fc4: setarch %%{target_cpu} -R

* Thu Aug 25 2005 Rex Dieter <rexdieter[AT]users.sf.net>
- run tests
- allow for sbcl_local, sbcl, clisp bootstrap

* Wed Aug 17 2005 Gerard Milmeister <gemi at bluewin.ch> - 0.9.3-1
- New Version 0.9.3

* Wed Jun 29 2005 Gerard Milmeister <gemi at bluewin.ch> - 0.9.2-1
- New Version 0.9.2

* Thu Jun 16 2005 Gerard Milmeister <gemi at bluewin.ch> - 0.9.1-1
- New Version 0.9.1

* Thu Apr 28 2005 Gerard Milmeister <gemi at bluewin.ch> - 0.9.0-1
- New Version 0.9.0



Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/sbcl/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	12 Sep 2005 12:35:18 -0000	1.1
+++ .cvsignore	12 Sep 2005 12:36:44 -0000	1.2
@@ -0,0 +1,4 @@
+sbcl-0.8.15-powerpc-linux-binary.tar.bz2
+sbcl-0.9.4-source.tar.bz2
+sbcl-0.9.4-x86-64-linux-binary.tar.bz2
+sbcl-0.9.4-x86-linux-binary.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/sbcl/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	12 Sep 2005 12:35:18 -0000	1.1
+++ sources	12 Sep 2005 12:36:44 -0000	1.2
@@ -0,0 +1,4 @@
+3a72d0785ce0a8e02f9af632c2a4f217  sbcl-0.8.15-powerpc-linux-binary.tar.bz2
+a0420dc6236efece72c1c80ee15873c9  sbcl-0.9.4-source.tar.bz2
+67ec41e624a3f2ad7f6f3cde1bd001d3  sbcl-0.9.4-x86-64-linux-binary.tar.bz2
+947d1cde2c1c80416b5f9fb4e4c81383  sbcl-0.9.4-x86-linux-binary.tar.bz2




More information about the fedora-extras-commits mailing list