gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Porting to NetBSD x86


From: Richard M Kreuter
Subject: [Gcl-devel] Porting to NetBSD x86
Date: Thu, 16 Dec 2004 19:11:50 -0500
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (berkeley-unix)

Hi,

I'm trying to port GCL's CVS to NetBSD on a PC.  By randomly hacking
on the FreeBSD and OpenBSD defs and headers, I can get part way
through the build, but compiling the lisp files fails at
gcl_sloop.lsp, with this error message and backtrace:

| Error: The storage for STRING is exhausted.
|        Currently, 30 pages are allocated.
|        Use ALLOCATE to expand the space.
| Backtrace: system::gcl-top-level > if > let > setq >
| system:error-set > system:error-set > progn > compile-file > loop >
| setq > apply > apply > compiler::compile-file1 > let >
| unwind-protect > progn > let* > let > unwind-protect > progn > when
| > compiler::compiler-pass2 > let > unwind-protect > progn > let >
| let > unwind-protect > progn > catch > compiler::ctop-write > do* >
| when > apply > apply > compiler::t3defun > cond >
| compiler::t3defun-aux > let* > apply > apply >
| compiler::t3defun-local-entry > let > compiler::c2expr > if > if >
| let > cond > apply > apply > compiler::c2case > if >
| compiler::c2expr > if > if > let > cond > apply > apply >
| compiler::c2progn > do > let* > compiler::c2expr > if > if > let >
| apply > apply > compiler::c2let* > do > case > let >
| compiler::c2expr* > let* > compiler::c2expr > if > if > let > cond >
| apply > apply > compiler::c2var > compiler::unwind-exit > do* > cond
| > cond > cond > if > compiler::set-loc > cond > apply > apply >
| compiler::set-var > unless > case > funcall > compiler::wt-nl > if >
| if > do* > list* > list > concatenate > do > make-sequence > setq >
| system::best-array-element-type > cond > subtypep > cond > or >
| equal > string > system:universal-error-handler > let > let > cond >
| apply > apply > system:universal-error-handler > system::break-level
| > let* > UNLESS

After this, the C compiler's not very happy with the resultant gcl
output.

I've appended NetBSD.defs and NetBSD.h, in case they matter.  These
two files aren't likely to be correct yet.  The configure command was:

| CC=/usr/local/bin/gcc \
|   CPPFLAGS='-I/usr/pkg/include -I/usr/X11R6/include' \
|   CFLAGS='-L/usr/pkg/lib -L/usr/X11R6/lib' \
|   LDFLAGS='-Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R6/lib' \
|   ./configure --enable-machine=NetBSD --enable-locbfd \
|   --disable-dlopen --disable-dynsysbfd --disable-statsysbfd \
|   --disable-custreloc

Can anybody offer any insight?

Thank you,
Richard Kreuter

-- NetBSD.defs --
# Machine dependent makefile definitions for intel 386,486 running 386bsd
# Ported to OpenBSD 2.7 by Justin Smith 
# 10/3/2000
# Modified for NetBSD 2.0 by Richard M Kreuter
# 12/16/2004, Beethoven's Birthday
LBINDIR=/usr/local/bin

OFLAG   = -O2 -pipe
# For now, exclue tcl -- RmK
#LIBS    = -lm -ltk80 -ltcl80 -lX11 -lXt
LIBS    = -lm -lX11 -lXt -lintl
ODIR_DEBUG=
NULLFILE=../h/twelve_null

# This CC string will be used for compilation of the system,
# and also in the compiler::*cc* variable for later compilation of
# lisp files.

# For now, exclue tcl, delete /usr/local include and lib, and add
# /usr/pkg (for libbfd from the binutils pkg), added gcc/ld flags for
# rpath locations of pkg and X11 libs.  -- RmK
#CC = gcc -pipe -O2 -fwritable-strings -fomit-frame-pointer -DVOL=volatile 
-I$(GCLDIR)/o -I/usr/local/lib/gcl-2.3/h -I../h -I/usr/local/include 
-I/usr/local/include/tk8.0 -I/usr/local/include/tcl8.0 -I/usr/X11R6/include 
-fsigned-char -L/usr/local/lib -L/usr/X11R6/lib
CC = gcc -pipe -O2 -fwritable-strings -fomit-frame-pointer -DVOL=volatile 
-I$(GCLDIR)/o -I/usr/local/lib/gcl-2.3/h -I../h -I/usr/pkg/include 
-I/usr/X11R6/include -fsigned-char -L/usr/pkg/lib -L/usr/X11R6/lib 
-Wl,-R/usr/pkg/lib -Wl,-R/usr/X11R6/lib

LDCC = $(CC)  -static -L/usr/local/lib -L/usr/X11R6/lib

#  Use the mp.s file on 68k machine 
MPFILES= $(MPDIR)/mpi-386.o $(MPDIR)/libmport.a

