iriscouch / build-couchdb

Batteries-included CouchDB build system
227 stars 36 forks source link

Spidermonkey configure fails on Raspberry Pi w/ Debian #58

Open adhami03 opened 12 years ago

adhami03 commented 12 years ago

I'm trying to get CouchDB 1.2.0 up and running on my brand new Raspberry Pi, but the process fails during the Spidermonkey configure process (I think). Here is the end of the output with --trace:

configure:11226: checking for an implementation of va_copy() configure:11250: gcc -o conftest -fno-strict-aliasing -pthread -lpthread conftest.c -ldl 1>&5 configure: In function 'f': configure:11244: warning: incompatible implicit declaration of built-in function 'exit' configure:11267: checking for an implementation of __va_copy() configure:11291: gcc -o conftest -fno-strict-aliasing -pthread -lpthread conftest.c -ldl 1>&5 configure: In function 'f': configure:11285: warning: incompatible implicit declaration of built-in function 'exit' configure:11308: checking whether va_lists can be copied by value configure:11332: gcc -o conftest -fno-strict-aliasing -pthread -lpthread conftest.c -ldl 1>&5 configure: In function 'f': configure:11326: warning: incompatible implicit declaration of built-in function 'exit' configure:11441: checking for ARM EABI configure:11459: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11481: checking for gcc 3.0 ABI configure:11499: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11523: checking for C++ "explicit" keyword configure:11538: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11559: checking for C++ "typename" keyword configure:11583: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11604: checking for modern C++ template specialization syntax support configure:11619: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11641: checking whether partial template specialization works configure:11654: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11675: checking whether operators must be re-defined for templates derived from templates configure:11692: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11714: checking whether we need to cast a derived template to pass as its base class configure:11728: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11749: checking whether the compiler can resolve const ambiguities for templates configure:11775: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11797: checking whether the C++ "using" keyword can change access configure:11810: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11821: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure: In function 'int main()': configure:11814: error: 'int A::foo()' is inaccessible configure:11817: error: within this context configure: failed program was:

line 11813 "configure"

include "confdefs.h"

class A { public: int foo() { return 1; } }; class B : public A { private: using A::foo; }; int main() { B b; return b.foo(); ; return 0; } configure:11849: checking whether the C++ "using" keyword resolves ambiguity configure:11870: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11891: checking for "std::" namespace configure:11903: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11924: checking whether standard template operator!=() is ambiguous configure:11939: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11961: checking for C++ reinterpret_cast configure:11974: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:11995: checking for C++ dynamic_cast to void* configure:12022: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 configure:12046: checking whether C++ requires implementation of unused virtual methods configure:12058: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 /tmp/ccMnFdpy.o: In function X::X()': conftest.C:(.text._ZN1XC1Ev[X::X()]+0x30): undefined reference tovtable for X' collect2: ld returned 1 exit status configure: failed program was:

line 12051 "configure"

include "confdefs.h"

class X {private: virtual void never_called();}; int main() { X x; ; return 0; } configure:12081: checking for trouble comparing to zero near std::operator!=() configure:12097: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:12121: checking for thread keyword for TLS variables configure:12133: c++ -o conftest -fno-strict-aliasing -pthread -lpthread -fPIC -shared -Wl,-z,defs conftest.C -ldl 1>&5 configure:12170: checking for malloc.h configure:12282: checking for strndup configure:12313: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 configure:12282: checking for posix_memalign configure:12313: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 configure:12282: checking for memalign configure:12313: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 configure:12282: checking for valloc configure:12313: c++ -o conftest -fno-strict-aliasing -pthread -lpthread conftest.C -ldl 1>&5 configure:12340: checking for __attribute((always_inline)) configure:12352: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:12367: checking for attribute((malloc)) configure:12379: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:12394: checking for attribute((warn_unused_result)) configure:12406: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:12421: checking for attribute((noreturn)) configure:12433: c++ -c -fno-strict-aliasing -pthread conftest.C 1>&5 configure:12457: checking for LC_MESSAGES configure:12469: gcc -c -fno-strict-aliasing -pthread conftest.c 1>&5 configure:12492: checking for localeconv configure:12520: gcc -o conftest -fno-strict-aliasing -pthread -lpthread conftest.c -ldl 1>&5 configure:13041: checking for valid optimization flags configure:13052: gcc -c -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -Os -freorder-blocks -fomit-frame-pointer conftest.c 1>&5 configure:13767: checking for __cxa_demangle configure:13798: c++ -o conftest -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -lpthread conftest.C -ldl 1>&5 configure:13846: checking for unwind.h configure:13856: gcc -E conftest.c >/dev/null 2>conftest.out configure:13875: checking for _Unwind_Backtrace configure:13903: gcc -o conftest -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -lpthread conftest.c -ldl 1>&5 configure:13952: checking for gcc -pipe support dummy-hello.c:2:21: warning: missing terminating " character dummy-hello.c: In function 'main': dummy-hello.c:2: error: missing terminating " character dummy-hello.c:3:1: warning: missing terminating " character dummy-hello.c:3: error: missing terminating " character dummy-hello.c:3: error: expected expression at end of input dummy-hello.c:3: error: expected declaration or statement at end of input configure:13974: gcc -c -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -pipe conftest.c 1>&5 configure:14004: checking whether C compiler supports -fprofile-generate configure:14013: gcc -c -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -pipe -fprofile-generate -fprofile-correction conftest.c 1>&5 configure:14077: checking whether C++ compiler has -pedantic long long bug configure:14086: c++ -c -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -pipe -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long conftest.C 1>&5 configure:14111: checking for correct temporary object destruction order configure:14139: c++ -o conftest -fno-strict-aliasing -pthread -march=armv7-a -marm -mfloat-abi=softfp -pipe -lpthread conftest.C -ldl 1>&5 configure: failed program was:

line 14116 "configure"

include "confdefs.h"

ifdef __cplusplus

extern "C" void exit(int);

endif

class A { public: A(int& x) : mValue(x) {} ~A() { mValue--; } operator char_() { return 0; } private: int& mValue; }; void func(char _arg) {} int m=2; void test() { func(A(m)); if (m==1) m = 0; } int main() { test(); return(m); }

== End of config.log == rake aborted! Command failed with status (1): [env /opt/build-couchdb/dependencies/spider...] /usr/lib/ruby/1.8/rake.rb:995:in sh' /usr/lib/ruby/1.8/rake.rb:1010:incall' /usr/lib/ruby/1.8/rake.rb:1010:in sh' /usr/lib/ruby/1.8/rake.rb:1094:insh' /opt/build-couchdb/tasks/tracemonkey.rake:42 /opt/build-couchdb/tasks/lib.rb:185:in show_file' /opt/build-couchdb/tasks/tracemonkey.rake:41 /opt/build-couchdb/tasks/tracemonkey.rake:28:inchdir' /opt/build-couchdb/tasks/tracemonkey.rake:28 /usr/lib/ruby/1.8/tmpdir.rb:129:in mktmpdir' /opt/build-couchdb/tasks/tracemonkey.rake:27 /usr/lib/ruby/1.8/rake.rb:636:incall' /usr/lib/ruby/1.8/rake.rb:636:in execute' /usr/lib/ruby/1.8/rake.rb:631:ineach' /usr/lib/ruby/1.8/rake.rb:631:in execute' /usr/lib/ruby/1.8/rake.rb:597:ininvoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/1.8/rake.rb:590:ininvoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:607:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:604:ineach' /usr/lib/ruby/1.8/rake.rb:604:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:596:ininvoke_with_call_chain' root@raspberrypi:/opt/build-couchdb# /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/1.8/rake.rb:590:ininvoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:607:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:604:ineach' /usr/lib/ruby/1.8/rake.rb:604:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:596:ininvoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/1.8/rake.rb:590:ininvoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:607:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:604:ineach' /usr/lib/ruby/1.8/rake.rb:604:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:596:ininvoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/1.8/rake.rb:590:ininvoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:607:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:604:ineach' /usr/lib/ruby/1.8/rake.rb:604:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:596:ininvoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/1.8/rake.rb:590:ininvoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:583:in invoke' /usr/lib/ruby/1.8/rake.rb:2051:ininvoke_task' /usr/lib/ruby/1.8/rake.rb:2029:in top_level' /usr/lib/ruby/1.8/rake.rb:2029:ineach' /usr/lib/ruby/1.8/rake.rb:2029:in top_level' /usr/lib/ruby/1.8/rake.rb:2068:instandard_exception_handling' /usr/lib/ruby/1.8/rake.rb:2023:in top_level' /usr/lib/ruby/1.8/rake.rb:2001:inrun' /usr/lib/ruby/1.8/rake.rb:2068:in standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1998:inrun' /usr/bin/rake:28

-Andrew

natevw commented 12 years ago

Cross reference: @benoitc has managed to get CouchDB running on Raspberry Pi.

davidoccam commented 12 years ago

by davidoccam » Mon Aug 27, 2012 7:03 pm quote from talking on #refuge.io about this thread

https://friendpaste.com/6GW1BpWK2UNCAcuCexF1kM at 928 is the cause of problems configure: error: Your compiler does not follow the C++ specification for temporary object destruction order. needed for some soap issue in spidermonkey (I think) Linux raspberrypi 3.2.27+ #66 PREEMPT Fri Aug 24 23:52:42 BST 2012 armv6l GNU/Linux I think armv6l is the issue this I found instructive /viewtopic.php?f=36&t=7268&p=156159 by widelord » Wed Jul 18, 2012 11:42 pm Yes, just libmozjs, I extracted the tar and edited js/src/configure - check here tomorrow and I'll put a link up which contains the edited file. Here's a link to the libmozjs archive that I made changes to - worked for me but no guarantees! http://raspberrypi.widelord.org.uk/down ... bmozjs.tgz Fri Jul 20, 2012 10:56 am hmmm - now this is strange. I've downloaded the new Raspian image and created a new SD card, now using my previously modified libmozjs archive fails once more with the "Your compiler does not follow the C++ specification for temporary object destruction order" error. Back to the drawing board? cant we just install packages libmozjs*[-dev] from the apt-repositories? Has soneone tried this? That's what I ended up doing. I installed libmozjs185-dev I think widelord made the changes to configure and not to configure.in and his working configure gets overwritten in next build causing second failure. This is a widespread issue and I wish to get to the real cause. You are nearly there Widelord - I think
natevw commented 12 years ago

Sounds like @snej was able to get an almost-working copy of CouchDB 1.2 installed simply via apt-get: http://mail-archives.apache.org/mod_mbox/couchdb-user/201207.mbox/%3c21336748-1F0D-4FD0-B71D-91F1E835412F@couchbase.com%3e

The only problem he ran into was a permissions issue. So maybe a little poking into who/how that package is being maintained would answer some questions?

snej commented 12 years ago

FYI, I'm running the Raspbian distro. This is almost certainly not the same distro that the OP was trying to install on, as Raspbian was only released in July (a week or so before I did my install.) As Raspbian is now the recommended Linux to install on RPi, the OP's error might be moot by now...

ussjoin commented 11 years ago

I'm running the newest Raspbian image (2012-10-28-wheezy-raspbian) and have precisely the same issue: "checking for correct temporary object destruction order" fails, and then the build terminates with failure. I need to be able to use the development versions of Couch, not the package version, so the apt-get doesn't work for me; any more ideas what might be causing this issue?

benoitc commented 11 years ago

spidemonkey still need a patch? On Oct 31, 2012 6:59 AM, "ussjoin" notifications@github.com wrote:

I'm running the newest Raspbian image (2012-10-28-wheezy-raspbian) and have precisely the same issue: "checking for correct temporary object destruction order" fails, and then the build terminates with failure. I need to be able to use the development versions of Couch, not the package version, so the apt-get doesn't work for me; any more ideas what might be causing this issue?

— Reply to this email directly or view it on GitHubhttps://github.com/iriscouch/build-couchdb/issues/58#issuecomment-9934094.

davidoccam commented 11 years ago

Yes Spidermonkey will not compile without patch, I used the following with success

CFLAGS="-O2 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" CXXFLAGS="${CFLAGS}" CHOST="armv6j-hardfloat-linux-gnueabi"

see http://www.raspberrypi.org/phpBB3/viewtopic.php?t=17983&p=191171

for chapter and verse and benchmarks on various combinations

On 31/10/12 06:21, Benoit Chesneau wrote:

spidemonkey still need a patch? On Oct 31, 2012 6:59 AM, "ussjoin" notifications@github.com wrote:

I'm running the newest Raspbian image (2012-10-28-wheezy-raspbian) and have precisely the same issue: "checking for correct temporary object destruction order" fails, and then the build terminates with failure. I need to be able to use the development versions of Couch, not the package version, so the apt-get doesn't work for me; any more ideas what might be causing this issue?

— Reply to this email directly or view it on GitHubhttps://github.com/iriscouch/build-couchdb/issues/58#issuecomment-9934094.

— Reply to this email directly or view it on GitHub https://github.com/iriscouch/build-couchdb/issues/58#issuecomment-9934446.

ussjoin commented 11 years ago

How do you put in those flags, in the context of a rake task? I tried just setting them locally, and it didn't seem to help.

ussjoin commented 11 years ago

If I run

$ CFLAGS="-O2 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" ./configure

Then I get the same error.

However, if I run

$ ./configure CFLAGS="-O2 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"

I get a few errors at the beginning of the configure, but then it completes successfully, and I can run the make.

The make crashes later, however, with a bunch of undefined references.

ussjoin commented 11 years ago

Any updates on this?

rdsqc22 commented 10 years ago

I was having this problem as well. It turns out, in the end, I didn't need to compile from source- SpiderMonkey is installable from the repository via: sudo apt-get install libmozjs-dev or sudo apt-get install libmozjs185-dev depending on which version you need.

(For me it was the latter, but I was trying to install to get JS support for elinks, not couchDB. This worked to build elinks from source with native JS support, for anyone looking to do the same)