From e04efe5f5acedd74d82298ac1b0269de52b5082f Mon Sep 17 00:00:00 2001 From: sheeple Date: Fri, 27 Mar 2009 10:41:24 -0500 Subject: [PATCH 1/4] use .a instead of .so on unix --- basis/compiler/tests/alien.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 7d65ea7103..c65fed55e2 100644 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -13,7 +13,7 @@ IN: compiler.tests { { [ os winnt? ] [ "libfactor-ffi-test.dll" ] } { [ os macosx? ] [ "libfactor-ffi-test.dylib" ] } - { [ os unix? ] [ "libfactor-ffi-test.so" ] } + { [ os unix? ] [ "libfactor-ffi-test.a" ] } } cond append-path ; "f-cdecl" libfactor-ffi-tests-path "cdecl" add-library From 1cf5c519ccb836a8e386626246d6d2e94b626040 Mon Sep 17 00:00:00 2001 From: sheeple Date: Fri, 27 Mar 2009 14:39:45 -0500 Subject: [PATCH 2/4] fix ffi tests on 32bit --- basis/compiler/tests/alien.factor | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index c65fed55e2..8d876891f2 100644 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -21,8 +21,6 @@ IN: compiler.tests "f-stdcall" libfactor-ffi-tests-path "stdcall" add-library >> -LIBRARY: f-cdecl - FUNCTION: void ffi_test_0 ; [ ] [ ffi_test_0 ] unit-test @@ -124,8 +122,6 @@ unit-test "int" { "int" "int" "int" "int" } "stdcall" alien-indirect gc ; -LIBRARY: f-stdcall - [ f ] [ "f-stdcall" load-library f = ] unit-test [ "stdcall" ] [ "f-stdcall" library abi>> ] unit-test @@ -166,7 +162,7 @@ FUNCTION: void ffi_test_20 double x1, double x2, double x3, : ffi_test_31 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result y ) "int" - "f-stdcall" "ffi_test_31" + "f-cdecl" "ffi_test_31" { "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" } alien-invoke gc 3 ; @@ -174,7 +170,7 @@ FUNCTION: void ffi_test_20 double x1, double x2, double x3, : ffi_test_31_point_5 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result ) "float" - "f-stdcall" "ffi_test_31_point_5" + "cdecl" "ffi_test_31_point_5" { "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" } alien-invoke ; From 45ed9b3b801173a85b76f691f025a5a1bf1395a9 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 27 Mar 2009 15:39:13 -0500 Subject: [PATCH 3/4] use -fPIC on all platforms for ffi lib --- Makefile | 1 + vm/Config.linux.x86.64 | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3f385ec496..ddfe916742 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ IMAGE = factor.image BUNDLE = Factor.app LIBPATH = -L/usr/X11R6/lib CFLAGS = -Wall +FFI_TEST_CFLAGS = -fPIC ifdef DEBUG CFLAGS += -g diff --git a/vm/Config.linux.x86.64 b/vm/Config.linux.x86.64 index a02fcb4d6d..bfd1222496 100644 --- a/vm/Config.linux.x86.64 +++ b/vm/Config.linux.x86.64 @@ -1,4 +1,3 @@ include vm/Config.linux include vm/Config.x86.64 LIBPATH = -L/usr/X11R6/lib64 -L/usr/X11R6/lib -FFI_TEST_CFLAGS = -fPIC From 6f743b280de79c55706b6614b157993f51b7ba76 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 27 Mar 2009 17:58:31 -0500 Subject: [PATCH 4/4] hopefully last fix for alien.factor --- basis/compiler/tests/alien.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 8d876891f2..6802b43de6 100644 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -21,6 +21,8 @@ IN: compiler.tests "f-stdcall" libfactor-ffi-tests-path "stdcall" add-library >> +LIBRARY: f-cdecl + FUNCTION: void ffi_test_0 ; [ ] [ ffi_test_0 ] unit-test @@ -170,7 +172,7 @@ FUNCTION: void ffi_test_20 double x1, double x2, double x3, : ffi_test_31_point_5 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result ) "float" - "cdecl" "ffi_test_31_point_5" + "f-cdecl" "ffi_test_31_point_5" { "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" } alien-invoke ;