# NetBSD is an elf platform, like FreeBSD, GNU/Linux.  Dunno if
# OpenBSD was when gcl was last ported there.
# Enable the fastloading mechanism which does not use ld -A
# requires c/rel_.. machine dependent code.
#RSYM   = rsym
#SFASL  = $(ODIR)/sfasl.o
# Enable the fastloading mechanism which does not use ld -A
# requires c/rel_.. machine dependent code.
RSYM    = rsym
ifneq ($(findstring bfd,$(LIBS)),) 
RSYM    = 
endif
ifneq ($(BUILD_BFD),) 
RSYM    = 
endif
SFASL   = $(ODIR)/sfasl.o

# When using SFASL it is good to have (si::build-symbol-table)
INITFORM=(si::build-symbol-table)

# Use symbolic links
SYMB=-s

LIBFILES=bsearch.o

# the  make to use for saved_kcp the profiler.
KCP=kcp-bsd



-- NetBSD.h --
/*
 * OpenBSD.h for gcl 1.1
 * NetBSD.h for gcl 2.7 cvs, 16 Dec 2004.
 * This file started with the text of OpenBSD.h, and then started
 * mixing FreeBSD.h in.
 *
 */

/* We #include linux.h, which #includes bsd.h. */
/* #include "bsd.h" */

#ifndef __ELF__
#error NetBSD systems use ELF
#endif

#if !defined(ElfW)
#define ElfW(a) Mjoin(Elf,Mjoin(__ELF_NATIVE_CLASS,Mjoin(_,a)))
#endif
#define ELFW(a) Mjoin(ELF,Mjoin(__ELF_NATIVE_CLASS,Mjoin(_,a)))
 
/* OpenBSD needs sys/types.h included before link.h, which is included
   in linux.h */
#include <sys/types.h>
#if defined(HAVE_ELF_H)
#include <elf.h>
#elif defined(HAVE_ELF_ABI_H)
#include <elf_abi.h>
#endif
#include "linux.h"

#undef LD_COMMAND
#define LD_COMMAND(command,main,start,input,ldarg,output) \
  sprintf(command, "ld -dc -N -x -A %s -T %x %s %s -o %s", \
            main,start,input,ldarg,output)

#define ADDITIONAL_FEATURES \
                     ADD_FEATURE("386BSD");\
                     ADD_FEATURE("NetBSD");

#if defined(__i386__)
#define __ELF_NATIVE_CLASS 32
#endif

#if defined(__i386__)
#define I386
#endif
#define IEEEFLOAT

/* we don't need to worry about zeroing fp->_base, to prevent what??? */
#define FCLOSE_SETBUF_OK 

#undef HAVE_XDR

#define USE_ATT_TIME

#undef LISTEN_FOR_INPUT
#define LISTEN_FOR_INPUT(fp)                                    \
do {                                                            \
        int c = 0;                                              \
                                                                \
        if (                                                    \
                (fp)->_r <= 0 &&                                \
                    (ioctl((fp)->_file, FIONREAD, &c), c <= 0)  \
        )                                                       \
                return(FALSE);                                  \
} while (0)

#ifdef IN_GBC
#include <sys/types.h>
#endif

#define DATA_BEGIN (char *) N_DATADDR(header);
#define A_TEXT_OFFSET(x) (sizeof (struct exec))
#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
#define start_of_data() &etext
#define start_of_text() ((char *)(sizeof(struct exec) + getpagesize()))

#define UNIXSAVE "unexelf.c"
/*#undef UNIXSAVE
#ifdef UNIXSAVE 
 extern char etext;
#endif */

#define RELOC_FILE "rel_sun3.c" /* for SFASL - enabled in bsd.h */

#ifdef CLOCKS_PER_SEC
#define HZ CLOCKS_PER_SEC
#else
#define HZ 128
#endif
#define ss_base ss_sp

/* begin for GC */
#define PAGEWIDTH 12            /* i386 sees 4096 byte pages */
/* end for GC */

#define SIG_STACK_SIZE (SIGSTKSZ/sizeof(double))
/* First compile failed because estack_buf wasn't defined. */
#define SETUP_SIG_STACK \
  {                                        \
    static struct sigaltstack estack;      \
    double estack_buf[SIG_STACK_SIZE];             \
    estack.ss_sp = (char *) &estack_buf;           \
    estack.ss_size = SIGSTKSZ;                     \
    estack.ss_flags = 0;                           \
    if (sigaltstack(&estack, 0) < 0)               \
      perror("sigaltstack");                       \
  }

/* NetBSD uses only SIGSEGV only protection faults. */
#define INSTALL_SEGMENTATION_CATCHER \
         (void) gcl_signal(SIGSEGV, segmentation_catcher)
/*       (void) gcl_signal(SIGBUS, segmentation_catcher) */

#define SIGPROTV SIGSEGV

#ifdef IN_GBC
#undef MPROTECT_ACTION_FLAGS
#define MPROTECT_ACTION_FLAGS SA_RESTART|SA_SIGINFO
#define GET_FAULT_ADDR(sig,code,sv,a) \
 ((siginfo_t *)code)->si_addr
#endif

/*
 * The next two defines are for SGC,
 *      one of which needs to go in cmpinclude.h.
 */

/* Begin for cmpinclude */
#define SGC     /* can mprotect pages and so selective gc will work */

/* End for cmpinclude */

#if defined(IN_UNIXTIME)
# include <time.h>
#endif
--





reply via email to

[Prev in Thread] Current Thread [Next in Thread]