From 71c5ce5ced24a5bbd87d7b5415409af340706b1f Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 20 Dec 2016 18:05:33 +0100 Subject: tests: OOT build fixes etc. tests/Makefile: fix out-of-tree build issues Also: - win64: align(16) MEM_DEBUG user memory on win64 the struct jmp_buf in the TCCState structure which we allocate by tcc_malloc needs alignment 16 because the msvcrt setjmp uses MMX instructions. - libtcc_test.c: win32/64 need __attribute__((dllimport)) for extern data objects - tcctest.c: exclude stuff that gcc does not compile except for relocation_test() the other issues are mostly ASM related. We should probably check GCC versions but I have no idea which mingw/gcc versions support what and which don't. - lib/Makefile: use tcc to compile libtcc1.a (except on arm which needs arm-asm --- tests/libtcc_test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/libtcc_test.c') diff --git a/tests/libtcc_test.c b/tests/libtcc_test.c index be5db61..480d314 100644 --- a/tests/libtcc_test.c +++ b/tests/libtcc_test.c @@ -15,11 +15,15 @@ int add(int a, int b) return a + b; } +/* this strinc is referenced by the generated code */ const char hello[] = "Hello World!"; char my_program[] = "#include \n" /* include the "Simple libc header for TCC" */ "extern int add(int a, int b);\n" +"#ifdef _WIN32\n" /* dynamically linked data needs 'dllimport' */ +" __attribute__((dllimport))\n" +"#endif\n" "extern const char hello[];\n" "int fib(int n)\n" "{\n" -- cgit v1.3.1