[Ohrrpgce] how to emscripten?

James Paige james.robert.paige at gmail.com
Thu Dec 28 11:56:39 PST 2023


Those instructions were very helpful. I now have a docker container with
the latest emscripten and fbc compiled from your emscripten branch.
However, I get a mutex error in filelayer.cpp

scons: Building targets ...
emcc -o build/filelayer.o -c -Wall -Wno-deprecated-declarations
-Wno-unused-but-set-variable -DFBCVERSION=1101 -g -fno-omit-frame-pointer
-O3 -DMINIMAL_OS -fno-pie -fwrapv --std=c++0x -Wno-non-virtual-dtor
filelayer.cpp
filelayer.cpp:39:1: error: reference to 'mutex' is ambiguous
   39 | mutex openfiles_mutex(true);  // Non-destructing mutex
      | ^
./mutex.hpp:14:7: note: candidate found by name lookup is 'mutex'
   14 | class mutex {
      |       ^
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/mutex.h:24:87:
note: candidate found by name lookup is 'std::mutex'
   24 | class _LIBCPP_EXPORTED_FROM_ABI
_LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex {
      |
                  ^
filelayer.cpp:39:7: error: no matching constructor for initialization of
'mutex'
   39 | mutex openfiles_mutex(true);  // Non-destructing mutex
      |       ^               ~~~~
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/mutex.h:30:3:
note: candidate constructor not viable: no known conversion from 'bool' to
'const mutex' for 1st argument
   30 |   mutex(const mutex&)            = delete;
      |   ^     ~~~~~~~~~~~~
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__mutex/mutex.h:28:43:
note: candidate constructor not viable: requires 0 arguments, but 1 was
provided
   28 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR mutex() = default;
      |                                           ^
2 errors generated.
scons: *** [build/filelayer.o] Error 1
scons: building terminated because of errors.


On Wed, Dec 27, 2023 at 7:54 AM Ralph Versteegen via Ohrrpgce <
ohrrpgce at lists.motherhamster.org> wrote:

> Oh, I haven't written instructions yet. I need to do that. But quickly:
>
> If you haven't already, install emscripten:
> git clone https://github.com/emscripten-core/emsdk.git
> cd emsdk
> Install "latest" version, or to avoid surprises in nightlies it's probably
> better to use the same version I have, which is 3.1.42
> ./emsdk install 3.1.42
> ./emsdk activate 3.1.42
> Put .../emsdk/upstream/emscripten in your PATH
>
> Compile FB:
> git clone https://github.com/rversteegen/fbc.git
> cd fbc
> checkout my 'emscripten' branch (which mostly contains bugfixes. I'll get
> these upstreamed sometime soonish)
> make -j4 install-compiler install-includes prefix=/install/fb/here
> make -j4 install-rtlib TARGET=asmjs-unknown-emscripten
> prefix=/install/fb/here
> (you can run "make install-rtlib TARGET=..." additional times to compile
> libraries for other targets)
>
> Then you can compile with "scons target=js ..."  (add fbc=... or else put
> the newly compiled fbc in $PATH)
>
>
>
> On Wed, 27 Dec 2023 at 07:32, James Paige via Ohrrpgce <
> ohrrpgce at lists.motherhamster.org> wrote:
>
>> I see when I run `scons target=js` I get
>>
>> Error: This installation of FreeBASIC doesn't support this target-arch
>> combination;
>> /usr/local/bin/../lib/freebasic/js-asmjs/libfb.a [or libfbpic.a] is
>> missing.
>>
>> Where do I find freebasic/js-asmjs/libfb.a ?
>>
>> TMC, have you written any instructions anywhere for how to compile the
>> ohr with emscripten?
>>
>> I'm feeling ready to tackle that nightly build :D
>>
>> ---
>> James
>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20231228/cc9e5337/attachment.htm>


More information about the Ohrrpgce mailing list