OK So I've managed to get it to work they way I initially expected by
bringing the noInitialRun: true setting back and changing preRun to preInit.
I'm still confused as to the purpose of preRun as it seems that preInit is
doing what I thought preRun was for. I also am unsure what the run
dependencies are my only guess is it's talking about clang.js.mem which I'm
guessing isn't loaded before run() is reached.
On Wednesday, October 8, 2014 4:29:48 PM UTC-5, bobajeff wrote:
>
> I've started porting fastcomp (llvm/clang) to run in a browser to compile
> and execute c/c++ code. However I ran into an issue getting it to read some
> header files. I'm trying to use the createPreloadedFile API to load them
> from Module.preRun but that doesn't seem to be working.
>
> Here's what I put in var Module:
> preRun: function() {
> console.log('prerun');
> FS.createPath("/", "system/include/libc/bits/", true, true);
> FS.createPreloadedFile('/system/include/libc/', 'stdio.h',
> 'emscripten_datafiles/include/libc/stdiytdfhjyfo.h', true, true);
> FS.createPreloadedFile('/system/include/libc/', 'features.h',
> 'emscripten_datafiles/include/libc/features.h', true, true);
> FS.createPreloadedFile('/system/include/libc/bits/', 'alltypes.h',
> 'emscripten_datafiles/include/libc/bits/alltypes.h', true, true);
>
> },
>
> The full file is in the attachment. Also, here's a link to all of the
> files for the test page *(It's modified from the test page in
> clangor-master/js <https://github.com/kripken/clangor/tree/master/js>)*:
> http://www.mediafire.com/download/dtifmmt9ktvqt2u/fastcomp_browsertest.zip
>
>
> But when I run it the javascript console doesn't print the "prerun" string
> so I suspect it's not even running. Any ideas?
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.