Created attachment 586403 [details] [diff] [review]
Change the order of -framework options when linking XUL so that it works on 10.6 -> 10.5 builds
On the 10.6 SDK and newer, the symbol _SCDynamicStoreCreate is visible in multiple freameworks:
$ nm SystemConfiguration | grep -w _SCDynamicStoreCreate
0000000000002be7 T _SCDynamicStoreCreate
$ nm IOKit | grep -w _SCDynamicStoreCreate$
00000000000579cc S $ld$hide$os10.7$_SCDynamicStoreCreate
000000000001ed66 T _SCDynamicStoreCreate
This is not a problem when the linker is run with a deployment target of 10.6, because it does the right thing and uses the symbol from SystemConfiguration.
It is also not a problem when using the 10.5 SDK, since _SCDynamicStoreCreate is only visible in SystemConfiguration in there.
The problem is when using the 10.6 SDK and a deployment target of 10.5. The resulting binary will use _SCDynamicStoreCreate from what is first on the command line. The first framework with _SCDynamicStoreCreate in the XUL link is IOKit, so XUL will find that symbol at runtime only when running on 10.6.
To fix this, we just have to make sure that "-framework SystemConfiguration" comes before "-framework IOKit". That is what this patch does.