Hi all, I'm also interested in --start-group/--end-group. I'm trying to build an existing project which uses gyp and ninja to build, and gyp basically passes the .a files in an arbitrary order and wraps the whole set in --start-group/--end-group.
Supporting this functionality in shared.Building.link should be possible (passing a list of archive-groups instead of a list of archives). Alternatively, the particular case of gyp could be handled by supporting a new emcc-specific flag like --group-all or something which specifies that the whole set of archives should be repeatedly scanned as if they were all contained in --start-group/--end-group. This would be simpler to implement. Do either of these options sound palatable? I could take a stab and putting a patch together. Thanks, Ryan On Thursday, March 6, 2014 3:18:27 PM UTC-8, Alon Zakai wrote: > > Hmm yes, .a files do work that way I believe, and we support linking them > with proper semantics, so that should work. > > - Alon > > > > On Thu, Mar 6, 2014 at 12:26 AM, Warren Seine <[email protected]<javascript:> > > wrote: > >> Thank you. I've had a look at the llvm-link source code, and there used >> to be an option --start-group which was simply ignored (and has since >> been withdrawn), so I'm wondering if that's the default behaviour now. >> >> Anyway, somebody mentioned that I could put together all the .a files >> into a single one and then only link the big one. I guess that'd work? I'll >> try that. >> >> >> On Wednesday, March 5, 2014 10:56:42 PM UTC+1, Alon Zakai wrote: >> >>> The most relevant doc is likely https://github.com/kripken/ >>> emscripten/wiki/Building-Projects but you can just look in emcc to see >>> what we support and do not support. I've never heard of that option, so I >>> guess we don't support it. >>> >>> - Alon >>> >>> >>> >>> On Wed, Mar 5, 2014 at 12:50 AM, Warren Seine <[email protected]>wrote: >>> >>>> @Alon, any idea? Can you describe (or point me to a page explaining) >>>> the linking step? >>>> >>>> >>>> On Tuesday, March 4, 2014 9:21:09 AM UTC+1, Warren Seine wrote: >>>>> >>>>> Hi, >>>>> >>>>> -Wl,--start-group and -Wl,--end-group are compiler options to tell >>>>> the linker to look for symbols in previous libraries, as in "before in >>>>> the >>>>> command line". They seem to have no effect on link order with emccand I'm >>>>> not really surprised because the link step is different from native >>>>> builds in many ways. I'm wondering if someone has been there and found a >>>>> workaround to avoid unresolved symbols when linking static libraries with >>>>> circular dependencies. >>>>> >>>>> I can reorder manually reorder libraries or put them twice, but for >>>>> some reason I'd prefer to use this feature (or something similar) which >>>>> works fine with gcc. >>>>> >>>>> Cheers, >>>>> >>>> -- >> 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/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 [email protected]. For more options, visit https://groups.google.com/d/optout.
