rubinius / rubinius

The Rubinius Language Platform
https://rubinius.com
Mozilla Public License 2.0
3.06k stars 615 forks source link

Rubinius fails to compile: '_setjmp' was not declared in this scope #2866

Closed StephanieSunshine closed 8 years ago

StephanieSunshine commented 10 years ago

Hi I'm trying to compile Rubinius pulled from the git repo as of tonight within a Solaris zone and I keep getting the same error. I've tried the current git repo and the last two releases. I first attempted this with Ruby 1.9.3-xxx installed, but after reading on the Rubinius website, I restarted the template with a fresh Ruby 2.0.0-xxx install. They all error out in the same place:

Running 191 tasks using 1 parallel threads
2: CXX vm/accessor_primitives.cpp
2: CXX vm/agent.cpp
2: CXX vm/agent_components.cpp
2: CXX vm/arguments.cpp
2: CXX vm/auxiliary_threads.cpp
2: CXX vm/builtin/access_variable.cpp
2: CXX vm/builtin/alias.cpp
2: CXX vm/builtin/array.cpp
2: CXX vm/builtin/atomic.cpp
2: CXX vm/builtin/autoload.cpp
2: CXX vm/builtin/bignum.cpp
2: CXX vm/builtin/block_as_method.cpp
2: CXX vm/builtin/block_environment.cpp
2: CXX vm/builtin/byte_array.cpp
2: CXX vm/builtin/call_custom_cache.cpp
2: CXX vm/builtin/call_site.cpp
2: CXX vm/builtin/call_unit.cpp
2: CXX vm/builtin/call_unit_adapter.cpp
2: CXX vm/builtin/channel.cpp
2: CXX vm/builtin/character.cpp
2: CXX vm/builtin/class.cpp
2: CXX vm/builtin/compact_lookup_table.cpp
2: CXX vm/builtin/compiled_code.cpp
2: CXX vm/builtin/constant_cache.cpp
2: CXX vm/builtin/constant_scope.cpp
2: CXX vm/builtin/constant_table.cpp
2: CXX vm/builtin/data.cpp
2: CXX vm/builtin/dir.cpp
2: CXX vm/builtin/encoding.cpp
2: CXX vm/builtin/exception.cpp
2: CXX vm/builtin/executable.cpp
2: CXX vm/builtin/ffi_pointer.cpp
2: CXX vm/builtin/fiber.cpp
2: CXX vm/builtin/find_object.cpp
2: CXX vm/builtin/fixnum.cpp
2: CXX vm/builtin/float.cpp
2: CXX vm/builtin/heap_dump.cpp
2: CXX vm/builtin/immediates.cpp
2: CXX vm/builtin/integer.cpp
2: CXX vm/builtin/io.cpp
2: CXX vm/builtin/iseq.cpp
2: CXX vm/builtin/list.cpp
2: CXX vm/builtin/location.cpp
2: CXX vm/builtin/lookup_table.cpp
2: CXX vm/builtin/method_table.cpp
2: CXX vm/builtin/module.cpp
2: CXX vm/builtin/mono_inline_cache.cpp
2: CXX vm/builtin/native_function.cpp
2: CXX vm/builtin/native_method.cpp
vm/builtin/native_method.cpp: In static member function 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&)':
vm/builtin/native_method.cpp:691:9: error: there are no arguments to '_setjmp' that depend on a template parameter, so a declaration of '_setjmp' must be available [-fpermissive]
vm/builtin/native_method.cpp:691:9: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
vm/builtin/native_method.cpp:702:9: error: there are no arguments to '_setjmp' that depend on a template parameter, so a declaration of '_setjmp' must be available [-fpermissive]
vm/builtin/native_method.cpp: In instantiation of 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&) [with ArgumentHandler = rubinius::ZeroArguments; rubinius::Executable = rubinius::Executable]':
vm/builtin/native_method.cpp:776:82:   required from here
vm/builtin/native_method.cpp:691:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:691:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp:702:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:702:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp: In instantiation of 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&) [with ArgumentHandler = rubinius::OneArgument; rubinius::Executable = rubinius::Executable]':
vm/builtin/native_method.cpp:780:80:   required from here
vm/builtin/native_method.cpp:691:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:691:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp:702:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:702:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp: In instantiation of 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&) [with ArgumentHandler = rubinius::TwoArguments; rubinius::Executable = rubinius::Executable]':
vm/builtin/native_method.cpp:784:81:   required from here
vm/builtin/native_method.cpp:691:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:691:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp:702:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:702:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp: In instantiation of 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&) [with ArgumentHandler = rubinius::ThreeArguments; rubinius::Executable = rubinius::Executable]':
vm/builtin/native_method.cpp:788:83:   required from here
vm/builtin/native_method.cpp:691:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:691:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp:702:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:702:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp: In instantiation of 'static rubinius::Object* rubinius::NativeMethod::executor_implementation(rubinius::State*, rubinius::CallFrame*, rubinius::Executable*, rubinius::Module*, rubinius::Arguments&) [with ArgumentHandler = rubinius::GenericArguments; rubinius::Executable = rubinius::Executable]':
vm/builtin/native_method.cpp:792:85:   required from here
vm/builtin/native_method.cpp:691:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:691:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
vm/builtin/native_method.cpp:702:9: error: '_setjmp' was not declared in this scope
vm/builtin/native_method.cpp:702:9: note: suggested alternative:
In file included from /usr/include/setjmp.h:34:0,
                 from /usr/local/src/rubinius/vm/vm.hpp:25,
                 from /usr/local/src/rubinius/vm/builtin/object.hpp:6,
                 from /usr/local/src/rubinius/vm/builtin/array.hpp:4,
                 from /usr/local/src/rubinius/vm/arguments.hpp:5,
                 from vm/builtin/native_method.cpp:1:
