Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error trying to build Rubinius: error: ‘strnlen’ was not declared in this scope #2616

Closed
agrimm opened this Issue Sep 25, 2013 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

agrimm commented Sep 25, 2013

When trying to build Rubinius, I get the following error. I get an error whether I use rbenv's ruby-build or building directly using the instructions given from Rubinius' README

This is using rbenv:

3: CXX vm/builtin/find_object.cpp
2: CXX vm/builtin/fixnum.cpp
2: CXX vm/builtin/heap_dump.cpp
3: CXX vm/builtin/float.cpp
vm/builtin/float.cpp: In static member function ‘static rubinius::Float* rubinius::Float::from_cstr(rubinius::State*, const char*, const char*, rubinius::Object*)’:
vm/builtin/float.cpp:166: error: ‘strnlen’ was not declared in this scope
Error: g++ -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vm -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vm/include -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vm/builtin -I. -Ivm/test/cxxtest -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/llvm/include -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/udis86 -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/libffi/include -Ivendor/double-conversion/src -DHAVE_CONFIG_H -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vm/include/capi -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/oniguruma -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/libtommath -pipe -Wall -fno-omit-frame-pointer -g -I/usr/local/include -fPIC -D_DARWIN_USE_64_BIT_INODE  -O2 -DHAS_EXECINFO -DHAVE_SPT_REUSEARGV -DHAVE_NL_LANGINFO -DHAVE_TM_GMTOFF -DHAVE_TM_ZONE -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 -DHAVE_VALGRIND_H -I/private/var/folders/SZ/SZere5L+EMORF-dGje2dyU+++TI/-Tmp-/ruby-build.20130925215248.57517/rubinius-2.0.0-dev/vendor/llvm/Release/include -D_GNU_SOURCE -fno-common -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/float.cpp.o vm/builtin/float.cpp

This is doing it directly:

/Users/agrimm/.rbenv/versions/2.0.0-p247/bin/ruby vm/codegen/field_extract.rb vm/builtin/basicobject.hpp vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/alias.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/bytearray.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/constant_table.hpp vm/builtin/class.hpp vm/builtin/compiledcode.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp vm/builtin/immediates.hpp vm/builtin/iseq.hpp vm/builtin/list.hpp vm/builtin/lookuptable.hpp vm/builtin/ffi_pointer.hpp vm/builtin/methodtable.hpp vm/builtin/nativefunction.hpp vm/builtin/packed_object.hpp vm/builtin/randomizer.hpp vm/builtin/regexp.hpp vm/builtin/constantscope.hpp vm/builtin/encoding.hpp vm/builtin/string.hpp vm/builtin/symbol.hpp vm/builtin/thread.hpp vm/builtin/tuple.hpp vm/builtin/compactlookuptable.hpp vm/builtin/time.hpp vm/builtin/stat.hpp vm/builtin/nativemethod.hpp vm/builtin/system.hpp vm/builtin/autoload.hpp vm/builtin/proc.hpp vm/builtin/variable_scope.hpp vm/builtin/location.hpp vm/builtin/constant_cache.hpp vm/builtin/call_site.hpp vm/builtin/mono_inline_cache.hpp vm/builtin/poly_inline_cache.hpp vm/builtin/call_custom_cache.hpp vm/builtin/respond_to_cache.hpp vm/builtin/weakref.hpp vm/builtin/fiber.hpp vm/builtin/thunk.hpp vm/builtin/call_unit.hpp vm/builtin/call_unit_adapter.hpp vm/builtin/atomic.hpp vm/builtin/character.hpp vm/builtin/thread_state.hpp
Running 133 tasks using 2 parallel threads
1: CXX vm/builtin/float.cpp
2: CXX vm/builtin/string.cpp
vm/builtin/float.cpp: In static member function ‘static rubinius::Float* rubinius::Float::from_cstr(rubinius::State*, const char*, const char*, rubinius::Object*)’:
vm/builtin/float.cpp:166: error: ‘strnlen’ was not declared in this scope
vm/builtin/string.cpp: In member function ‘const char* rubinius::String::c_str_null_safe(rubinius::State*)’:
vm/builtin/string.cpp:701: error: ‘strnlen’ was not declared in this scope
vm/builtin/string.cpp: In member function ‘rubinius::Float* rubinius::String::to_f(rubinius::State*, rubinius::Object*)’:
vm/builtin/string.cpp:928: error: ‘strnlen’ was not declared in this scope
vm/builtin/string.cpp: In member function ‘rubinius::Integer* rubinius::String::to_i(rubinius::State*, rubinius::Fixnum*, rubinius::Object*)’:
vm/builtin/string.cpp:1319: error: ‘strnlen’ was not declared in this scope
Error: g++ -I/users/agrimm/ruby/wip/rubinius/vm -I/users/agrimm/ruby/wip/rubinius/vm/include -I/users/agrimm/ruby/wip/rubinius/vm/builtin -I. -Ivm/test/cxxtest -I/users/agrimm/ruby/wip/rubinius/vendor/llvm/include -I/users/agrimm/ruby/wip/rubinius/vendor/udis86 -I/users/agrimm/ruby/wip/rubinius/vendor/libffi/include -Ivendor/double-conversion/src -DHAVE_CONFIG_H -I/users/agrimm/ruby/wip/rubinius/vm/include/capi -I/users/agrimm/ruby/wip/rubinius/vendor/oniguruma -I/users/agrimm/ruby/wip/rubinius/vendor/libtommath -pipe -Wall -fno-omit-frame-pointer -g -I/usr/local/include -fPIC -D_DARWIN_USE_64_BIT_INODE  -O2 -DHAS_EXECINFO -DHAVE_SPT_REUSEARGV -DHAVE_NL_LANGINFO -DHAVE_TM_GMTOFF -DHAVE_TM_ZONE -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 -DHAVE_VALGRIND_H -I/Users/agrimm/ruby/wip/rubinius/vendor/llvm/Release/include -D_GNU_SOURCE -fno-common -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/float.cpp.o vm/builtin/float.cpp
rake aborted!
Error compiling

Pushing a release candidate instead would also be fine with me.

Owner

dbussink commented Sep 25, 2013

Not sure how a release candidate is related to this, but could you give some more details on your platform?

Issues like this are very dependent on specific platform versions and compiler versions etc so please include as much information as possible.

Contributor

agrimm commented Sep 25, 2013

If there was a release candidate, then I wouldn't have to build it manually.

$ uname -a
Darwin [redacted] 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Owner

dbussink commented Sep 25, 2013

Which OS X version is this?

Contributor

agrimm commented Sep 25, 2013

Snow Leopard.

Owner

dbussink commented Sep 25, 2013

Ah, looks like they added it in 10.7 and it's not available before that.

@brixen brixen closed this in bff1407 Sep 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment