Re: MinGW support for SpiderMonkey

Mihai Dobrescu <[email protected]> Tue, 26 Jul 2016 22:03:06 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On Wednesday, July 27, 2016 at 2:06:24 AM UTC+3, Steve Fink wrote:
> On 07/26/2016 10:30 AM, Mihai Dobrescu wrote:
> > On Tuesday, July 26, 2016 at 5:48:10 PM UTC+3, Tom Schuster wrote:
> >> You have to run make inside the OBJ folder.
> >>
> >> On Jul 26, 2016 14:35, "Mihai Dobrescu" <[email protected]> wrote:
> >>
> >>> On Tuesday, July 26, 2016 at 8:46:10 AM UTC+3, Mihai Dobrescu wrote:
> >>>> Fixed this, the error was due to a typo in MOZILLABUILD environment
> >>> variable.
> >>>>
> >>>> Now, the configuration finishes successfully and I have to figure out
> >>> how to run mach and see what build issues occur.
> >>>
> >>> I can't run mach. How is this supposed to work?
> >>> _______________________________________________
> >
> > Hello,
> >
> > Thanks for the info. It is not the first time I build something under MinGW.
> > Still I miss something.
> > It doesn't work:
> >
> > $ make
> > m:/mozilla/mozjs-45.0.2.mingw/config/baseconfig.mk:28: *** MSYS make is not supported.  Stop.
> >
> > Could you please give me the configuration steps, probably I do something wrong.
> 
> MozillaBuild ships with 'mozmake', which if I understand correctly is 
> pretty much just gmake compiled for msys. So running mozmake in place of 
> make will fix the above error, and the above error is not an indication 
> that anything else is wrong.
> 
> This is mentioned in the comment
> 
>    # Use "mozmake" on Windows
> 
> at
> 
>  
> https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation
> 
> By the way, you could also generate a Windows build by running 
> |js/src/devtools/automation/autospider.py plain|. If that works, you can 
> use it as a model for what configuration parameters etc. it wants. (It's 
> not really a useful tool for managing your own builds, so I'm not 
> recommending it for anything other than an example build.)

Hello,

I think you know I need a MinGW build. Actually, a MinGW64 bit.
For MSVC, here is what I do and it works every time:

I use start-shell-msvc2015-x64.bat and I type in that console:

cd M:/mozilla/mozjs-45.0.2/js/src
autoconf-2.13
mkdir build_DBG.OBJ
cd build_DBG.OBJ
../configure  --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32 --enable-nspr-build --enable-debug --disable-optimize
mozmake

For MinGW, I have MinGW64.

I have created mingw.bat containing:

set PATH=M:\Development\codeblocks\mingw-w64\x86_64-6.1.0-win32-seh-rt_v5-rev0\mingw64\x86_64-w64-mingw32\bin;M:\Development\codeblocks\mingw-w64\x86_64-6.1.0-win32-seh-rt_v5-rev0\mingw64\bin;m:\mozilla-build\python;%PATH%
set MOZILLABUILD=M:\mozilla-build
%MOZILLABUILD%\msys\msys.bat

Then, run mingw.bat and do in the console:

cd M:/mozilla/mozjs-45.0.2.mingw/js/src
autoconf-2.13
mkdir build_DBG.OBJ
cd build_DBG.OBJ
CC="gcc -m64" CXX="g++ -m64 -std=c++14" CPP=cpp CXXCPP="g++ -m64 -std=c++14" AS=as AR=ar LD=ld ../configure --target=x86_64-pc-mingw64 --host=x86_64-pc-mingw64 --enable-nspr-build --with-windows-version=603 --disable-accessibility --enable-debug --disable-optimize
mozmake

and the output is:

mozmake[1]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ'
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/bin _build_manifests/install/dist_bin
From dist/bin: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/branding _build_manifests/install/dist_branding
From dist/branding: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/idl _build_manifests/install/dist_idl
From dist/idl: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/include _build_manifests/install/dist_include
From dist/include: Kept 143 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/public _build_manifests/install/dist_public
From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/private _build_manifests/install/dist_private
From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/sdk _build_manifests/install/dist_sdk
From dist/sdk: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove dist/xpi-stage _build_manifests/install/dist_xpi-stage
From dist/xpi-stage: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/_virtualenv/Scripts/python.exe -m mozbuild.action.process_install_manifest --no-remove _tests _build_manifests/install/_tests
From _tests: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
m:/mozilla-build/mozmake/mozmake recurse_export
mozmake[2]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ'
mozmake[3]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/config'
mozmake[3]: Nothing to be done for 'export'.
mozmake[3]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/config'
mozmake[3]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/memory/build'
mozmake[3]: Nothing to be done for 'export'.
mozmake[3]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/memory/build'
mozmake[3]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/memory/mozjemalloc'
mozmake[3]: Nothing to be done for 'export'.
mozmake[3]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/memory/mozjemalloc'
mozmake[3]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/mozglue/build'
mozmake[3]: Nothing to be done for 'export'.
mozmake[3]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/mozglue/build'
mozmake[3]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/config/external/nspr'
cat: ../../../config/buildid: No such file or directory
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "m:\mozilla-build\python\Lib\_strptime.py", line 467, in _strptime_time
    return _strptime(data_string, format)[0]
  File "m:\mozilla-build\python\Lib\_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '' does not match format '%Y%m%d%H%M%S'
m:/mozilla-build/mozmake/mozmake -C ../../../nsprpub export SH_DATE="-- ::" SH_NOW="000000" SHARED_LIBRARY= IMPORT_LIBRARY= SHARED_LIB_PDB=
mozmake[4]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub'
m:/mozilla-build/mozmake/mozmake -C config export
mozmake[5]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/config'
rm -f m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/dist/bin/nspr-config
mozmake[5]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/config'
m:/mozilla-build/mozmake/mozmake -C pr export
mozmake[5]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr'
m:/mozilla-build/mozmake/mozmake -C include export
mozmake[6]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr/include'
m:/mozilla-build/mozmake/mozmake -C md export
mozmake[7]: Entering directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr/include/md'
nsinstall -m 444 m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_unixware7.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_hpux32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_symbian.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_aix64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_unixware.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_irix64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_scoos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_freebsd.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_solaris.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_netbsd.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_win95.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_winnt.cfg m:/mozilla/
 mozjs-45.0.2.mingw/nsprpub/pr/include/md/_irix32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_beos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_bsdi.cfg m:/mozilla/mo
 zjs-45.0.2.mingw/nsprpub/pr/include/md/_darwin.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_qnx.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_linux.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_os2.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_hpux64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_aix32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_dgux.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_riscos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_osf1.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_nto.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_openbsd.cfg m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/dist/include/nspr/md
process_begin: CreateProcess(NULL, nsinstall -m 444 m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_unixware7.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_hpux32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_symbian.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_aix64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_unixware.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_irix64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_scoos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_freebsd.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_solaris.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_netbsd.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_win95.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/p
 r/include/md/_winnt.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_irix32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_beos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr
 /include/md/_bsdi.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_darwin.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_qnx.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_linux.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_os2.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_hpux64.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_aix32.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_dgux.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_riscos.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_osf1.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_nto.cfg m:/mozilla/mozjs-45.0.2.mingw/nsprpub/pr/include/md/_openbsd.cfg m:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/dist/include/nspr/md, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:22: recipe for target 'export' failed
mozmake[7]: *** [export] Error 2
mozmake[7]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr/include/md'
m:/mozilla/mozjs-45.0.2.mingw/nsprpub/config/rules.mk:163: recipe for target 'export' failed
mozmake[6]: *** [export] Error 2
mozmake[6]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr/include'
m:/mozilla/mozjs-45.0.2.mingw/nsprpub/config/rules.mk:163: recipe for target 'export' failed
mozmake[5]: *** [export] Error 2
mozmake[5]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub/pr'
m:/mozilla/mozjs-45.0.2.mingw/nsprpub/config/rules.mk:163: recipe for target 'export' failed
mozmake[4]: *** [export] Error 2
mozmake[4]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/nsprpub'
Makefile:47: recipe for target 'export' failed
mozmake[3]: *** [export] Error 2
mozmake[3]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ/config/external/nspr'
m:/mozilla/mozjs-45.0.2.mingw/config/recurse.mk:79: recipe for target 'config/external/nspr/export' failed
mozmake[2]: *** [config/external/nspr/export] Error 2
mozmake[2]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ'
m:/mozilla/mozjs-45.0.2.mingw/config/recurse.mk:32: recipe for target 'export' failed
mozmake[1]: *** [export] Error 2
mozmake[1]: Leaving directory 'm:/mozilla/mozjs-45.0.2.mingw/js/src/build_DBG.OBJ'
m:/mozilla/mozjs-45.0.2.mingw/config/rules.mk:547: recipe for target 'default' failed
mozmake: *** [default] Error 2

What do I do wrong?