Yes, bc files are just a single object file. .a files are a historic format
that contains multiple objects and has complex linking semantics - e.g.
only basenames are stored; the order of linking matters; etc. .bc files
don't have any of those issues.

I'm not familiar with cmake, but it might automatically generate a .a for a
static library and a .so (which is the same as .bc or .o for emscripten)
for a dynamic library, so telling it that might work.

On Mon, Aug 31, 2015 at 9:51 AM, Robert Goulet <[email protected]>
wrote:

> Yes, I understood the warning message.
>
> So, I could generate .bc files instead of .a files and that should fix
> the issue?
>
> If that's the case, how do I tell CMake to build my libraries into .bc
> files instead of .a files using the toolchain file provided by Emscripten?
>
> And what is the difference between a .a and a .bc library file?
>
> Thank you!
>
>
> On Monday, August 31, 2015 at 11:44:12 AM UTC-4, Alon Zakai wrote:
>>
>> As the message says, the issue arises when you have identical basenames
>> in a .a file (because .a files only store a basename). Instead of archiving
>>
>> dir1/name.o
>> dir2/name.o
>>
>> you can rename one of those "name"s.
>>
>> Or, avoid .a files. Linking .o files into bigger .o files (or .so, or
>> .bc, all the same) works fine, emcc will call llvm-link for you.
>>
>>
>>
>> On Mon, Aug 31, 2015 at 7:26 AM, Robert Goulet <[email protected]>
>> wrote:
>>
>>> When building a rather large project, I get this warning:
>>>
>>> WARNING  root: loading from archive
>>> D:\dev\project\source\develop\build\engine\webgl\lib\libfoundation.a, which
>>> has duplicate entries (files with identical base names). this is dangerous
>>> as only the last will be taken into account, and you may see surprising
>>> undefined symbols later. you should rename source files to avoid this
>>> problem (or avoid .a archives, and just link bitcode together to form
>>> libraries for later linking)
>>>
>>> That one seems a bit odd to me and worries me. How do we fix this if we
>>> use CMake to build our project using the Emscripten toolchain file
>>> provided? Does this means we can generate other file formats that are not
>>> archive libraries (.a) but are used for the same purpose?
>>>
>>> Thanks!
>>>
>>> --
>>> 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.
>

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