Skip to content
Browse files

Solaris build fixes

  • Loading branch information...
1 parent 11eff64 commit 29ff80aa989dbffcfb8254cfa0c68f228ccad2b3 @dbussink dbussink committed Nov 12, 2011
View
1 lib/ext/melbourne/grammar19.cpp
@@ -306,6 +306,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include <alloca.h>
#include "ruby.h"
View
1 lib/ext/melbourne/grammar19.y
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include <alloca.h>
#include "ruby.h"
View
8 lib/zlib.rb.ffi
@@ -83,7 +83,7 @@ module Zlib
@@@
constants :required => true do |c|
- c.include_dir 'vendor/zlib'
+ c.include_dir 'vendor/zlib' if BUILD_CONFIG[:vendor_zlib]
c.include 'zlib.h'
c.const 'ZLIB_VERSION', '%s', '(char *)', nil, to_s
@@ -122,7 +122,7 @@ module Zlib
@@@
constants do |c|
- c.include_dir 'vendor/zlib'
+ c.include_dir 'vendor/zlib' if BUILD_CONFIG[:vendor_zlib]
c.include 'zconf.h'
c.const 'MAX_WBITS'
@@ -150,7 +150,7 @@ module Zlib
@@@
constants do |c|
- c.include_dir 'vendor/zlib'
+ c.include_dir 'vendor/zlib' if BUILD_CONFIG[:vendor_zlib]
c.include 'zlib.h'
c.const 'OS_CODE'
@@ -243,7 +243,7 @@ module Zlib
def self.use_zstream_layout
@@@
struct do |s|
- s.include_dir 'vendor/zlib'
+ s.include_dir 'vendor/zlib' if BUILD_CONFIG[:vendor_zlib]
s.include "zlib.h"
s.name "struct z_stream_s"
View
8 rakelib/blueprint.rb
@@ -6,6 +6,8 @@
gcc.cflags << "-ggdb3 -Werror"
gcc.cflags << "-DRBX_PROFILER"
gcc.cflags << "-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
+ gcc.cflags << "-D_LARGEFILE_SOURCE"
+ gcc.cflags << "-D_FILE_OFFSET_BITS=64"
gcc.cflags << Rubinius::BUILD_CONFIG[:user_cflags]
@@ -30,6 +32,8 @@
end
if RUBY_PLATFORM =~ /darwin/i
+ gcc.cflags << "-D_DARWIN_USE_64_BIT_INODE"
+
if `sw_vers` =~ /10\.4/
gcc.cflags << "-DHAVE_STRLCAT -DHAVE_STRLCPY"
end
@@ -67,6 +71,10 @@
make = "gmake"
when /mingw|win32/i
gcc.ldflags << "-lws2_32"
+ when /solaris/
+ gcc.cflags << "-fPIC"
+ gcc.ldflags << "-lsocket" << "-lnsl" << "-fPIC" << "-G"
+ make = "gmake"
else
gcc.ldflags << "-ldl" << "-lpthread"
end
View
3 rakelib/ext_helper.rb
@@ -167,6 +167,7 @@ def add_rbx_capi
when /solaris/
add_define "OS_SOLARIS8"
+ add_flag "-fPIC"
if $CC == "cc" and `cc -flags 2>&1` =~ /Sun/ # detect SUNWspro compiler
# SUN CHAIN
@@ -176,7 +177,7 @@ def add_rbx_capi
else
# GNU CHAIN
# on Unix we need a g++ link, not gcc.
- $LDSHARED = "#{$CXX} -shared"
+ $LDSHARED = "#{$CXX} -shared -G -fPIC"
end
when /openbsd/
View
2 rakelib/platform.rake
@@ -559,7 +559,7 @@ file 'runtime/platform.conf' => deps do |task|
end.write_constants(f)
FFI::Generators::Constants.new 'rbx.platform.zlib' do |cg|
- cg.include_dir 'vendor/zlib'
+ cg.include_dir 'vendor/zlib' if BUILD_CONFIG[:vendor_zlib]
cg.include 'zlib.h'
zlib_constants = %w[ZLIB_VERSION]
View
2 rakelib/rubinius.rb
@@ -11,7 +11,7 @@ def expand(path)
end
def make(args = nil)
- if RUBY_PLATFORM =~ /bsd/
+ if RUBY_PLATFORM =~ /bsd/ || RUBY_PLATFORM =~ /solaris/
gmake = 'gmake'
else
gmake = 'make'
View
2 vm/environment.cpp
@@ -57,7 +57,7 @@ namespace rubinius {
// Used by the segfault reporter. Calculated up front to avoid
// crashing inside the crash handler.
- static utsname machine_info;
+ static struct utsname machine_info;
static char report_path[1024];
static const char* report_file_name = ".rubinius_last_error";
View
5 vm/ffi_util.cpp
@@ -1,8 +1,3 @@
-// HACK constants so that we use the 64bit version of stat
-#define _DARWIN_USE_64_BIT_INODE 1
-#define _LARGEFILE_SOURCE 1
-#define _FILE_OFFSET_BITS 64
-
#include "config.h"
#include <stdint.h>
View
2 vm/llvm/state.cpp
@@ -1012,7 +1012,7 @@ namespace rubinius {
std::cout << " ; " << addr;
if(ud.mnemonic == UD_Icall) {
Dl_info info;
- if(dladdr(addr, &info)) {
+ if(dladdr((void*)addr, &info)) {
int status = 0;
char* cpp_name = abi::__cxa_demangle(info.dli_sname, 0, 0, &status);
if(status >= 0) {
View
1 vm/oop.hpp
@@ -5,6 +5,7 @@
#include <ctype.h>
#include <stdint.h>
#include <assert.h>
+#include <alloca.h>
#include "config.h"
#include "object_types.hpp"

0 comments on commit 29ff80a

Please sign in to comment.
Something went wrong with that request. Please try again.