/usr/include/iso/setjmp_iso.h:94:12: note:   'std::_setjmp'
Error: g++ -I/usr/local/src/rubinius/vm -I/usr/local/src/rubinius/vm/include -I/usr/local/src/rubinius/vm/builtin -I. -Ivm/test/cxxtest -I/usr/local/src/rubinius/vendor/udis86 -I/usr/local/src/rubinius/vendor/libffi/include -Ivendor/double-conversion/src -DHAVE_CONFIG_H -I/usr/local/src/rubinius/vm/include/capi -I/usr/local/src/rubinius/vendor/oniguruma -I/usr/local/src/rubinius/vendor/libtommath -pipe -Wall -fno-omit-frame-pointer -g -I/usr/local/include -I/opt/local/include -fPIC -Wno-strict-aliasing  -O2 -DHAS_EXECINFO -DHAVE_CLOCK_GETTIME -DHAVE_NL_LANGINFO -DHAVE_POSIX_FADVISE -DHAVE_STRNLEN -DHAVE_TIMEZONE -DHAVE_TZNAME -DHAVE_DAYLIGHT -DHAVE_ALLOCA_H -DHAVE_STRING_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TIMES_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -I/usr/local/include -D_DEBUG -include llvm/Support/Solaris.h -D_GNU_SOURCE -fPIC -DENABLE_LLVM -Wno-unused-function -Werror -DRBX_PROFILER -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-rtti -fvisibility-inlines-hidden   -c -o vm/builtin/artifacts/native_method.cpp.o vm/builtin/native_method.cpp
rake aborted!
Error compiling

Tasks: TOP => default => spec => build => build:build => vm/vm
(See full trace by running task with --trace)

Installed packages:

I built LLVM from source as it wasn't in the repos, using LLVM-3.3

