Well, what I think happened is we used to have a very simple dlopen, and
when we rewrote it to be more powerful, we simplified it to only work on
linkable code. So the case of a module loading symbols from itself is a
case that is not well handled, you're right, it adds overhead there.
However, perhaps you can work around it in the code, avoid using dlopen and
get the function pointers directly?

On Tue, Jan 22, 2019 at 2:53 PM Beuc <b...@beuc.net> wrote:

> Hi,
>
> To be honest I didn't try MAIN_MODULE=1, because this is documented as
> being slower, and incompatible with Emterpreter/pthreads/etc.
> I'm somewhat puzzled it worked before really, I'm asking to make sure I
> didn't miss something obvious.
>
> - Beuc
> On 22/01/2019 23:27, Alon Zakai wrote:
>
> Maybe the error is not clear enough - I think all you need to do is build
> with -s MAIN_MODULE=1. Does that fix things for you?
>
> On Tue, Jan 22, 2019 at 6:29 AM Beuc <b...@beuc.net> wrote:
>
>> Hi,
>>
>> For the GNU FreeDink project, which has a custom OpenGL loader, I use
>> code like:
>>
>>     BlendFunc = (void (APIENTRY*)(GLenum sfactor, GLenum
>> dfactor))SDL_GL_GetProcAddress("glBlendFunc");
>>
>> This stopped working recently, I believe this still worked in 1.38.21
>> which I used for my last build, though the error message I now get was
>> introduced in 538f958a900 (right before that version):
>>
>>     +    abort("To use dlopen, you need to use Emscripten's linking
>> support, see https://github.com/kripken/emscripten/wiki/Linking";);
>>
>>
>> I guess Emscripten previously supported loading symbols from the current
>> binary, and now rejects it?
>>
>> While it makes sense to modify FreeDink to locate GL functions
>> statically under Emscripten, I don't see anything related in
>> ChangeLog.md, so I'd like to make sure.
>>
>> --
>> Beuc
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
> 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 emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to