[Ecls-list] long-long
Pascal J. Bourguignon
pjb at informatimago.com
Sun Jul 4 03:19:39 UTC 2010
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:
> Seth, can you try compiling this tiny piece of code?
>
> (FFI:CLINES "
> long long lseek64(int a, long long b, int c)
> {
> return 0;
> }
> ")
>
> (FFI:C-INLINE (1 2 1)
> (:INT :LONG-LONG :INT)
> :LONG-LONG
> "lseek64(#0,#1,#2)"
> :ONE-LINER
> T
> :SIDE-EFFECTS
> T)
>
On 32-bit debian lenny (686) (I'd need long-long support on there too):
(see below for x86_64 gentoo).
CL-USER> (compile-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp"
:c-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c"
:h-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h")
;;;
;;; Compiling /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
;;;
;;; End of Pass 1.
;;; Note:
;;; Refusing to propagate C-INLINE
;;; Note:
;;; Invoking external command:
;;; gcc "-I/usr/local/include/" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -D_THREAD_SAFE -Dlinux -O2 -w -c "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c" -o "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.o"
;;;
;;; Note:
;;; Invoking external command:
;;; gcc -o "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas" -L"/usr/local/lib/" "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.o" "-Wl,--rpath,/usr/local/lib/" -shared -lffi -lecl -lgmp -lpthread -ldl -lm
;;;
;;; Finished compiling /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp.
;;;
#P"/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
NIL
NIL
CL-USER> (cat "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c")
/* Compiler: ECL 10.4.2 */
/* Date: 2010/7/4 05:16 (yyyy/mm/dd) */
/* Machine: Linux 2.6.34-gentoo-r1 i686 */
/* Source: /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp */
#include <ecl/ecl-cmp.h>
#include "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h"
#include "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.data"
#ifdef __cplusplus
extern "C"
#endif
ECL_DLLEXPORT void init_fas_CODE(cl_object flag)
{ VT1 VLEX1 CLSR1 STCK1
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
cl_object *VVtemp;
if (!FIXNUMP(flag)){
Cblock=flag;
#ifndef ECL_DYNAMIC_VV
flag->cblock.data = VV;
#endif
flag->cblock.data_size = VM;
flag->cblock.temp_data_size = VMtemp;
flag->cblock.data_text = compiler_data_text;
flag->cblock.data_text_size = compiler_data_text_size;
flag->cblock.cfuns_size = compiler_cfuns_size;
flag->cblock.cfuns = compiler_cfuns;
flag->cblock.source = make_constant_base_string("/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp");
return;}
#ifdef ECL_DYNAMIC_VV
VV = Cblock->cblock.data;
#endif
Cblock->cblock.data_text = "@EcLtAg:init_fas_CODE@";
VVtemp = Cblock->cblock.temp_data;
lseek64((int)(1),(ecl_long_long_t)(2),(int)(1));
}
; No value
CL-USER> (cat "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h")
#ifdef ECL_DYNAMIC_VV
static cl_object *VV;
#else
static cl_object VV[VM];
#endif
long long lseek64(int a, long long b, int c){
return 0;
}
#ifdef __cplusplus
extern "C" {
#endif
#define VT1
#define VLEX1
#define CLSR1
#define STCK1
static cl_object Cblock;
#define VM1 0
#undef ECL_DYNAMIC_VV
#define compiler_data_text ""
#define compiler_data_text_size 0
#define VM 0
#define VMtemp 0
#define VV NULL
#ifdef __cplusplus
}
#endif
/*
* Exported Lisp functions
*/
#define compiler_cfuns_size 0
#define compiler_cfuns NULL
; No value
CL-USER> (load "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas")
;;; Loading "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
#P"/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
CL-USER>
On 64-bit gentoo:
CL-USER> (compile-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp"
:c-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c"
:h-file "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h")
;;;
;;; Compiling /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
;;;
;;; End of Pass 1.
;;; Note:
;;; Refusing to propagate C-INLINE
;;; Note:
;;; Invoking external command:
;;; gcc "-I/home/pjb/opt/include/" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -D_THREAD_SAFE -Dlinux -O2 -w -c "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c" -o "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.o"
;;;
;;; Note:
;;; Invoking external command:
;;; gcc -o "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas" -L"/home/pjb/opt/lib/" "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.o" "-Wl,--rpath,/home/pjb/opt/lib/" -shared -lecl -lgmp -lgc -lpthread -ldl -lm
;;;
;;; Finished compiling /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp.
;;;
#P"/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
NIL
NIL
CL-USER> (cat "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.c")
/* Compiler: ECL 10.4.2 */
/* Date: 2010/7/4 05:17 (yyyy/mm/dd) */
/* Machine: Linux 2.6.34-gentoo-c5-kvm x86_64 */
/* Source: /home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp */
#include <ecl/ecl-cmp.h>
#include "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h"
#include "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.data"
#ifdef __cplusplus
extern "C"
#endif
ECL_DLLEXPORT void init_fas_CODE(cl_object flag)
{ VT1 VLEX1 CLSR1 STCK1
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
cl_object *VVtemp;
if (!FIXNUMP(flag)){
Cblock=flag;
#ifndef ECL_DYNAMIC_VV
flag->cblock.data = VV;
#endif
flag->cblock.data_size = VM;
flag->cblock.temp_data_size = VMtemp;
flag->cblock.data_text = compiler_data_text;
flag->cblock.data_text_size = compiler_data_text_size;
flag->cblock.cfuns_size = compiler_cfuns_size;
flag->cblock.cfuns = compiler_cfuns;
flag->cblock.source = make_constant_base_string("/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.lisp");
return;}
#ifdef ECL_DYNAMIC_VV
VV = Cblock->cblock.data;
#endif
Cblock->cblock.data_text = "@EcLtAg:init_fas_CODE@";
VVtemp = Cblock->cblock.temp_data;
lseek64((int)(1),(ecl_long_long_t)(2),(int)(1));
}
; No value
CL-USER> (cat "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.h")
#ifdef ECL_DYNAMIC_VV
static cl_object *VV;
#else
static cl_object VV[VM];
#endif
long long lseek64(int a, long long b, int c){
return 0;
}
#ifdef __cplusplus
extern "C" {
#endif
#define VT1
#define VLEX1
#define CLSR1
#define STCK1
static cl_object Cblock;
#define VM1 0
#undef ECL_DYNAMIC_VV
#define compiler_data_text ""
#define compiler_data_text_size 0
#define VM 0
#define VMtemp 0
#define VV NULL
#ifdef __cplusplus
}
#endif
/*
* Exported Lisp functions
*/
#define compiler_cfuns_size 0
#define compiler_cfuns NULL
; No value
CL-USER> (load "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas")
;;; Loading "/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
#P"/home/pjb/firms/medicalis/src/tools/ecl-long-long-test.fas"
CL-USER>
--
__Pascal Bourguignon__ http://www.informatimago.com/
More information about the ecl-devel
mailing list