binutils-2.23.2nb1   GNU binary utilities
bison-3.0            GNU yacc(1) replacement
bmake-20110606nb1    Portable (autoconf) version of NetBSD 'make' utility
bootstrap-mk-files-20130912 *.mk files for the bootstrap bmake utility
bsdinstall-20130905  Portable version of the BSD install(1) program
bzip2-1.0.6nb1       Block-sorting file compressor
changepass-1.3.3     Simple tool to set user passwords non-interactively
cloog-0.18.0nb1      Code generator for loop optimization (used by gcc)
coreutils-8.13nb6    GNU basic file, shell and text manipulation utilities
curl-7.32.0          Client that groks URLs
cyrus-sasl-2.1.26nb3 Simple Authentication and Security Layer
db4-4.8.30           Berkeley DB version 4 from Oracle
diffutils-3.3        GNU diff utilities - find the differences between files
duo-unix-1.9.5       2 Factor Authentication provided by Duo Security
expat-2.1.0          XML parser library written in C
findutils-4.2.33nb3  The GNU find, locate, updatedb, and xargs utilities
fontconfig-2.10.95   Library for configuring and customizing font access
freetype2-2.4.12     Font rendering engine and library API
gawk-4.1.0           GNU awk
gcc47-4.7.3nb1       The GNU Compiler Collection (GCC) - 4.7 Release Series
gcc47-libs-4.7.3nb3  The GNU Compiler Collection (GCC) support shared libraries
genbfpw-0            Simple tool to generate Blowfish crypts of passwords
gettext-lib-0.18.3.1 Internationalized Message Handling Library (libintl)
ghostscript-9.05nb6  Meta-package for installing the preferred ghostscript version
ghostscript-fonts-8.11nb3 Postscript fonts for Aladdin Ghostscript
ghostscript-gpl-9.05nb6 Postscript interpreter
git-base-1.8.4nb1    GIT Tree History Storage Tool (base package)
gmake-3.82nb7        GNU version of 'make' utility
gmp-5.1.2            Library for arbitrary precision arithmetic
grep-2.14nb2         GNU grep
groff-1.20.1nb12     GNU roff text processing suite
gsed-4.2.2nb4        GNU implementation of sed, the POSIX stream editor
gtar-base-1.26nb2    The GNU tape archiver with remote magnetic tape support
guardtime-1.0.12     Command line client for GuardTime keyless signature service
isl-0.11.2           Integer set library required by gcc graphite
jasper-1.900.1nb7    Software-based reference implementation of the JPEG-2000 codec
jbigkit-2.0          JBIG-KIT lossless image compression library
jpeg-9               IJG's jpeg compression utilities
json-c-0.10          JSON library in C
less-458             Pager similar to more and pg
libICE-1.0.8         Inter Client Exchange (ICE) library for X
libSM-1.2.2          X Session Management Library
libX11-1.6.2         Base X libraries from modular Xorg X11
libXau-1.0.8         Authorization Protocol for X from X.org
libXaw-1.0.12        X Athena Widgets Library from modular Xorg X11
libXdmcp-1.1.1       X Display Manager Control Protocol library from X.org
libXext-1.3.2        X Extension library
libXmu-1.1.2         X Miscellaneous Utilities library
libXpm-3.5.11        X PixMap Library from modular Xorg X11
libXt-1.1.4          X Toolkit Intrinsics library
libarchive-2.8.4nb2  Library to read/create different archive formats
libee-0.4.1          Event Expression Library inspired by CEE
libestr-0.1.5        Library for some string essentials
libffi-3.0.13        Foreign function interface
libgcrypt-1.5.3      GNU cryptographic library
libgetopt-1.4.4      Library for handling --long options
libgpg-error-1.12    Definitions of common error values for all GnuPG components
libguardtime-0.3.11  GuardTime Client C SDK
libiconv-1.14nb2     Character set conversion library
libidn-1.28          Internationalized Domain Names command line tool
liblognorm-0.3.7     Tool to normalize log data
libpaper-1.1.24      Paper size handling library
libssh2-1.2.2nb2     SSH2 protocol library
libuuid-2.19.1       Generate unique identifiers for objects
libxcb-1.9.1         X protocol C-language Binding
libxml2-2.9.1        XML parser library from the GNOME project
libyaml-0.1.4        YAML 1.1 parser and emitter written in C
m4-1.4.16nb3         GNU version of UNIX m4 macro language processor
mit-krb5-1.10.6      MIT Kerberos 5 authentication system
mozilla-rootcerts-1.0.20121229nb1 Root CA certificates from the Mozilla Project
mpfr-3.1.2           GMP-based library for multiple-precision floating-point computations
nawk-20050424nb3     Brian Kernighan's pattern-directed scanning and processing language
nbsed-20120308       NetBSD-current's sed(1)
ncurses-5.9nb1       CRT screen handling and optimization package
netpbm-10.35.80nb7   Toolkit for conversion of images between different formats
nodejs-0.10.22       V8 JavaScript for clients and servers
openldap-client-2.4.36 Lightweight Directory Access Protocol libraries and client programs
openssl-1.0.1enb2    Secure Socket Layer and cryptographic library
p5-Authen-SASL-2.16nb1 Perl module to handle SASL authentication
p5-Digest-HMAC-1.03nb2 Perl5 module for HMAC
p5-Digest-MD5-2.53   Perl5 extension interface for MD5 algorithm
p5-Digest-SHA-5.85   Perl module for SHA-1/224/256/384/512 algorithms
p5-Email-Valid-1.192 Perl5 module for testing validity of an email address
p5-Error-0.17021     Perl extension module for try/throw/catch exception handling
p5-GSSAPI-0.28nb4    Perl extension providing access to the GSSAPIv2 library
p5-IO-Socket-INET6-2.71 Perl object interface for AF_INET|AF_INET6 domain sockets
p5-IO-Socket-SSL-1.953 Perl5 SSL socket interface class
p5-MIME-Base64-3.14  Perl5 module for Base64 and Quoted-Printable encodings
p5-MailTools-2.12nb1 Perl5 modules related to mail applications
p5-Net-DNS-0.72      Perl5 module for DNS resolution
p5-Net-IP-1.26nb1    Perl extension for manipulating IPv4/IPv6 addresses
p5-Net-LibIDN-0.12nb5 Perl bindings for GNU Libidn
p5-Net-SMTP-SSL-1.01nb4 Perl5 module providing SSL support for Net::SMTP
p5-Net-SSLeay-1.55   Perl5 module for using OpenSSL
p5-Socket6-0.23nb4   Perl5 module to support getaddrinfo() and getnameinfo()
p5-TimeDate-2.30     Perl5 TimeDate distribution
patch-2.5.9nb2       Patch files using diff output
pcre-8.33            Perl Compatible Regular Expressions library
perl-5.18.1nb1       Practical Extraction and Report Language
pkg_install-20130902 Package management and administration tools for pkgsrc
pkg_install-info-4.5nb3 Standalone GNU info file installation utility
pkgin-0.6.4nb1       Apt / yum like tool for managing pkgsrc binary packages
png-1.6.6            Library for manipulating PNG images
postfix-2.9.8        Postfix SMTP server and tools
ppl-0.11.2nb2        The Parma Polyhedra Library. Used by gcc for loop optimization
psutils-1.17nb4      Utilities for manipulating PostScript documents
python27-2.7.5nb3    Interpreted, interactive, object-oriented programming language
readline-6.2         GNU library that can recall and edit previous input
rsyslog-7.4.4nb2     The enhanced syslogd for Unix
ruby-2.0.0p353       Wrapper package for Ruby programming language
ruby200-base-2.0.0p353 Ruby 2.0.0 release minimum base package
ruby200-bundler-1.3.5 Manage your application's dependencies
ruby200-rake-10.0.4  Ruby Make
ruby200-rubygems-2.0.10 Ruby standard for publishing and managing third party libraries
sdc-manta-1.2.2      Node.js SDK for Manta
sdc-node-0.10.22     V8 JavaScript for clients and servers
sdc-smartdc-7.1.1    Client SDK and CLI for the Joyent SmartDataCenter API
smtools-20131031     Joyent tools relevant to SmartOS and SmartMachines
sqlite3-3.8.0.2      SQL Database Engine in a C Library
sudo-1.7.10p7        Allow others to run commands as root
tcp_wrappers-7.6.4   Monitor and filter incoming requests for network services
tiff-4.0.3nb6        Library and tools for reading and writing TIFF data files
xmlcatmgr-2.2nb1     XML and SGML catalog manager
xz-5.0.5             XZ utilities
zlib-1.2.8           General purpose data compression library
zoneinit-1.6.5       Joyent Instance initialization toolchain
dbussink commented 10 years ago

