author Mike Hommey <>
Sat, 04 Oct 2014 10:33:00 +0900
changeset 208801 d959a6081ceacde13d41b8a4ee192c912c85ef02
parent 168439 dc26e8d484f8739c00afbaaf9795563959b6f774
child 240850 bf1d0c9242d9ac334c7f7521789840a7c711b418
permissions -rw-r--r--
Bug 1077151 - Always use expandlibs descriptors when they exist. r=mshal Currently, when there is both an expandlibs descriptor and an actual static library, expandlibs picks the static library. This has the side effect that if there are object files in the static library that aren't directly used, they're dropped when linking, even when they export symbols that would be exported in the final linked binary. In most cases in the code base, files are not dropped that way. The most notable counter-example is xpcomglue, where actually not dropping files leads to link failure because of missing symbols those files reference (yes, that would tend to say the glue is broken in some way). On the opposite side, there is mozglue, which does have both a descriptor and a static library (the latter being necessary for the SDK), and that linking as a static library drops files that shouldn't be dropped (like jemalloc). We're currently relying on -Wl,--whole-archive for those files not to be dropped, but that won't really be possible without much hassle in a world where mozglue dependencies live in land. Switching expandlibs to use descriptors when they exist, even when there is a static library (so, the opposite of the current behavior) allows to drop -Wl,--whole-archive and prepare for a better future. However, as mentioned, xpcomglue does still require to be linked through the static library, so we need to make it a static library only. To achieve that, we make NO_EXPAND_LIBS now actually mean no expandlibs and use that to build the various different xpcomglues.

# WebappRT doesn't need these instructions, and they don't necessarily work
# with it, but it does use a GRE directory that the GRE shares with Firefox,
# so in order to prevent the instructions from being processed for WebappRT,
# we need to restrict them to the applications that depend on them, i.e.:
#   b2g:            {3c2e2abc-06d4-11e1-ac3b-374f68613e61}
#   browser:        {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
#   mobile/android: {aa3c5121-dab2-40e2-81ca-7ea25febc110}
#   mobile/xul:     {a23983c0-fd0e-11dc-95ff-0800200c9a66}
#   suite (comm):   {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
#   metro browser:  {99bceaaa-e3c6-48c1-b981-ef9b46b67d60}
# In theory we should do this for all these instructions, but in practice it is
# sufficient to do it for the app-startup one, and the file is simpler that way.

# Weave.js
component {74b89fb0-f200-4ae8-a3ec-dd164117f6de} Weave.js
contract;1 {74b89fb0-f200-4ae8-a3ec-dd164117f6de}
category app-startup WeaveService service,;1 application={3c2e2abc-06d4-11e1-ac3b-374f68613e61} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={aa3c5121-dab2-40e2-81ca-7ea25febc110} application={a23983c0-fd0e-11dc-95ff-0800200c9a66} application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} application={99bceaaa-e3c6-48c1-b981-ef9b46b67d60}
component {d28f8a0b-95da-48f4-b712-caf37097be41} Weave.js
contract;1?what=sync-log {d28f8a0b-95da-48f4-b712-caf37097be41}

# Register resource aliases
# (Note, for tests these are also set up in addResourceAlias)
resource services-sync resource://gre/modules/services-sync/

category healthreport-js-provider-default SyncProvider resource://services-sync/healthreport.jsm