CMUCL commit: src (5 files)

Raymond Toy rtoy at common-lisp.net
Thu Jul 29 03:51:12 CEST 2010


    Date: Wednesday, July 28, 2010 @ 21:51:12
  Author: rtoy
    Path: /project/cmucl/cvsroot/src

   Added: lisp/exec-final.c
Modified: lisp/Config.sparc_common lisp/GNUmakefile
          tools/SunOS-cmucl-linker-script tools/linker.sh

Change how Solaris executables set up builtin_image_flag.  Instead of
having the address of builtin_image_flag set to some (random) address
of mapped memory that is non-zero, we add a special file to lisp.a
that defines builtin_image_flag to 1.

lisp/Config.sparc_common:
o Define EXEC_FINAL_OBJ

lisp/GNUmakefile:
o Make lisp.a depend on EXEC_FINAL_OBJ
o On Solaris, add EXEC_FINAL_OBJ to lisp.a.

tools/SunOS-cmucl-linker-script:
o Remove the line setting the address of builtin_image_flag.

tools/linker.sh:
o For Solaris, we don't need to define BIFLAG; the builtin_image_flag
  is automatically set correctly by linking in lisp.a


---------------------------------+
 lisp/Config.sparc_common        |    1 +
 lisp/GNUmakefile                |   11 +++++++----
 lisp/exec-final.c               |   15 +++++++++++++++
 tools/SunOS-cmucl-linker-script |    1 -
 tools/linker.sh                 |    9 ++++-----
 5 files changed, 27 insertions(+), 10 deletions(-)


Index: src/lisp/Config.sparc_common
diff -u src/lisp/Config.sparc_common:1.2 src/lisp/Config.sparc_common:1.3
--- src/lisp/Config.sparc_common:1.2	Fri Mar 19 11:19:03 2010
+++ src/lisp/Config.sparc_common	Wed Jul 28 21:51:12 2010
@@ -45,3 +45,4 @@
 OS_SRC = solaris-os.c os-common.c undefineds.c elf.c k_rem_pio2.c
 OS_LINK_FLAGS=
 OS_LIBS= -lsocket -lnsl -ldl
+EXEC_FINAL_OBJ = exec-final.o
Index: src/lisp/GNUmakefile
diff -u src/lisp/GNUmakefile:1.35 src/lisp/GNUmakefile:1.36
--- src/lisp/GNUmakefile:1.35	Mon Jul 12 10:02:49 2010
+++ src/lisp/GNUmakefile	Wed Jul 28 21:51:12 2010
@@ -1,4 +1,4 @@
-# $Header: /project/cmucl/cvsroot/src/lisp/GNUmakefile,v 1.35 2010-07-12 14:02:49 rtoy Exp $
+# $Header: /project/cmucl/cvsroot/src/lisp/GNUmakefile,v 1.36 2010-07-29 01:51:12 rtoy Exp $
 
 all: lisp.nm
 
@@ -34,11 +34,14 @@
 
 # Create a library out of all the object files so we can build an
 # executable.  However, for Solaris, we need to remove exec-init.o
-# because the linker will add the write symbols in.
-lisp.a:	version.o ${OBJS}
-	ar crs lisp.a version.o ${OBJS}
+# because the linker will define symbols with the correct addresses.
+# Also, we need to add EXEC_FINAL on Solaris to define
+# builtin_image_flag with the correct value.
+lisp.a:	version.o ${OBJS} ${EXEC_FINAL_OBJ}
+	ar crs lisp.a ${OBJS} version.o
 ifdef FEATURE_SOLARIS
 	ar d lisp.a exec-init.o
+	ar r lisp.a ${EXEC_FINAL_OBJ}
 endif
 
 version:
Index: src/lisp/exec-final.c
diff -u /dev/null src/lisp/exec-final.c:1.1
--- /dev/null	Wed Jul 28 21:51:13 2010
+++ src/lisp/exec-final.c	Wed Jul 28 21:51:12 2010
@@ -0,0 +1,15 @@
+/*
+ * Variables for executable support.
+ *
+ * $Header: /project/cmucl/cvsroot/src/lisp/exec-final.c,v 1.1 2010-07-29 01:51:12 rtoy Exp $
+ *
+ */
+
+/*
+ * See lisp.c for documentation, but basically this is linked in for
+ * Solaris executables to indicate that the image is builtin.  We must
+ * not define initial_function_addr here because the linker script
+ * will set the value appropriately.
+ */
+int builtin_image_flag = 1;
+
Index: src/tools/SunOS-cmucl-linker-script
diff -u src/tools/SunOS-cmucl-linker-script:1.1 src/tools/SunOS-cmucl-linker-script:1.2
--- src/tools/SunOS-cmucl-linker-script:1.1	Tue Jul 24 15:09:16 2007
+++ src/tools/SunOS-cmucl-linker-script	Wed Jul 28 21:51:12 2010
@@ -18,7 +18,6 @@
 
 {
 	global:
-		builtin_image_flag    = data V at BIFLAG@ S4;
 		initial_function_addr = data V at IFADDR@ S4;
 };
 
Index: src/tools/linker.sh
diff -u src/tools/linker.sh:1.12 src/tools/linker.sh:1.13
--- src/tools/linker.sh:1.12	Tue Jul 27 21:21:31 2010
+++ src/tools/linker.sh	Wed Jul 28 21:51:12 2010
@@ -1,6 +1,6 @@
 #!/bin/sh -x
 
-# $Id: linker.sh,v 1.12 2010-07-28 01:21:31 rtoy Exp $
+# $Id: linker.sh,v 1.13 2010-07-29 01:51:12 rtoy Exp $
 
 # This file was written by Fred Gilham and is placed in the public domain.
 # It comes without warranty of any kind.
@@ -115,11 +115,10 @@
 	LINKER="/usr/ccs/bin/ld"
 	OBJS="-z allextract $CMUCLLIB/lisp.a CORRO.o CORSTA.o CORDYN.o -z defaultextract"
 	SCRIPT="$CMUCLLIB/$OPSYS$VER-cmucl-linker-script"
-	# Is this right?  I just made this point to &main, and the
-	# first word of main isn't all zeros.
-	BIFLAG=$2
+	# Don't need BIFLAG on Solaris.  The lisp.a archive has the
+	# correct value for it.
 	IFADDR=$1
-	sed -e "s;@BIFLAG@;$BIFLAG;" -e "s;@IFADDR@;$IFADDR;" $SCRIPT > $OUTDIR/sunos-map-file
+	sed -e "s;@IFADDR@;$IFADDR;" $SCRIPT > $OUTDIR/sunos-map-file
 	SCRIPT="-M sunos-map-file"
 	# Remove the sunos-map-file when the script exits.
 	trap 'rm -f $OUTDIR/sunos-map-file' 0



More information about the cmucl-commit mailing list