So currently Solaris isn't a platform actively supported or tested. It looks like setjmp is not available in the same way it is on other unix like systems we support.

It would be cool if we could get it to work on Solaris, but afaik no developer has access to such a machine. If you're able to fix the problem we can incorporate a fix for it.

StephanieSunshine commented 10 years ago

I'm happy to provide some resources for someone to debug this. Open Solaris and it's variants have been freely available for quite some time. Anyone can install any of the Open Solaris variants and repeat my results within hours. LLVM was the only thing that took a while to compile and it installed fine. I used SmartOS: http://en.wikipedia.org/wiki/SmartOS

jc00ke commented 10 years ago

Looks like there's a conversation started around SmartOS support for Travis at travis-ci/travis-ci#1368.

dbussink commented 10 years ago

@FuzzySunshine Do you think you'd be able to setup a Vagrant image with Open Solaris for testing?

brixen commented 8 years ago

If someone wants to send a PR to fix this issue, please feel free to do so.

jaykrell commented 3 years ago

I hit this in my project, and I have Solaris to investigate on (Solaris 11 in a VirtualBox VM on Windows HyperV.)

Solaris does this:

#ifdef __cplusplus
extern "C" {
namespace std {
#endif

int setjmp(...);
int _setjmp(..);
int sigsetjmp(...)

#ifdef __cplusplus
} // std
} // extern C

using std::setjmp;
using std::sigsetjmp;
// no using std::_setjmp
#endif

This seems like an accident. They should either have the using, or put it outside of std.

In my case, and I suggest for you, I think we should use sigsetjmp. It has been in Posix since 1990. _setjmp is non-standard compat etc.

It does seem like a minor Solaris header bug. You could ifdef Solaris or something, or just sigsetjmp for all systems (except Windows).

Compiling as C would of course work, for some projects.