Thanks for your reply Alon and great pointer to use llvm-nm. I used it, and 
it seems like the symbols are present as global functions, output shows the 
following for the .o I'm mainly interested in:

0000000000000000 T _group_session_builder_create 
00000000000002b0 T _group_session_builder_create_session 
0000000000000590 T _group_session_builder_free 
0000000000000120 T _group_session_builder_process_session

Name seems to match the exported functions I listed on my last command, any 
other ideas?

On Thursday, August 17, 2017 at 7:56:41 PM UTC-7, Alon Zakai wrote:
>
> You can use llvm-nm to print the symbols in the .a file there, that can 
> check if the problem is before the final command or after. If they aren't 
> present, then the problem is before, and you can use llvm-nm on the 
> intermediate files too, to track the symbols from their origin. (Or if the 
> problem is on that line, then I'd guess it's a typo in the exported 
> functions names.)
>
> On Thu, Aug 17, 2017 at 6:23 PM, Marcos Agustín Carranza <
> [email protected] <javascript:>> wrote:
>
>> Hi All!
>>
>> I'm trying to use this wonderful tool to convert a C library (
>> https://github.com/WhisperSystems/libsignal-protocol-c/) to JS. The 
>> library itself has a JS version, but it is not complete and I actually need 
>> some missing implementations that exist in the C version. I'm using 
>> emscripten v1.35 and am able to run emcc successfully on the resulting .a 
>> library and generate a JS file. That said, I believe that due to dead code 
>> elimination, I'm not seeing the particular methods I need there. I noticed 
>> there is the possibility to use the -s EXPORTED_FUNCTIONS flag, which is 
>> why I'm posting this question here.
>>
>> The process I'm following is as follows:
>>
>> Cloning the repo.
>> cd libsignal-protocol-c
>> mkdir build && cd build
>> cmake ..
>> emmake make
>> emcc src/libsignal-protocol-c.a -o libsignal-protocol.js 
>> -s EXPORTED_FUNCTIONS="['_group_session_builder_process_session', 
>> '_group_session_builder_create_session']"
>>
>> The output js file does not include the aforementioned functions. Am I 
>> doing anything wrong? I greatly appreciate any pointers here. No warnings 
>> or errors are printed during compilation.
>>
>> In case it helps, the functions I need are here in the original c code: 
>>
>>
>> https://github.com/WhisperSystems/libsignal-protocol-c/blob/master/src/group_session_builder.c
>>
>> -- 
>> 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] <javascript:>.
>> 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