Not all functionality is complete yet in the new compiler, see the list of limitations in that link - stuff like setjmp and C++ exceptions are the main missing things. We'll implement those soon I hope, but I'm sending this email out to see which of the missing features is most important, so I know how to prioritize.
Priorities for me would be
Regards
-Mark
NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.
--
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 emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'm curious why you put linking of modules as #1? One of the reasons for module linking was to avoid long compilation times, which the new compiler solves directly. Or were you using linking for another reason?
We have a graphics engine and applications which use it. We would
like app developers to be able to work without having the engine
source and would like to load the engine code and app code from
different .js files. Modules seem like the way to do this but
possibly I am misunderstanding. Until now I have been compiling
engine & app together and am just about to attempt separating
them.
--
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 emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Priorities for me would beOn 2014/01/07 10:35, Alon Zakai wrote:
Not all functionality is complete yet in the new compiler, see the list of limitations in that link - stuff like setjmp and C++ exceptions are the main missing things. We'll implement those soon I hope, but I'm sending this email out to see which of the missing features is most important, so I know how to prioritize.
- Linking of asm.js shared modules
- C++ exceptions
- SIMD vector types
- indirectbr
Not all functionality is complete yet in the new compiler, see the list of limitations in that link - stuff like setjmp and C++ exceptions are the main missing things. We'll implement those soon I hope, but I'm sending this email out to see which of the missing features is most important, so I know how to prioritize.
Hi,As the maintainer of webruby(https://github.com/xxuejie/webruby), I need setjmp to work in order to port webruby to the new compiler.However, another thing occurs to me is that with the new compiler, this bug still exists: https://gist.github.com/xxuejie/5574172.In the old compiler, the workaround of this is to use the old "i386-pc-linux-gnu" target. Since the NaCl team has little interest(https://code.google.com/p/nativeclient/issues/detail?id=2381) of fixing this, my question is: is there a way that we can fix this in the compiler level? Or should I try to fix this in the mruby source code?Thanks for all the hard work!
Best Regards,
肖雪洁
Xuejie "Rafael" Xiao
On Tue, Jan 7, 2014 at 9:35 AM, Alon Zakai <alon...@gmail.com> wrote:
Hi,
Work is mostly done on the LLVM backend (codename 'fastcomp') intended to replace the core of emscripten's compiler. This is a proper C++ backend integrated with LLVM, and as such is far faster than the original one which was written in JS. Details about the new compiler are at
https://github.com/kripken/emscripten/wiki/LLVM-Backend
Not all functionality is complete yet in the new compiler, see the list of limitations in that link - stuff like setjmp and C++ exceptions are the main missing things. We'll implement those soon I hope, but I'm sending this email out to see which of the missing features is most important, so I know how to prioritize.
Instructions to build and use the new compiler are in that link as well. Please test when you get a chance, and report any bugs you see (the new compiler passes the emscripten test suite - the parts not using features not present yet - as well as fuzzing, so it seems fairly robust, however like any new compiler bugs are very possible).
- Alon
--
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 emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 emscripten-discuss+unsub...@googlegroups.com.
If you have a simple solution in mruby source, that would be best for you I think. If not, then we should see about fixing it in clang. My guess is that it is not a deep problem, just a todo, so likely not hard for us to fix. I've not worked on the clang code before though.
Mark, do you know if pnacl has plans to fix that issue (2381)?
On Tue, Jan 7, 2014 at 11:22 AM, Mark Seaborn <msea...@chromium.org> wrote:
On 7 January 2014 02:31, Mark Callow <callo...@artspark.co.jp> wrote:
Priorities for me would beOn 2014/01/07 10:35, Alon Zakai wrote:
Not all functionality is complete yet in the new compiler, see the list of limitations in that link - stuff like setjmp and C++ exceptions are the main missing things. We'll implement those soon I hope, but I'm sending this email out to see which of the missing features is most important, so I know how to prioritize.
- Linking of asm.js shared modules
- C++ exceptions
@Alon: I haven't looked very closely at how Emscripten implements C++ exceptions, such as how it encodes landingpad clauses in Javascript. You might find PNaCl's ExceptionInfoWriter.cpp useful for Emscripten. It's currently used by PNaClSjLjEH.cpp, and it encodes the landingpad clauses into three tables, which are interpreted by libsupc++ or libcxxabi. From skimming the source, I get the impression that Emscripten is doing something similar.
I noticed that, and wasn't sure what it does. How does it relate to LLVM's LowerInvoke pass? That also aims to lower invoke into setjmp AFAICT?
Currently emscripten lowers invoke into JS try-catch stuff, and uses libcxxabi to do the c++ type stuff, which does sound similar to what you mention there. Still no definite plan how to do it in the new compiler.
Mark: Thanks a lot for the patch!I did some test using the patch. Clang would indeed stop issuing errors, however, we are still hitting some errors in llvm. A detailed log containing outputs before and after the patch can be found at here: https://gist.github.com/xxuejie/8384185.So is this because of some restrictions in emscripten-fastcomp?
Oh ok, it is meant to be run just through llc, then it fails.Looks like the issue is that the pnacl passes leave a type in there,
%union.anon = type { float }So the problem occurred before this step, and the emcc-0 file would be useful.
--
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 emscripten-disc...@googlegroups.com.
Warning: Variable __init_array_start not referenced
Warning: Variable __init_array_end not referenced
Warning: Variable __fini_array_start not referenced
Warning: Variable __fini_array_end not referenced
Call parameter type does not match function signature!
%33 = load float* %.bc11, align 4
double %34 = call i32 @FPtoILow(float %33)
Call parameter type does not match function signature!
%33 = load float* %.bc11, align 4
double %35 = call i32 @FPtoIHigh(float %33)
Broken module found, compilation aborted!
0 opt 0x0000000100f0db58 void* llvm::object_creator<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >() + 12424
1 opt 0x0000000100f0e044 void* llvm::object_creator<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >() + 13684
2 libsystem_platform.dylib 0x00007fff84f9c5aa _sigtramp + 26
3 opt 0x0000000100e1b07e std::__1::vector<std::__1::pair<llvm::AttributeSet, unsigned int>, std::__1::allocator<std::__1::pair<llvm::AttributeSet, unsigned int> > >::__append(unsigned long) + 11710
4 opt 0x0000000100f0de66 void* llvm::object_creator<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >() + 13206
5 opt 0x0000000100ec965d void std::__1::vector<llvm::StructType*, std::__1::allocator<llvm::StructType*> >::__push_back_slow_path<llvm::StructType* const>(llvm::StructType* const&) + 28685
6 opt 0x0000000100ec9427 void std::__1::vector<llvm::StructType*, std::__1::allocator<llvm::StructType*> >::__push_back_slow_path<llvm::StructType* const>(llvm::StructType* const&) + 28119
7 opt 0x0000000100eb529c std::__1::vector<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord> >::__swap_out_circular_buffer(std::__1::__split_buffer<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord>&>&) + 27948
8 opt 0x0000000100eb548b std::__1::vector<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord> >::__swap_out_circular_buffer(std::__1::__split_buffer<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord>&>&) + 28443
9 opt 0x0000000100eb5752 std::__1::vector<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord> >::__swap_out_circular_buffer(std::__1::__split_buffer<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord>&>&) + 29154
10 opt 0x0000000100eb5fbd std::__1::vector<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord> >::__swap_out_circular_buffer(std::__1::__split_buffer<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord>&>&) + 31309
11 opt 0x0000000100eb635d std::__1::vector<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord> >::__swap_out_circular_buffer(std::__1::__split_buffer<llvm::Module::NeededRecord, std::__1::allocator<llvm::Module::NeededRecord>&>&) + 32237
12 opt 0x000000010074b5f7 void std::__1::vector<std::__1::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> >, std::__1::allocator<std::__1::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > > >::__push_back_slow_path<std::__1::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > const>(std::__1::pair<llvm::BasicBlock*, llvm::SuccIterator<llvm::TerminatorInst*, llvm::BasicBlock> > const&) + 7927
13 libdyld.dylib 0x00007fff8b22f5fd start + 1
14 libdyld.dylib 0x000000000000000a start + 1960643086
Stack dump:
0. Program arguments: /Volumes/APPLE_MEDIA/WORKSPACE/compilo/llvm/fastcomp/bin/opt /tmp/tmpWsFkjp/libUnigine.bc -strip-debug -internalize -internalize-public-api-list=main,malloc,free -globaldce -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt -o /tmp/tmpWsFkjp/libUnigine.bc.opt.bc
1. Running pass 'Function Pass Manager' on module '/tmp/tmpWsFkjp/libUnigine.bc'.
2. Running pass 'Module Verifier' on function '@_ZNK8Variable11getLongSafeEv'
Traceback (most recent call last):
File "/Volumes/APPLE_MEDIA/WORKSPACE/webgl/emscripten/emcc", line 1822, in <module>
shared.Building.llvm_opt(final, link_opts)
File "/Volumes/APPLE_MEDIA/WORKSPACE/webgl/emscripten/tools/shared.py", line 1173, in llvm_opt
assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
make: *** [all_engine_js] Error 1
--
Warning: Variable __init_array_start not referenced
Warning: Variable __init_array_end not referenced
Warning: Variable __fini_array_start not referenced
Warning: Variable __fini_array_end not referenced
warning: unresolved symbol: _ZTISt9exceptionwarning: unresolved symbol: glUnmapBufferwarning: unresolved symbol: glMapBuffer
-s TOTAL_MEMORY=536870912 \
-s WARN_ON_UNDEFINED_SYMBOLS=1 \-s CASE_INSENSITIVE_FS=1
uncaught exception: abort() at stackTrace@http://localhost/editor.js:12346invoke_iii@http://localhost/editor.js:20865invoke_vii@http://localhost/editor.js:20379invoke_vi@http://localhost/editor.js:20622invoke_vi@http://localhost/editor.js:20622invoke_vi@http://localhost/editor.js:20622invoke_vii@http://localhost/editor.js:20379callMain@http://localhost/editor.js:1933397
I cannot relate to what in my codebase triggers this error, so i'm wondering if I am hitting a known limitation of the new backend or if this is something you may want to look into?
template <typename T>inline void Swap(T& a, T& b){T temp = a;a = b;b = temp; // here it fails}
--
HiI have a fairly large codebase (game engine using gles2) that is already working pretty well using the old compiler backend. As building takes pretty long (~5minutes), i'd like to move on the the llvm backend as soon as possible.
Using the new backend, i get a few warnings while building:
Warning: Variable __init_array_start not referenced
Warning: Variable __init_array_end not referenced
Warning: Variable __fini_array_start not referenced
Warning: Variable __fini_array_end not referenced
warning: unresolved symbol: _ZTISt9exceptionwarning: unresolved symbol: glUnmapBufferwarning: unresolved symbol: glMapBuffer
{Map,Unmap}Buffer are not part of unextended OpenGL ES 2. I don't
know whose "gles2" implementation you were using previously but
your code base appears to be inadvertently using some extension
that provides these functions.
Regards
-Mark
NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.
{Map,Unmap}Buffer are not part of unextended OpenGL ES 2. I don't know whose "gles2" implementation you were using previously but your code base appears to be inadvertently using some extension that provides these functions.
The runtime abort is not a known limitation, that is something we need to figure out and solve. Any chance you can create a standalone testcase using that Swap function that I can debug? (I tried using it to swap some ints and that was fine, so it must be something more complex.)
--
--