Error compiling Spidermonkey 1.8.5 on 64bit linux

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error compiling Spidermonkey 1.8.5 on 64bit linux

Miles Thornton
Hi,

I'm trying to compile Spidermonkey 1.8.5 on linux.
I'm using gcc and g++ 4.5.3 and am trying to compile a 32bit library
on a 64bit version of linux (CentOS 5.3).

I built NSPR with:
cd nspr-4.8.8
mkdir linux_32
mkdir build
cd build
setenv CFLAGS -m32
../mozilla/nsprpub/configure --prefix=$HOME/SOURCE/nspr/nspr-4.8.8/
linux_32 --disable-debug --enable-optimize
make
make install

and am trying to build Spidermonkey using:
cd js-1.8.5
mkdir linux_32
mkdir build
cd build
setenv CFLAGS -m32
setenv CXXFLAGS -m32
../js/src/configure --disable-shared-js --enable-threadsafe \
             --with-nspr-cflags="-I$HOME/SOURCE/nspr/nspr-4.8.8/
linux_32/include/nspr" \
             --with-nspr-libs="$HOME/SOURCE/nspr/nspr-4.8.8/linux_32/
lib/libnspr4.a \
                               $HOME/SOURCE/nspr/nspr-4.8.8/linux_32/
lib/libplc4.a \
                               $HOME/SOURCE/nspr/nspr-4.8.8/linux_32/
lib/libplds4.a"
make

By build falls over when compiling jscompartment.c

jscntxt.cpp
c++ -o jscntxt.o -c  -I./dist/system_wrappers_js -include ../js/src/
config/gcc_hidden.h -DOSTYPE=\"Linux2.6.18-128\" -DOSARCH=Linux -
DEXPORT_JS_API -D__STDC_LIMIT_MACROS  -I../js/src -I. -I./dist/include
-I./dist/include/nsprpub  -I/u/mid/milest/SOURCE/nspr/nspr-4.8.8/
linux_32/include/nspr   -I../js/src -I../js/src/assembler -I../js/src/
yarr  -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -
Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-
dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -
Werror=return-type -pedantic -Wno-long-long -m32 -fno-strict-aliasing -
pthread -pipe  -DNDEBUG -DTRIMMED -O3 -fstrict-aliasing -fomit-frame-
pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1   -
DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jscntxt.pp ../
js/src/jscntxt.cpp
jscompartment.cpp
c++ -o jscompartment.o -c  -I./dist/system_wrappers_js -include ../js/
src/config/gcc_hidden.h -DOSTYPE=\"Linux2.6.18-128\" -DOSARCH=Linux -
DEXPORT_JS_API -D__STDC_LIMIT_MACROS  -I../js/src -I. -I./dist/include
-I./dist/include/nsprpub  -I/u/mid/milest/SOURCE/nspr/nspr-4.8.8/
linux_32/include/nspr   -I../js/src -I../js/src/assembler -I../js/src/
yarr  -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -
Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-
dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -
Werror=return-type -pedantic -Wno-long-long -m32 -fno-strict-aliasing -
pthread -pipe  -DNDEBUG -DTRIMMED -O3 -fstrict-aliasing -fomit-frame-
pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1   -
DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/
jscompartment.pp ../js/src/jscompartment.cpp
In file included from ../js/src/methodjit/BaseAssembler.h:51:0,
                 from ../js/src/methodjit/PolyIC.h:50,
                 from ../js/src/jscompartment.cpp:51:
../js/src/methodjit/MachineRegs.h:60:43: error: ‘r13’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:61:46: error: ‘r14’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:62:40: error: ‘r10’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:112:17: error: ‘r8’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:113:17: error: ‘r9’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:124:17: error: ‘r12’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:127:17: error: ‘r15’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:146:53: error:
‘js::mjit::Registers::SingleByteRegs’ cannot be initialized by a non-
constant expression when being declared
../js/src/methodjit/MachineRegs.h:175:49: error:
‘js::mjit::Registers::AvailRegs’ cannot be initialized by a non-
constant expression when being declared
../js/src/methodjit/MachineRegs.h: In static member function ‘static
bool
js::mjit::Registers::regForArg(js::mjit::Registers::CallConvention,
uint32, js::mjit::Registers::RegisterID*)’:
../js/src/methodjit/MachineRegs.h:228:13: error: ‘r8’ is not a member
of ‘JSC::X86Registers’
../js/src/methodjit/MachineRegs.h:229:13: error: ‘r9’ is not a member
of ‘JSC::X86Registers’
In file included from ../js/src/methodjit/CodeGenIncludes.h:58:0,
                 from ../js/src/methodjit/BaseAssembler.h:52,
                 from ../js/src/methodjit/PolyIC.h:50,
                 from ../js/src/jscompartment.cpp:51:
../js/src/methodjit/PunboxAssembler.h: At global scope:
../js/src/methodjit/PunboxAssembler.h:61:30: error: expected ‘)’
before ‘shtag’
../js/src/methodjit/PunboxAssembler.h: In constructor
‘js::mjit::ImmType::ImmType(JSValueType)’:
../js/src/methodjit/PunboxAssembler.h:69:64: error:
‘JSVAL_TYPE_TO_SHIFTED_TAG’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h:69:65: error:
‘JSValueShiftedTag’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function ‘void
js::mjit::PunboxAssembler::loadValueAsComponents(const js::Value&,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:130:38: error: ‘JSVAL_TAG_MASK’
was not declared in this scope
../js/src/methodjit/PunboxAssembler.h:131:38: error:
‘JSVAL_PAYLOAD_MASK’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testNull(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:280:44: error:
‘JSVAL_SHIFTED_TAG_NULL’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testUndefined(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:289:44: error:
‘JSVAL_SHIFTED_TAG_UNDEFINED’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testInt32(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:298:44: error:
‘JSVAL_SHIFTED_TAG_INT32’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testNumber(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:309:33: error:
‘JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET’ was not declared in this
scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testPrimitive(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:320:33: error:
‘JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET’ was not declared in
this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testObject(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:330:44: error:
‘JSVAL_SHIFTED_TAG_OBJECT’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testDouble(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:340:44: error:
‘JSVAL_SHIFTED_TAG_MAX_DOUBLE’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testBoolean(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:349:44: error:
‘JSVAL_SHIFTED_TAG_BOOLEAN’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function
‘JSC::AbstractMacroAssembler<JSC::X86Assembler>::Jump
js::mjit::PunboxAssembler::testString(JSC::MacroAssemblerX86Common::Condition,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:358:44: error:
‘JSVAL_SHIFTED_TAG_STRING’ was not declared in this scope
../js/src/methodjit/PunboxAssembler.h: In member function ‘void
js::mjit::PunboxAssembler::breakDouble(JSC::AbstractMacroAssembler<JSC::X86Assembler>::FPRegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:367:21: error: ‘class
JSC::X86Assembler’ has no member named ‘movq_rr’
../js/src/methodjit/PunboxAssembler.h: In member function ‘void
js::mjit::PunboxAssembler::fastLoadDouble(JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::FPRegisterID)’:
../js/src/methodjit/PunboxAssembler.h:376:21: error: ‘class
JSC::X86Assembler’ has no member named ‘movq_rr’
../js/src/methodjit/PunboxAssembler.h: In member function ‘void
js::mjit::PunboxAssembler::loadStaticDouble(const double*,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::FPRegisterID,
JSC::AbstractMacroAssembler<JSC::X86Assembler>::RegisterID)’:
../js/src/methodjit/PunboxAssembler.h:383:21: error: ‘class
JSC::X86Assembler’ has no member named ‘movq_rr’
../js/src/nanojit/NativeX64.h: At global scope:
../js/src/nanojit/NativeX64.h:346:31: warning: ‘nanojit::SavedRegs’
defined but not used
../js/src/nanojit/NativeX64.h:354:31: warning:
‘nanojit::SingleByteStoreRegs’ defined but not used
make[1]: *** [jscompartment.o] Error 1
make[1]: Leaving directory `/u/mid/milest/SOURCE/javascript_dir/
js-1.8.5/build'
make: *** [default] Error 2

I'm probably doing something stupid but I can't see what.
Does anybody have any ideas why my compile is failing?

Thanks

Miles
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Spidermonkey 1.8.5 on 64bit linux

Wes Garland
 > Does anybody have any ideas why my compile is failing?

I've never done this, but I suggest reading the mozilla build documentation
for cross-compiling, rather than trying to manually override CFLAGS etc
during configure.  There is explicit support for cross-compilation in the
build system, and IIUC building 32-bit on 64-bit platforms is one area where
it's actually tested.

Wes

--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Spidermonkey 1.8.5 on 64bit linux

Miles Thornton
In reply to this post by Miles Thornton

> I've never done this, but I suggest reading the mozilla build documentation
> for cross-compiling, rather than trying to manually override CFLAGS etc
> during configure.  There is explicit support for cross-compilation in the
> build system, and IIUC building 32-bit on 64-bit platforms is one area where
> it's actually tested.

Thanks for pointing me in the right direction. I found the information
in
https://developer.mozilla.org/en/Compiling_32-bit_Firefox_on_a_Linux_64-bit_OS
The key is to do:
setenv CC "gcc -m32"
setenv CXX "g++ -m32"
setenv AR ar
and pass --target=i686-pc-linux to configure

Reading the Spidermonkey build information document in more detail I
can see that the information is also there in the 'Specifying
compilers and compiler flags' section...
Apologies for wasting time (although in my defense at first glance the
information looks like it is under the 'Troubleshooting NSPR'
header)...

Miles


_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Spidermonkey 1.8.5 on 64bit linux

Wes Garland
Hi, Miles!

Got your build going!

On 13 June 2011 10:18, Miles <[hidden email]> wrote:
>
> Apologies for wasting time (although in my defense at first glance the
> information looks like it is under the 'Troubleshooting NSPR'
> header)...
>
>
Don't worry about it -- that said, it's a wiki, and if you have ideas on how
to clarify the documention, you should go at it!  If you're not sure about a
change you want to make, the guys in #devmo on irc.mozilla.org can give you
the nod.

Wes

--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine