[Ecls-list] gmp bitness on 32bit msvc
red plait
redplait at gmail.com
Wed Feb 15 13:06:31 UTC 2012
Hi
I make simple patch to build 64bit gmp on win32:
*** msvc\Makefile.old Wed Feb 15 16:01:44 2012
--- msvc\Makefile Wed Feb 15 16:40:58 2012
*************** ECL_DEFSYS =
*** 60,65 ****
--- 60,68 ----
# Profiling
ECL_PROFILE =
+ # Bitness of numbers - set it to non-empty to build 64bit numbers on win32
+ ECL_64BITS = 1
+
# <END> (ECL configuration)
# =============================================================
*************** GC_CPU=AMD64
*** 91,97 ****
--- 94,106 ----
ARCHITECTURE=AMD64
VCREDIST=vcredist_x64.exe
!else
+ !if "$(ECL_64BITS)" != ""
+ GMP_BITS=64
+ ECL_BITS64=/D BITS64
+ !else
GMP_BITS=32
+ ECL_BITS64=
+ !endif
GC_CPU=i386
ARCHITECTURE=PENTIUM4
VCREDIST=vcredist_x86.exe
*************** VCREDIST=vcredist_x86.exe
*** 102,114 ****
#
!if "$(ECL_DEBUG)" != ""
CFLAGS_OPTIMIZE = /Od
! CFLAGS_CONFIG = /Zi /D_DEBUG /MDd $(CFLAGS_OPTIMIZE) $(CFLAGS_SSE)
LDFLAGS_CONFIG = /debug /nodefaultlib:msvcrt.lib
SHARED_LDFLAGS = /LDd
GCFLAGS =
!else
CFLAGS_OPTIMIZE = /O2
! CFLAGS_CONFIG = /DNDEBUG /MD $(CFLAGS_OPTIMIZE) $(CFLAGS_SSE)
LDFLAGS_CONFIG = /nodefaultlib:msvcrtd.lib
SHARED_LDFLAGS = /LD
GCFLAGS = nodebug=1
--- 111,123 ----
#
!if "$(ECL_DEBUG)" != ""
CFLAGS_OPTIMIZE = /Od
! CFLAGS_CONFIG = /Zi /D_DEBUG /MDd $(CFLAGS_OPTIMIZE) $(CFLAGS_SSE)
$(ECL_BITS64)
LDFLAGS_CONFIG = /debug /nodefaultlib:msvcrt.lib
SHARED_LDFLAGS = /LDd
GCFLAGS =
!else
CFLAGS_OPTIMIZE = /O2
! CFLAGS_CONFIG = /DNDEBUG /MD $(CFLAGS_OPTIMIZE) $(CFLAGS_SSE) $(ECL_BITS64)
LDFLAGS_CONFIG = /nodefaultlib:msvcrtd.lib
SHARED_LDFLAGS = /LD
GCFLAGS = nodebug=1
*************** eclgc.lib:
*** 352,358 ****
eclgmp.lib:
cd gmp
$(MAKE) "MPN_TYPE=$(GMP_TYPE)" "CFLAGS_CONFIG=$(CFLAGS_CONFIG)" \
! "BITS=$(GMP_BITS)"
$(CP) gmp.lib ..\eclgmp.lib
$(CP) gmp.h ..\ecl\gmp.h
cd ..
--- 361,367 ----
eclgmp.lib:
cd gmp
$(MAKE) "MPN_TYPE=$(GMP_TYPE)" "CFLAGS_CONFIG=$(CFLAGS_CONFIG)" \
! "BITS=$(GMP_BITS)" "BITS64=$(ECL_BITS64)"
$(CP) gmp.lib ..\eclgmp.lib
$(CP) gmp.h ..\ecl\gmp.h
cd ..
*** msvc\gmp\build.vc8\gmp.h.old Wed Feb 15 16:22:43 2012
--- msvc\gmp\build.vc8\gmp.h Wed Feb 15 16:20:10 2012
*************** MA 02110-1301, USA. */
*** 30,47 ****
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
# if defined( _MSC_VER )
! # if defined( _WIN64 )
# define __GMP_BITS_PER_MP_LIMB 64
# define GMP_LIMB_BITS 64
# define SIZEOF_MP_LIMB_T 8
! # define _LONG_LONG_LIMB 1
# elif defined( _WIN32 )
# define __GMP_BITS_PER_MP_LIMB 32
# define GMP_LIMB_BITS 32
# define SIZEOF_MP_LIMB_T 4
! # ifdef _LONG_LONG_LIMB
! # undef _LONG_LONG_LIMB
! # endif
# else
# error This is the wrong version of gmp.h
# endif
--- 30,47 ----
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
# if defined( _MSC_VER )
! # if defined( _WIN64 ) || defined( BITS64 )
# define __GMP_BITS_PER_MP_LIMB 64
# define GMP_LIMB_BITS 64
# define SIZEOF_MP_LIMB_T 8
! # define _LONG_LONG_LIMB 1
# elif defined( _WIN32 )
# define __GMP_BITS_PER_MP_LIMB 32
# define GMP_LIMB_BITS 32
# define SIZEOF_MP_LIMB_T 4
! # if defined(_LONG_LONG_LIMB)
! # undef _LONG_LONG_LIMB
! # endif
# else
# error This is the wrong version of gmp.h
# endif
But builded ecl-min hangs on loading of iolib.lsp:
;;;
;;; Welcome to bare.lsp. Let's bring this instance up
;;;
;;;
;;; About to load lsp/load.lsp
;;;
;;; Loading src:lsp;export.lsp
;;; Loading src:lsp;defmacro.lsp
;;; Loading src:lsp;helpfile.lsp
;;; Loading src:lsp;evalmacros.lsp
;;; Loading src:lsp;cmuutil.lsp
;;; Loading src:lsp;setf.lsp
;;; Loading src:lsp;predlib.lsp
;;; Loading src:lsp;seq.lsp
;;; Loading src:lsp;arraylib.lsp
;;; Loading src:lsp;assert.lsp
;;; Loading src:lsp;defstruct.lsp
;;; Loading src:lsp;iolib.lsp
Debugger shows following callstack:
> ecl_min.exe!prepare_ratio_to_float(cl_lispunion * num=0x01800003, cl_lispunion * den=0x011228e0, int digits=0x00000035, int * scaleout=0x0012d7f8) Line 677 C
ecl_min.exe!ratio_to_double(cl_lispunion * num=0x0000000f,
cl_lispunion * den=0x0000000b) Line 718 + 0x13 bytes C
ecl_min.exe!ecl_to_double(cl_lispunion * x=0x010410b0) Line 755 +
0x13 bytes C
ecl_min.exe!make_float(cl_lispunion * num=0x010410b0, cl_lispunion *
exp=0xffffffff, unsigned int exp_char=0x00000046, int sign=0x00000001)
Line 93 + 0xf bytes C
ecl_min.exe!ecl_parse_number(cl_lispunion * str=0x00bbb528, unsigned
int start=0x00000000, unsigned int end=0x00000003, unsigned int *
ep=0x0012d8d0, unsigned int radix=0x0000000a) Line 220 + 0x25 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_whitespace) Line 358 + 0x1a bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0xffffffff, int flags=0x00000000,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!ecl_read_object(cl_lispunion * in=0x00fc5dc0) Line 404
+ 0xf bytes C
ecl_min.exe!cl_read(int narg=0x00000004, ...) Line 1388 + 0x9 bytes C
ecl_min.exe!APPLY(int n=0x00000004, cl_lispunion * (int, <no type>)*
fn=0x00417fe0, cl_lispunion * * x=0x00bf0048) Line 29 + 0x22 bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012e2a4,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7ae38)
Line 497 + 0x14 bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012e5dc,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7ae10)
Line 528 + 0x12 bytes C
ecl_min.exe!_ecl_bytecodes_dispatch_vararg(int narg=0xffffffff, ...)
Line 193 + 0x18 bytes C
ecl_min.exe!dispatch_macro_character(cl_lispunion *
table=0x00b94690, cl_lispunion * in=0x00fc5dc0, int c=0x0000002b)
Line 584 + 0x22 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0x00000029, int flags=0x00000000,
ecl_chattrib a=cat_non_terminating) Line 200 + 0x11 bytes C
ecl_min.exe!do_read_delimited_list(int d=0x00000029, cl_lispunion *
in=0x00fc5dc0, int proper_list=0x00000000) Line 1436 + 0x11 bytes C
ecl_min.exe!left_parenthesis_reader(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * character=0x000000a2) Line 437 + 0x18 bytes C
ecl_min.exe!dispatch2(int narg=0x00000002, cl_lispunion *
x0=0x00fc5dc0, cl_lispunion * x1=0x000000a2) Line 24 + 0x10 bytes C
ecl_min.exe!ecl_read_object_with_delimiter(cl_lispunion *
in=0x00fc5dc0, int delimiter=0xffffffff, int flags=0x00000003,
ecl_chattrib a=cat_terminating) Line 202 + 0x24 bytes C
ecl_min.exe!si_read_object_or_ignore(cl_lispunion * in=0x00fc5dc0,
cl_lispunion * eof=0x00000000) Line 416 + 0xf bytes C
ecl_min.exe!si_load_source(cl_lispunion * source=0x00f70ba0,
cl_lispunion * verbose=0x00000001, cl_lispunion * print=0x00000001,
cl_lispunion * external_format=0x004cf640) Line 113 + 0xb bytes C
ecl_min.exe!APPLY_fixed(int n=0x00000004, cl_lispunion * (void)*
fn=0x0041c4a0, cl_lispunion * * x=0x00be0008) Line 354 + 0x1e bytes C
ecl_min.exe!ecl_apply_from_stack_frame(cl_lispunion *
frame=0x0012e8bc, cl_lispunion * x=0x004ce9ac) Line 52 + 0x14 bytes C
ecl_min.exe!cl_funcall(int narg=0xffffffff, cl_lispunion *
function=0x004ce9ac, ...) Line 132 + 0xd bytes C
ecl_min.exe!cl_load(int narg=0x00000003, cl_lispunion *
source=0x00f70e20, ...) Line 283 + 0x1b bytes C
ecl_min.exe!APPLY(int n=0x00000003, cl_lispunion * (int, <no type>)*
fn=0x0041c9c0, cl_lispunion * * x=0x00bf002c) Line 28 + 0x1b bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012ecfc,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7a078)
Line 497 + 0x14 bytes C
ecl_min.exe!ecl_apply_from_stack_frame(cl_lispunion *
frame=0x0012edb4, cl_lispunion * x=0x00e7a078) Line 79 + 0xf bytes C
ecl_min.exe!cl_mapc(int narg=0x00000001, cl_lispunion *
fun=0x00e7a078, ...) Line 101 + 0xd bytes C
ecl_min.exe!APPLY(int n=0x00000002, cl_lispunion * (int, <no type>)*
fn=0x00455510, cl_lispunion * * x=0x00bf001c) Line 27 + 0x14 bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012f0fc,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7a9d8)
Line 497 + 0x14 bytes C
ecl_min.exe!eval_nontrivial_form(cl_env_struct * env=0x00be0000,
cl_lispunion * form=0x00ee3d80) Line 2384 + 0x11 bytes C
ecl_min.exe!eval_form(cl_env_struct * env=0x00be0000, cl_lispunion *
form=0x00ee3d80) Line 2396 + 0xd bytes C
ecl_min.exe!si_eval_with_env(int narg=0x00000001, cl_lispunion *
form=0x00ee3d80, ...) Line 3130 + 0xd bytes C
ecl_min.exe!si_load_source(cl_lispunion * source=0x00e76600,
cl_lispunion * verbose=0x00000001, cl_lispunion * print=0x00000001,
cl_lispunion * external_format=0x004cf640) Line 117 + 0xb bytes C
ecl_min.exe!APPLY_fixed(int n=0x00000004, cl_lispunion * (void)*
fn=0x0041c4a0, cl_lispunion * * x=0x00be0008) Line 354 + 0x1e bytes C
ecl_min.exe!ecl_apply_from_stack_frame(cl_lispunion *
frame=0x0012f2d0, cl_lispunion * x=0x004ce9ac) Line 52 + 0x14 bytes C
ecl_min.exe!cl_funcall(int narg=0xffffffff, cl_lispunion *
function=0x004ce9ac, ...) Line 132 + 0xd bytes C
ecl_min.exe!cl_load(int narg=0x00000003, cl_lispunion *
source=0x00e76820, ...) Line 283 + 0x1b bytes C
ecl_min.exe!APPLY(int n=0x00000003, cl_lispunion * (int, <no type>)*
fn=0x0041c9c0, cl_lispunion * * x=0x00bf0010) Line 28 + 0x1b bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012f710,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7afa0)
Line 497 + 0x14 bytes C
ecl_min.exe!eval_nontrivial_form(cl_env_struct * env=0x00be0000,
cl_lispunion * form=0x00e886d0) Line 2384 + 0x11 bytes C
ecl_min.exe!eval_form(cl_env_struct * env=0x00be0000, cl_lispunion *
form=0x00e886d0) Line 2396 + 0xd bytes C
ecl_min.exe!si_eval_with_env(int narg=0x00000001, cl_lispunion *
form=0x00e886d0, ...) Line 3130 + 0xd bytes C
ecl_min.exe!si_load_source(cl_lispunion * source=0x00e76a40,
cl_lispunion * verbose=0x00000001, cl_lispunion * print=0x00000001,
cl_lispunion * external_format=0x004cf640) Line 117 + 0xb bytes C
ecl_min.exe!APPLY_fixed(int n=0x00000004, cl_lispunion * (void)*
fn=0x0041c4a0, cl_lispunion * * x=0x00be0008) Line 354 + 0x1e bytes C
ecl_min.exe!ecl_apply_from_stack_frame(cl_lispunion *
frame=0x0012f8e4, cl_lispunion * x=0x004ce9ac) Line 52 + 0x14 bytes C
ecl_min.exe!cl_funcall(int narg=0xffffffff, cl_lispunion *
function=0x004ce9ac, ...) Line 132 + 0xd bytes C
ecl_min.exe!cl_load(int narg=0x00000003, cl_lispunion *
source=0x00e76c40, ...) Line 283 + 0x1b bytes C
ecl_min.exe!APPLY(int n=0x00000003, cl_lispunion * (int, <no type>)*
fn=0x0041c9c0, cl_lispunion * * x=0x00bf0004) Line 28 + 0x1b bytes C
ecl_min.exe!ecl_interpret(cl_lispunion * frame=0x0012fd24,
cl_lispunion * env=0x00000001, cl_lispunion * bytecodes=0x00e7afc8)
Line 497 + 0x14 bytes C
ecl_min.exe!eval_nontrivial_form(cl_env_struct * env=0x00be0000,
cl_lispunion * form=0x00e7ce50) Line 2384 + 0x11 bytes C
ecl_min.exe!eval_form(cl_env_struct * env=0x00be0000, cl_lispunion *
form=0x00e7ce50) Line 2396 + 0xd bytes C
ecl_min.exe!si_eval_with_env(int narg=0x00000001, cl_lispunion *
form=0x00e7ce50, ...) Line 3130 + 0xd bytes C
ecl_min.exe!si_simple_toplevel() Line 110 + 0xf bytes C
ecl_min.exe!APPLY_fixed(int n=0x00000000, cl_lispunion * (void)*
fn=0x00401280, cl_lispunion * * x=0x00be0008) Line 350 + 0x3 bytes C
ecl_min.exe!ecl_apply_from_stack_frame(cl_lispunion *
frame=0x0012fef8, cl_lispunion * x=0x004cf090) Line 52 + 0x14 bytes C
ecl_min.exe!cl_funcall(int narg=0xffffffff, cl_lispunion *
function=0x004cf090, ...) Line 132 + 0xd bytes C
ecl_min.exe!main(int argc=0x00000001, char * * args=0x00343200)
Line 139 + 0xb bytes C
ecl_min.exe!__tmainCRTStartup() Line 582 + 0x19 bytes C
It seems for me that it looping forever inside do ... while(1) loop in
function prepare_ratio_to_float bcs len is always zero. Do you have
some ideas about why ?
More information about the ecl-devel
mailing list