Bläddra i källkod

More fixes for the Solaris/x86 build. Thanks to Will Metcalf.

Mike Pall 14 år sedan
förälder
incheckning
3d1563524f
8 ändrade filer med 15 tillägg och 7 borttagningar
  1. 6 1
      src/Makefile
  2. 1 1
      src/buildvm_x64.h
  3. 1 1
      src/buildvm_x64win.h
  4. 1 1
      src/buildvm_x86.dasc
  5. 1 1
      src/buildvm_x86.h
  6. 2 1
      src/lj_arch.h
  7. 2 0
      src/lj_def.h
  8. 1 1
      src/lj_gdbjit.c

+ 6 - 1
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= @:

+ 1 - 1
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");

+ 1 - 1
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");

+ 1 - 1
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");

+ 1 - 1
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");

+ 2 - 1
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

+ 2 - 0
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

+ 1 - 1
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,