Skip to content
Snippets Groups Projects
Commit f68a9500 authored by agoncharov's avatar agoncharov
Browse files

EXECUTABLE seems to work on FreeBSD now. TODO: mv tools/linker-x86.sh tools/linker.sh

parent 069f884d
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@
* Much hacked by Paul Werkowski
* GENCGC support by Douglas Crosher, 1996, 1997.
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.35 2010/09/07 03:56:38 agoncharov Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.36 2010/09/08 03:28:08 agoncharov Rel $
*
*/
......@@ -308,7 +308,6 @@ void *
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);
......
......@@ -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 Rel $
*/
#include <stdio.h>
......@@ -358,18 +358,17 @@ obj_run_linker(long init_func_address, char *file)
}
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
......
/* $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>
......
#!/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 @@ CMUCLLIB=`dirname $0`
# 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 @@ case `uname` in
#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 @@ case `uname` in
# 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 @@ case `uname` in
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment