[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] configure and make failed on FreeBSD
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] configure and make failed on FreeBSD |
Date: |
31 Oct 2002 23:11:11 -0500 |
Hi Goto! And thanks for your work on this!
GOTO Kentaro <address@hidden> writes:
> Hi,
>
> Yesterday, some obvious bugs has been fixed. I would attach this patch.
> Could you commit it?
>
> * acconfig.h,h/gclincl.h.in:
> added ISNORMAL() macro but it doesn't exclude the case of denormal.
> It is better to write ISNORMAL() as a function.
I'd prefer not to add this patch, as denormal numbers will give us
problems. Doesn't freebsd have an equivalent?
> * configure,configure.in:
> typo (extra xs after <ieeefp.h>)
Done, thanks!
> * h/FreeBSD.defs: a
> $(CC) must be just `gcc' because a user may be spec. alternative CC.
> * h/FreeBSD.h:
> uses malloc instead of estack_buf which was not defined.
> * o/file.d:listen_stream():
> added missing valiable c.
> * o/file.d:read_fasl_data():
> added missing valiable fp, i.
> * o/run_process.c:
> fixed conflicting the type of init_socket_function(), should be void.
> * o/sfasl.c:
> fixed conflicting the type of malloc(), should be void*.
> * o/unexec.c:
> fixed conflicting the type of unexec(), should be void.
>
All done, or equivalent, thanks!
> I'm not sure if some changes below are right. I would also attach
> this patch but separately.
>
> * h/FreeBSD.defs:
> I dunno suitable value for RSYMS but I'm trying rsym_elf.
> imported SPECIAL_RSYM and SEPALATE_SFASL_FILE from linux.h.
I took the whole RSYM section from linux.defs. The idea here is that
you do not need rsym when using bfd.
> * binutils/bfd/Makefile.in:
> How can I give additional -I and -L paths when I execute gcl/configure?
Not this, way, I'd prefer. What I do is to set the environment
variables, C_INCLUDE_PATH and LIBRARY_PATH. Runtime dynamic linker
library paths can be set via LD_LIBRARY_PATH.
> * unixport/makefile:
> How can I give additional linker flags when I execute gmake?
>
I believe there is an EXTRA_LD_LIBS variable in place already.
> Now, I'm going to get raw_gcl with the both of patches above.
>
> % env TKSH=wish8.0jp TCLSH=tclsh8.0jp CC="ccache gcc" ./configure \
> --enable-statsysbfd=no \
> --enable-locbfd=yes \
> --enable-machine=FreeBSD \
> --prefix=/usr/local
> % gmake CC="ccache gcc" EXTRA_LIBS="-lintl -lreadline"
> [...]
> ccache gcc -o raw_gcl -L. -lgcl -lm -L/usr/local/lib -lc -lgclp -lintl
> -lreadline
> ./libgcl.a(sfasl.o): In function `fasload':
> sfasl.o(.text+0x825): undefined reference to `SEEK_TO_END_OFILE'
> gmake[1]: *** [raw_gcl] Error 1
> gmake[1]: Leaving directory `/home/gotoken/savannah/gcl/unixport'
> gmake: *** [unixport/saved_gcl] Error 2
> %
>
> But I don't see the reason why I get an error message. I couldn't
> find the code position where SEEK_TO_END_OFILE is defined. Neither
> FreeBSD.h nor bsd.h don't define such macro and sfasl.c must not
> include SEEK_TO_END_OFILE because this symbol would be used only if
> #ifdef SEEK_TO_END_OFILE test pass...
>
This is a macro defined for example in linux.h. If Freebsd uses elf,
it can likely copy the same thing. In fact, I'd seriously suggest
starting by trying to configure with --enable-machine=386-linux, or
copying the 386-linux.{h,defs} onto the Freebsd ones, at least as a
start. Much work has already gone in here, and they are bound to be
close.
Thank you!
Take care,
>
> Thanks,
>
>
> Gotoken
>
> 1. I believe it is right:
>
> Index: acconfig.h
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/acconfig.h,v
> retrieving revision 1.19
> diff -u -r1.19 acconfig.h
> --- acconfig.h 27 Oct 2002 21:11:31 -0000 1.19
> +++ acconfig.h 29 Oct 2002 10:23:24 -0000
> @@ -154,7 +154,9 @@
> #include <ieeefp.h>
> #define ISNORMAL(a) (fpclass(a)>=FP_NZERO)
> #else
> -#error "No isnormal found"
> +#define ISNORMAL(a) \
> + ((a) == (a) && (a) != 0 && 1/(a) != 0)
> +/* #error "No isnormal found" */
> #endif
> #endif
> #endif
> Index: configure
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/configure,v
> retrieving revision 1.87
> diff -u -r1.87 configure
> --- configure 29 Oct 2002 04:50:13 -0000 1.87
> +++ configure 29 Oct 2002 10:23:27 -0000
> @@ -4028,7 +4028,7 @@
> #line 4029 "configure"
> #include "confdefs.h"
> #include <math.h>
> - #include <ieeefp.h>xs
> + #include <ieeefp.h>
> int main() {
> float f;
> return finite(f) || !finite(f) ? 0 : 1;
> Index: configure.in
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/configure.in,v
> retrieving revision 1.90
> diff -u -r1.90 configure.in
> --- configure.in 29 Oct 2002 04:50:13 -0000 1.90
> +++ configure.in 29 Oct 2002 10:23:28 -0000
> @@ -805,7 +805,7 @@
> AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
> AC_MSG_CHECKING([for finite()])
> AC_TRY_RUN([#include <math.h>
> - #include <ieeefp.h>xs
> + #include <ieeefp.h>
> int main() {
> float f;
> return finite(f) || !finite(f) ? 0 : 1;
> Index: h/FreeBSD.defs
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/h/FreeBSD.defs,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 FreeBSD.defs
> --- h/FreeBSD.defs 6 Dec 1999 22:44:02 -0000 1.1.1.1
> +++ h/FreeBSD.defs 29 Oct 2002 10:23:32 -0000
> @@ -4,8 +4,9 @@
>
> LBINDIR=/usr/local/bin
>
> -OFLAG = -O2 -pipe
> -LIBS = -lm
> +OFLAG = -pipe -O2
> +CFLAGS = -fwritable-strings -fomit-frame-pointer -DVOL=volatile
> -I$(GCLDIR)/o -I/usr/local/lib/gcl-2.0/h -fsigned-char -I/usr/local/lib
> +LIBS = -lm -L/usr/local/lib
> ODIR_DEBUG=
> NULLFILE=../h/twelve_null
>
> @@ -13,7 +14,7 @@
> # and also in the compiler::*cc* variable for later compilation of
> # lisp files.
>
> -CC = gcc -pipe -O -fwritable-strings -fomit-frame-pointer -DVOL=volatile
> -I$(GCLDIR)/o -I/usr/local/lib/gcl-2.0/h -fsigned-char
> +CC = gcc
>
> LDCC = $(CC) -static
>
> Index: h/FreeBSD.h
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/h/FreeBSD.h,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 FreeBSD.h
> --- h/FreeBSD.h 6 Dec 1999 22:44:02 -0000 1.1.1.1
> +++ h/FreeBSD.h 29 Oct 2002 10:23:32 -0000
> @@ -61,11 +61,13 @@
> #define PAGEWIDTH 12 /* i386 sees 4096 byte pages */
> /* end for GC */
>
> +#define HAVE_SIGPROCMASK
> #define SIG_STACK_SIZE (SIGSTKSZ/sizeof(double))
> #define SETUP_SIG_STACK \
> { \
> static struct sigaltstack estack; \
> - estack.ss_sp = estack_buf; \
> + if ((estack.ss_sp = malloc(SIGSTKSZ)) == NULL) \
> + perror("malloc"); \
> estack.ss_size = SIGSTKSZ; \
> estack.ss_flags = 0; \
> if (sigaltstack(&estack, 0) < 0) \
> Index: h/gclincl.h.in
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/h/gclincl.h.in,v
> retrieving revision 1.24
> diff -u -r1.24 gclincl.h.in
> --- h/gclincl.h.in 27 Oct 2002 21:11:31 -0000 1.24
> +++ h/gclincl.h.in 29 Oct 2002 10:23:32 -0000
> @@ -109,7 +109,9 @@
> #include <ieeefp.h>
> #define ISNORMAL(a) (fpclass(a)>=FP_NZERO)
> #else
> -#error "No isnormal found"
> +#define ISNORMAL(a) \
> + ((a) == (a) && (a) != 0 && 1/(a) != 0)
> +/* #error "No isnormal found" */
> #endif
> #endif
> #endif
> Index: o/file.d
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/o/file.d,v
> retrieving revision 1.15
> diff -u -r1.15 file.d
> --- o/file.d 24 Sep 2002 19:01:45 -0000 1.15
> +++ o/file.d 29 Oct 2002 10:23:34 -0000
> @@ -1157,7 +1157,9 @@
>
> bool
> listen_stream(object strm) {
> -
> +#ifdef LISTEN_FOR_INPUT
> + int c;
> +#endif
> BEGIN:
>
> switch (strm->sm.sm_mode) {
> @@ -2435,7 +2437,9 @@
> {
> object faslfile, data;
> #ifdef UNIX
> + FILE *fp;
> #ifdef BSD
> + int i;
> #ifdef HAVE_AOUT
> struct exec header;
> #endif
> Index: o/run_process.c
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/o/run_process.c,v
> retrieving revision 1.3
> diff -u -r1.3 run_process.c
> --- o/run_process.c 20 Jul 2002 07:10:56 -0000 1.3
> +++ o/run_process.c 29 Oct 2002 10:23:34 -0000
> @@ -309,6 +309,7 @@
> make_socket_pair();
> }
>
> +void
> init_socket_function()
> {
> make_si_function("MAKE-SOCKET-STREAM", siLmake_socket_stream);
> Index: o/sfasl.c
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/o/sfasl.c,v
> retrieving revision 1.9
> diff -u -r1.9 sfasl.c
> --- o/sfasl.c 24 Sep 2002 03:08:33 -0000 1.9
> +++ o/sfasl.c 29 Oct 2002 10:23:34 -0000
> @@ -46,7 +46,7 @@
> struct node * find_sym();
> int node_compare();
> #ifndef _WIN32
> -char *malloc();
> +void *malloc();
> char *bsearch();
> #endif
> Index: o/unexec.c
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/o/unexec.c,v
> retrieving revision 1.4
> diff -u -r1.4 unexec.c
> --- o/unexec.c 20 Jul 2002 07:10:56 -0000 1.4
> +++ o/unexec.c 29 Oct 2002 10:23:35 -0000
> @@ -366,6 +366,7 @@
> *
> * driving logic.
> */
> +void
> unexec (char *new_name, char *a_name, unsigned int data_start, unsigned int
> bss_start, unsigned int entry_address)
> {
> int new, a_out = -1;
>
> 2. I'm not sure if it is right:
>
> Index: h/FreeBSD.defs
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/h/FreeBSD.defs,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 FreeBSD.defs
> --- h/FreeBSD.defs 6 Dec 1999 22:44:02 -0000 1.1.1.1
> +++ h/FreeBSD.defs 29 Oct 2002 10:23:32 -0000
> @@ -23,7 +24,7 @@
>
> # Enable the fastloading mechanism which does not use ld -A
> # requires c/rel_.. machine dependent code.
> -RSYM = rsym
> +RSYM = rsym_elf
> SFASL = $(ODIR)/sfasl.o
>
> # When using SFASL it is good to have (si::build-symbol-table)
> Index: h/FreeBSD.h
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/h/FreeBSD.h,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 FreeBSD.h
> --- h/FreeBSD.h 6 Dec 1999 22:44:02 -0000 1.1.1.1
> +++ h/FreeBSD.h 29 Oct 2002 10:23:32 -0000
> @@ -75,6 +77,21 @@
> #define INSTALL_SEGMENTATION_CATCHER \
> (void) gcl_signal(SIGSEGV, segmentation_catcher); \
> (void) gcl_signal(SIGBUS, segmentation_catcher)
> +
> +#ifdef USE_DLOPEN
> +#define SPECIAL_RSYM "rsym_elf.c"
> +#define SEPARATE_SFASL_FILE "fasldlsym.c"
> +#else
> +#ifdef HAVE_LIBBFD
> +#define SEPARATE_SFASL_FILE "sfaslbfd.c"
> +#else
> +#if !defined(__i386__) && !defined(__sparc__)
> +#error Can only do non-bfd relocs for i386 and sparc
> +#endif
> +#define SPECIAL_RSYM "rsym_elf.c"
> +#define SEPARATE_SFASL_FILE "sfaslelf.c"
> +#endif
> +#endif
>
> /*
> * The next two defines are for SGC,
> Index: binutils/bfd/Makefile.in
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/binutils/bfd/Makefile.in,v
> retrieving revision 1.3
> diff -u -r1.3 Makefile.in
> --- binutils/bfd/Makefile.in 13 Aug 2002 03:59:56 -0000 1.3
> +++ binutils/bfd/Makefile.in 29 Oct 2002 10:23:29 -0000
> @@ -237,7 +237,7 @@
>
> DEFS = @DEFS@ -I. -I$(srcdir) -I.
> CPPFLAGS = @CPPFLAGS@
> -LDFLAGS = @LDFLAGS@
> +LDFLAGS = @LDFLAGS@ -L/usr/local/lib
> LIBS = @LIBS@
> libbfd_a_LIBADD =
> libbfd_a_OBJECTS =
> @@ -247,7 +247,7 @@
> corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \
> syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \
> ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo
> -CFLAGS = @CFLAGS@
> +CFLAGS = @CFLAGS@ -I/usr/local/include
> COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
> $(CFLAGS)
> LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES)
> $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
> CCLD = $(CC)
> Index: unixport/makefile
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/unixport/makefile,v
> retrieving revision 1.37
> diff -u -r1.37 makefile
> --- unixport/makefile 15 Oct 2002 18:38:38 -0000 1.37
> +++ unixport/makefile 29 Oct 2002 10:23:36 -0000
> @@ -14,7 +14,7 @@
>
> OLDDATE = "DATE"
>
> -LD_LIBS=$(addprefix -u ,$(PATCHED_SYMBOLS)) -lgcl $(LIBS) $(LIBC) -lgclp
> +LD_LIBS=$(addprefix -u ,$(PATCHED_SYMBOLS)) -lgcl $(LIBS) $(LIBC) -lgclp
> $(EXTRA_LIBS)
>
> libgclp.a: $(ODIR)/gcllib.a
> cp $< $@
>
> # end of patches
>
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- [Gcl-devel] configure and make failed on FreeBSD, (continued)
- [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/23
- Re: [Gcl-devel] configure and make failed on FreeBSD, Camm Maguire, 2002/10/23
- Re: [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/23
- Re: [Gcl-devel] configure and make failed on FreeBSD, Camm Maguire, 2002/10/25
- Re: [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/25
- Re: [Gcl-devel] configure and make failed on FreeBSD, Camm Maguire, 2002/10/26
- Re: [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/26
- Re: [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/29
- Re: [Gcl-devel] configure and make failed on FreeBSD, GOTO Kentaro, 2002/10/30
- Re: [Gcl-devel] configure and make failed on FreeBSD, Camm Maguire, 2002/10/31
- Re: [Gcl-devel] configure and make failed on FreeBSD,
Camm Maguire <=