CMUCL commit: src (4 files)
Alex Goncharov
agoncharov at common-lisp.net
Wed Sep 8 05:28:08 CEST 2010
Date: Tuesday, September 7, 2010 @ 23:28:08
Author: agoncharov
Path: /project/cmucl/cvsroot/src
Modified: lisp/FreeBSD-os.c lisp/elf.c lisp/elf.h tools/linker-x86.sh
EXECUTABLE seems to work on FreeBSD now. TODO: mv tools/linker-x86.sh tools/linker.sh
---------------------+
lisp/FreeBSD-os.c | 3 +--
lisp/elf.c | 7 +++----
lisp/elf.h | 6 +-----
tools/linker-x86.sh | 20 +++++++++++++-------
4 files changed, 18 insertions(+), 18 deletions(-)
Index: src/lisp/FreeBSD-os.c
diff -u src/lisp/FreeBSD-os.c:1.35 src/lisp/FreeBSD-os.c:1.36
--- src/lisp/FreeBSD-os.c:1.35 Mon Sep 6 23:56:38 2010
+++ src/lisp/FreeBSD-os.c Tue Sep 7 23:28:08 2010
@@ -12,7 +12,7 @@
* Much hacked by Paul Werkowski
* GENCGC support by Douglas Crosher, 1996, 1997.
*
- * $Header: /project/cmucl/cvsroot/src/lisp/FreeBSD-os.c,v 1.35 2010-09-07 03:56:38 agoncharov Exp $
+ * $Header: /project/cmucl/cvsroot/src/lisp/FreeBSD-os.c,v 1.36 2010-09-08 03:28:08 agoncharov Exp $
*
*/
@@ -308,7 +308,6 @@
os_dlsym(const char *sym_name, lispobj lib_list)
{
static void *program_handle;
- void *sym_addr = 0;
if (!program_handle)
program_handle = dlopen((void *) 0, RTLD_LAZY | RTLD_GLOBAL);
Index: src/lisp/elf.c
diff -u src/lisp/elf.c:1.29 src/lisp/elf.c:1.30
--- src/lisp/elf.c:1.29 Mon Aug 2 17:59:43 2010
+++ src/lisp/elf.c Tue Sep 7 23:28:08 2010
@@ -8,7 +8,7 @@
Above changes put into main CVS branch. 05-Jul-2007.
- $Id: elf.c,v 1.29 2010-08-02 21:59:43 rtoy Exp $
+ $Id: elf.c,v 1.30 2010-09-08 03:28:08 agoncharov Exp $
*/
#include <stdio.h>
@@ -358,18 +358,17 @@
}
if (stat(command, &st) == 0) {
- extern int main();
-
free(paths);
printf("\t[%s: linking %s... \n", command, file);
fflush(stdout);
-#if defined(__linux__) || defined(sparc)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(sparc)
sprintf(command_line, "%s %s 0x%lx '%s' 0x%lx 0x%lx 0x%lx", command,
C_COMPILER, init_func_address, file,
(unsigned long) READ_ONLY_SPACE_START,
(unsigned long) STATIC_SPACE_START,
(unsigned long) DYNAMIC_0_SPACE_START);
#else
+ extern int main();
sprintf(command_line, "%s %s 0x%lx 0x%lx %s", command, C_COMPILER,
init_func_address, (unsigned long) &main, file);
#endif
Index: src/lisp/elf.h
diff -u src/lisp/elf.h:1.13 src/lisp/elf.h:1.14
--- src/lisp/elf.h:1.13 Fri Jul 30 21:07:15 2010
+++ src/lisp/elf.h Tue Sep 7 23:28:08 2010
@@ -1,4 +1,4 @@
-/* $Id: elf.h,v 1.13 2010-07-31 01:07:15 rtoy Exp $ */
+/* $Id: elf.h,v 1.14 2010-09-08 03:28:08 agoncharov Exp $ */
/* This code was written by Fred Gilham and has been placed in the public domain. It is
provided "AS-IS" and without warranty of any kind.
@@ -13,16 +13,12 @@
#define _ELF_H_INCLUDED_
-#if defined(__linux__) || defined(DARWIN) || defined(sparc)
/*
* Yes, it's named badly. But it works for sparc too, not just x86.
* If we ever get this fixed on FreeBSD, then we can move
* linker-x86.sh to linker.sh and be done with it.
*/
#define LINKER_SCRIPT "linker-x86.sh"
-#else
-#define LINKER_SCRIPT "linker.sh"
-#endif
#if defined(SOLARIS)
#include <sys/elf.h>
Index: src/tools/linker-x86.sh
diff -u src/tools/linker-x86.sh:1.9 src/tools/linker-x86.sh:1.10
--- src/tools/linker-x86.sh:1.9 Mon Aug 2 17:45:36 2010
+++ src/tools/linker-x86.sh Tue Sep 7 23:28:08 2010
@@ -1,6 +1,6 @@
#!/bin/sh
-# $Id: linker-x86.sh,v 1.9 2010-08-02 21:45:36 rtoy Exp $
+# $Id: linker-x86.sh,v 1.10 2010-09-08 03:28:08 agoncharov Exp $
# This file written by Raymond Toy as part of CMU Common Lisp and is
# placed in the public domain.
@@ -44,11 +44,13 @@
# Name of file where we write the actual initial function address.
OPT_IFADDR="cmu-ifaddr-$$.c"
+OPT_IFADDR="cmu-ifaddr-alex.c"
# Names of the core sections from Lisp.
OPT_CORE="CORRO.o CORSTA.o CORDYN.o"
-case `uname` in
- Linux*)
+uname_s=`uname`
+case $uname_s in
+ Linux|FreeBSD)
# How to specify the starting address for each of the sections
# These aren't needed for Linux any more. map_core_sections
# takes care of getting the addresses.
@@ -57,7 +59,7 @@
#STATIC_ADDR="-Wl,--section-start=CORSTA=$5"
#DYN_ADDR="-Wl,--section-start=CORDYN=$6"
- #OPT_IFADDR="-Wl,--defsym -Wl,initial_function_addr=$IFADDR"
+ #OPT_IF ADDR="-Wl,--defsym -Wl,initial_function_addr=$IFADDR"
# Specify how to link the entire lisp.a library
OPT_ARCHIVE="-Wl,--whole-archive -Wl,$CMUCLLIB/lisp.a -Wl,--no-whole-archive"
@@ -65,8 +67,12 @@
# Extra stuff.
OPT_EXTRA="-rdynamic"
- # See Config.x86_linux
- OS_LIBS=-ldl
+
+ # See Config.x86_${uname_s}
+ case $uname_s in
+ Linux) OS_LIBS=-ldl;;
+ FreeBSD) OS_LIBS=-lutil;;
+ esac
;;
Darwin*)
# How to specify the starting address for each of the sections.
@@ -114,7 +120,7 @@
esac
# Remove the C file when we're done.
-trap 'rm -f $OUTDIR/$OPT_IFADDR $OUTDIR/CORRO.o $OUTDIR/CORSTA.o $OUTDIR/CORDYN.o' 0
+# trap 'rm -f $OUTDIR/$OPT_IFADDR $OUTDIR/CORRO.o $OUTDIR/CORSTA.o $OUTDIR/CORDYN.o' 0
(cd $OUTDIR
echo "long initial_function_addr = $IFADDR;" > $OPT_IFADDR
More information about the cmucl-commit
mailing list