From 3d1563524f3b6bc2313ff948efa8a6d3a45c11a3 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 14 Jun 2011 16:44:20 +0200 Subject: More fixes for the Solaris/x86 build. Thanks to Will Metcalf. --- src/Makefile | 7 ++++++- src/buildvm_x64.h | 2 +- src/buildvm_x64win.h | 2 +- src/buildvm_x86.dasc | 2 +- src/buildvm_x86.h | 2 +- src/lj_arch.h | 3 ++- src/lj_def.h | 2 ++ src/lj_gdbjit.c | 2 +- 8 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index e670953b..9f7bcfcc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -292,7 +292,9 @@ ifeq (iOS,$(TARGET_SYS)) TARGET_XSHLDFLAGS+= -install_name $(PREFIX)/lib/$(TARGET_DYLIBNAME) endif else - TARGET_XLDFLAGS+= -Wl,-E + ifneq (SunOS,$(TARGET_SYS)) + TARGET_XLDFLAGS+= -Wl,-E + endif ifeq (Linux,$(TARGET_SYS)) TARGET_XLIBS+= -ldl endif @@ -420,6 +422,9 @@ endif ifeq (iOS,$(TARGET_SYS)) LJVM_MODE= machasm endif +ifeq (SunOS,$(TARGET_SYS)) + BUILDMODE= static +endif ifeq (static,$(BUILDMODE)) TARGET_DYNCC= @: diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h index 6fe46d9f..fcff6db3 100644 --- a/src/buildvm_x64.h +++ b/src/buildvm_x64.h @@ -3062,7 +3062,7 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " SZPTR "\n" ".LEFDE0:\n\n", (int)ctx->codesz, CFRAME_SIZE); -#ifdef __solaris__ +#if (defined(__sun__) && defined(__svr4__)) || defined(__solaris_) fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); #else fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h index fa196086..9e6c72bb 100644 --- a/src/buildvm_x64win.h +++ b/src/buildvm_x64win.h @@ -3060,7 +3060,7 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " SZPTR "\n" ".LEFDE0:\n\n", (int)ctx->codesz, CFRAME_SIZE); -#ifdef __solaris__ +#if (defined(__sun__) && defined(__svr4__)) || defined(__solaris_) fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); #else fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc index 14b47089..242f8d6d 100644 --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc @@ -6025,7 +6025,7 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " SZPTR "\n" ".LEFDE0:\n\n", (int)ctx->codesz, CFRAME_SIZE); -#ifdef __solaris__ +#if (defined(__sun__) && defined(__svr4__)) || defined(__solaris_) fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); #else fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h index 831a00ab..289f4bb9 100644 --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h @@ -3219,7 +3219,7 @@ static void emit_asm_debug(BuildCtx *ctx) #endif "\t.align " SZPTR "\n" ".LEFDE0:\n\n", (int)ctx->codesz, CFRAME_SIZE); -#ifdef __solaris__ +#if (defined(__sun__) && defined(__svr4__)) || defined(__solaris_) fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); #else fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); diff --git a/src/lj_arch.h b/src/lj_arch.h index 14448565..ff4628df 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h @@ -65,7 +65,8 @@ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__NetBSD__) || defined(__OpenBSD__) #define LUAJIT_OS LUAJIT_OS_BSD -#elif defined(__solaris__) || defined(__CYGWIN__) +#elif (defined(__sun__) && defined(__svr4__)) || defined(__solaris__) || \ + defined(__CYGWIN__) #define LUAJIT_OS LUAJIT_OS_POSIX #else #define LUAJIT_OS LUAJIT_OS_OTHER diff --git a/src/lj_def.h b/src/lj_def.h index eeb55384..78d988ea 100644 --- a/src/lj_def.h +++ b/src/lj_def.h @@ -118,8 +118,10 @@ typedef uintptr_t BloomFilter; #define LJ_NOINLINE __attribute__((noinline)) #if defined(__ELF__) || defined(__MACH__) +#if !((defined(__sun__) && defined(__svr4__)) || defined(__solaris__)) #define LJ_NOAPI extern __attribute__((visibility("hidden"))) #endif +#endif /* Note: it's only beneficial to use fastcall on x86 and then only for up to ** two non-FP args. The amalgamated compile covers all LJ_FUNC cases. Only diff --git a/src/lj_gdbjit.c b/src/lj_gdbjit.c index fbaafc04..acbe429a 100644 --- a/src/lj_gdbjit.c +++ b/src/lj_gdbjit.c @@ -347,7 +347,7 @@ static const ELFheader elfhdr_template = { .eosabi = 2, #elif defined(__OpenBSD__) .eosabi = 12, -#elif defined(__solaris__) +#elif (defined(__sun__) && defined(__svr4__)) || defined(__solaris__) .eosabi = 6, #else .eosabi = 0, -- cgit v1.2.3-55-g6feb