Cool, glad that was it.

Btw, the --separate-asm option might help here, it emits the asm.js in
another file. Another option, if speed is not that important, is to disable
asm.js validation (-s ASM_JS=0).

On Wed, Aug 29, 2018 at 5:07 AM Joe Bibbo <[email protected]> wrote:

> Alon,
>
> Brilliant! You are right. I was looking at the output after Webpack got a
> hold of it.
>
> The output(.js) out of the emscripten tool chain produces clean
> asmjs code. It is a problem with my packaging tools.
>
> Now, I just a need to figure out how to get Webpack to ignore the embedded
> asmjs code when merging it. But obviously not an emscripten issue.
>
> Thanks for spotting my problem.
>
> Regards,
> Joe
>
>
> On Tuesday, August 28, 2018 at 6:21:47 PM UTC-5, Alon Zakai wrote:
>>
>> What options did you compile with? And did you run anything on the JS
>> afterwards?
>>
>> That code sample looks a little like what closure compiler or another JS
>> minifier might do. In emscripten, building with --closure 2 might lead to
>> similar stuff - but we would disable asm.js validation in that case. If you
>> run a minifier yourself on the output, without disabling that, then an
>> error like this could occur.
>>
>>
>> On Tue, Aug 28, 2018 at 2:22 PM Joe Bibbo <[email protected]> wrote:
>>
>>>
>>> After successfully building and verifying the functionality of a large
>>> C++ library, I was noticing that the code was running slower than expected.
>>> The browser was putting up a warning about
>>> the emscripten-generated asm.js "Invalid asm.js: Undefined global
>>> variable"  I tracked it down to the asm.js code, and any place that the
>>> toolchain
>>> had decided to use use a 'true' or 'false' constant. The browser would
>>> complain ( chrome, firefox ).
>>>
>>>                   .
>>>                   .
>>>                   .
>>>                         c[(F + 48 | 0) + 8 >> 2] = 674;
>>>                                Kk(0, 0, 184863, F + 48 | 0);
>>>                                Eb()
>>>                            }
>>>                            if (true ? (c[m + 8 >> 2] & 32 | 0) == 0 : 0)
>>>                                if ((d[m + 4 >> 0] | 0) < 2)
>>>                                    a = 36;
>>>                                else
>>>                                    a = 37;
>>>                            else
>>>                                a = 36;
>>>
>>>                     .
>>>
>>>
>>>
>>>
>>> Building on mac,
>>> emcc (Emscripten gcc/clang-like replacement) 1.38.5 (commit
>>> a4474e59db658cea570c78254fa71119cf688db5)
>>>
>>> Any ideas on what I must do to avoid this type of generated code?
>>>
>>> Thanks in advance for any help or advice.
>>>
>>> Regards,
>>> Joe
>>>
>>> --
>>>
>>> --
> 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.
>

-- 
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.

Reply via email to