Moved from Trac
Reported by: Alasdairrr Assigned to: raggi
Priority: minor Milestone:
Keywords: Cc:
Description ¶
Hello,
The new version of EventMachine (0.12.4) fails to build on Solaris. It assumes the GNU Linker is used, and during the build of ext/fastfilereader passes the "-shared" option to g++. On Solaris, the "-G" option should be passed, as per:
http://developers.sun.com/sunstudio/documentation/techart/gc_options.html
This happens when using gem, or manually building with rake. Further more, after manually linking ext/fastfilereader, "rake install" fails as it assumes GNU Tar:
tar: z: unknown function modifier Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}... rake aborted! Command failed with status (1): [tar zcvf eventmachine-0.12.4.tgz eventmach...]
An alternative such as "tar -cf - eventmachine-0.12.4 | gzip > eventmachine-0.12.4.tgz" is a more cross-platform version.
I can provide more information if needed, but the above should be enough to fix this.
EventMachine 0.12.2 builds correctly with Gem (I couldn't find the source version so I can't test whether it builds correctly with rake). So a change between the two versions has introduced options which break the build on Solaris.
Many thanks,
Alasdair
Change History
02/11/09 01:06:02 changed by tmm1 ¶
02/11/09 04:09:22 changed by raggi ¶
* status changed from new to assigned.
Alasdair,
I have created a branch at http://github.com/eventmachine/eventmachine/tree/solaris
Can you please, on a solaris box (I don't have one immediately to hand), do the following:
git clone git://github.com/eventmachine/eventmachine.git
cd eventmachine
git checkout -b solaris origin/solaris
rake build
if that works, I will merge into master, if not, please paste results here.
Thanks.
03/01/09 09:52:43 changed by raggi ¶
* priority changed from critical to minor.
Dropping priority, pending feedback.
03/03/09 01:55:16 changed by raggi ¶
* status changed from assigned to closed.
* resolution set to fixed.
Applied to master. Please re-open if the problem re-appears.
03/03/09 13:19:45 changed by nicksellen ¶
* status changed from closed to reopened.
* resolution deleted.
Hi, I've cloned the master branch and still having problems.
I'll attach the full output of rake build seperately but here is the output from running the following line whilst in ext/fastfilereader:
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DOS_UNIX -DOS_SOLARIS8 -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c mapper.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
"mapper.cpp", line 91: Error: Formal argument 1 of type char* in call to munmap(char_, unsigned) is being passed void_.
1 Error(s) detected.
changing the fPIC to the Sun Studio verion, KPIC doesn't help matters:
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DOS_UNIX -DOS_SOLARIS8 -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -KPIC -g -O2 -G -c mapper.cpp
"mapper.cpp", line 91: Error: Formal argument 1 of type char* in call to munmap(char_, unsigned) is being passed void_.
1 Error(s) detected.
Thanks,
Nick (on behalf of Alasdair)
03/03/09 13:20:03 changed by nicksellen
* attachment eventmachine.rake.build.output added.
03/03/09 18:02:43 changed by tmm1 ¶
Pushed a patch for the issues posted above: http://github.com/eventmachine/eventmachine/commit/15bcb962c3cee4e72899e1df09436a6310116314
Nick, can you test against master again?
03/05/09 05:00:20 changed by nicksellen ¶
Hi, still no joy:
git clone git://github.com/eventmachine/eventmachine.git
cd eventmachine
rake build
gives:
root eventmachine (nsdev01): rake build
(in /root/eventmachine)
/opt/ec/ruby/1.8.6/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
cd ext
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
checking for sys/event.h... no
checking for main() in -lnsl... yes
checking for main() in -lsocket... yes
sh: gnome-config: not found
checking for main() in -lssl... yes
checking for main() in -lcrypto... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
creating Makefile
cd -
cd ext/fastfilereader
checking for main() in -lnsl... yes
checking for main() in -lsocket... yes
creating Makefile
cd -
cd ext
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DOS_UNIX -DOS_SOLARIS8 -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c ed.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 554: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 555: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 556: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 557: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 558: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 559: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 560: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 577: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 594: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 129: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 136: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 137: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 138: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 141: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 142: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 147: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 148: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 179: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 194: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 239: Warning: attribute noreturn is unsupported and will be skipped..
20 Warning(s) detected.
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DOS_UNIX -DOS_SOLARIS8 -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c epoll.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DOS_UNIX -DOS_SOLARIS8 -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c em.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 554: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 555: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 556: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 557: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 558: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 559: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 560: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 577: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 594: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 129: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 136: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 137: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 138: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 141: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 142: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 147: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 148: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 179: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 194: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 239: Warning: attribute noreturn is unsupported and will be skipped..
"em.cpp", line 936: Error: Could not find a match for std::multimap<long long, EventMachine_t::Timer_t, std::less, std::allocator<std::pair<const long long, EventMachine_t::Timer_t>>>::insert(std::pair<long long, EventMachine_t::Timer_t>) needed in EventMachine_t::InstallOneshotTimer(int).
1 Error(s) and 20 Warning(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `em.o'
rake aborted!
Command failed with status (1): [make...]
/root/eventmachine/Rakefile:141
(See full trace by running task with --trace)
cd ext/fastfilereader
ruby extconf.rb
gmake
gives:
root fastfilereader (nsdev01): gmake
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DOS_UNIX -DOS_SOLARIS8 -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c rubymain.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 554: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 555: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 556: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 557: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 558: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 559: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 560: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 577: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/ruby.h", line 594: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 129: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 136: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 137: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 138: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 141: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 142: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 147: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 148: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 179: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 194: Warning: attribute noreturn is unsupported and will be skipped..
"/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10/intern.h", line 239: Warning: attribute noreturn is unsupported and will be skipped..
20 Warning(s) detected.
/opt/SUNWspro/bin/CC -I. -I. -I/opt/ec/ruby/1.8.6/lib/ruby/1.8/i386-solaris2.10 -I. -DBUILD_FOR_RUBY -DOS_UNIX -DOS_SOLARIS8 -I/usr/sfw/include -I/opt/sfw/include -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -fPIC -G -c mapper.cpp
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
"mapper.cpp", line 92: Error: Formal argument 1 of type char* in call to munmap(char_, unsigned) is being passed const char_.
1 Error(s) detected.
gmake: *** [mapper.o] Error 1
also to note that it is still using -fPIC option not -KPIC as required by Sun Studio cc as on http://developers.sun.com/sunstudio/documentation/techart/gc_options.html.
keep going! happy to test more.
03/08/09 17:54:23 changed by tmm1 ¶
The two errors I'm still getting are:
"em.cpp", line 937: Error: Could not find a match for std::multimap<long long, EventMachine_t::Timer_t, std::less, std::allocator<std::pair<const long long, EventMachine_t::Timer_t>>>::insert(std::pair<long long, EventMachine_t::Timer_t>) needed in EventMachine_t::InstallOneshotTimer(int).
and
"cmain.cpp", line 56: Error: Could not find a match for EventMachine_t::EventMachine_t(extern "C" void()(const char,int,const char_,int)) needed in evma_initialize_library(extern "C" void()(const char,int,const char_,int)).
03/08/09 17:59:21 changed by tmm1 ¶
And also:
"cplusplus.cpp", line 37: Warning (Anachronism): Formal argument 1 of type extern "C" void()(const char,int,const char_,int) in call to evma_initialize_library(extern "C" void()(const char,int,const char_,int)) is being passed void()(const char,int,const char_,int).
"cplusplus.cpp", line 52: Error: Could not find a match for std::mapstd::string,void(_)()::insert(std::pair<const char*, void()()>) needed in EM::AddTimer(int, void(_)()).
"cplusplus.cpp", line 75: Error: Could not find a match for std::mapstd::string,EM::Eventable_::insert(std::pair<std::string, EM::Connection>) needed in EM::Acceptor::Accept(const char_).
"cplusplus.cpp", line 117: Error: Could not find a match for std::mapstd::string,EM::Eventable_::insert(std::pair<std::string, EM::Connection*>) needed in EM::Connection::Connect(const char_, int).
"cplusplus.cpp", line 127: Error: Could not find a match for std::mapstd::string,EM::Eventable_::insert(std::pair<std::string, EM::Acceptor*>) needed in EM::Acceptor::Start(const char*, int).
These errors happen with 0.12.0 for me as well.
03/08/09 18:06:49 changed by tmm1 ¶
Could not find a match for std::multimap<...>::insert(std::pair<...,...>)
Compiler: Sun C++ 5.9
Cause: the multimap classes don't have a method insert(pair<First, Second>), only insert(pair<const First, Second>).
Solution: Instead of insert(make_pair(first, second)), use insert(mm::value_type(first, second)).
03/10/09 21:27:30 changed by tmm1 ¶
Fixes the compile issue but the resulting extension still doesn't work:
diff --git a/ext/cmain.cpp b/ext/cmain.cpp
index ea348fd..1a398a1 100644
--- a/ext/cmain.cpp
+++ b/ext/cmain.cpp
@@ -24,6 +24,8 @@ static EventMachine_t *EventMachine;
static int bUseEpoll = 0;
static int bUseKqueue = 0;
+typedef void (CppCb)(const char, int, const char_, int);
+
extern "C" void ensure_eventmachine (const char *caller = "unknown caller")
{
if (!EventMachine) {
@@ -53,7 +55,8 @@ extern "C" void evma_initialize_library (void(cb)(const char, int, const char_
#else
throw std::runtime_error ("eventmachine already initialized: evma_initialize_library");
#endif
-
EventMachine = new EventMachine_t (cb);
-
//EventMachine = new EventMachine_t (reinterpret_cast<CppCb>(cb));
-
EventMachine = new EventMachine_t ((CppCb)cb);
if (bUseEpoll)
EventMachine->_UseEpoll();
if (bUseKqueue)
agupta@sirius ~/eventmachine $ ~/ruby/bin/ -I lib -I ext -e 'require "rubyeventmachine"'
ext/rubyeventmachine.so: ld.so.1: ruby: fatal: relocation error: file ext/rubyeventmachine.so: symbol _1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___J__nullref: referenced symbol not found - ext/rubyeventmachine.so (LoadError)
from -e:1