Re: [webkit-dev] How did Apple build libicucore.dylib?

2014-01-20 Thread Mark Rowe
Moving webkit-dev to BCC since this is off-topic for the list.

On Jan 10, 2014, at 13:45, Eric Wing ewmail...@gmail.com wrote:

 (I tried webkit-help but didn't get any responses, so I thought maybe
 this list might be more appropriate for this question. Sorry for the
 duplicate if otherwise.)
 
 I am attempting to build JavaScriptCore for my own embedded
 application use. I noticed that Mac and iOS JavaScriptCore have a
 dependency on a library called libicucore.
 
 When I build ICU myself from the , I get a handful of different icu
 libraries, but nothing named core.
 
 While I can get a working JavaScriptCore built against my ICU
 libraries (I need icuuc, icui18n, and icudata), my final binary size
 is huge due to the ICU libraries I link in. I tried statically linking
 my icu libraries, but the smallest my binary gets is about 30MB per
 architecture. When I dynamically link ICU, I can tell that the major
 contribution of the bloat is due to the ICU libraries.
 
 Looking at Apple's icucore binary, it is about 6.5MB for 3
 architectures which is tiny compared to my 3 icu libraries. I'm
 speculating that Apple ripped out all the stuff they don't need and
 merged in all the parts they do need into the single libicucore.
 
 Can somebody confirm this is what Apple did, and can somebody tell me
 how I can reproduce that? (I did try downloading Apple's 10.9 source
 for ICU from MacOSForge, but it built the normal ICU stuff and not
 libicucore, nor did I notice any special build options.)

Disclaimer: I know very little about ICU, this is just what I found from 
spending a few minutes looking at their source.

If you look at the http://www.opensource.apple.com/source/ICU/ICU-511.25/ you 
can see the Makefile used when building ICU. It functions as a wrapper around 
ICU’s regular build process. I think the key option to shrink the library size 
is --with-data-packaging=archive. This puts the ICU data tables in a standalone 
file (/usr/share/icu/icudt51l.dat) rather than embedding them in the library. 
You'll also find the logic for packaging things up in to a library named 
libicucore.dylib here.

- Mark

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


[webkit-dev] How did Apple build libicucore.dylib?

2014-01-10 Thread Eric Wing
(I tried webkit-help but didn't get any responses, so I thought maybe
this list might be more appropriate for this question. Sorry for the
duplicate if otherwise.)

I am attempting to build JavaScriptCore for my own embedded
application use. I noticed that Mac and iOS JavaScriptCore have a
dependency on a library called libicucore.

When I build ICU myself from the , I get a handful of different icu
libraries, but nothing named core.

While I can get a working JavaScriptCore built against my ICU
libraries (I need icuuc, icui18n, and icudata), my final binary size
is huge due to the ICU libraries I link in. I tried statically linking
my icu libraries, but the smallest my binary gets is about 30MB per
architecture. When I dynamically link ICU, I can tell that the major
contribution of the bloat is due to the ICU libraries.

Looking at Apple's icucore binary, it is about 6.5MB for 3
architectures which is tiny compared to my 3 icu libraries. I'm
speculating that Apple ripped out all the stuff they don't need and
merged in all the parts they do need into the single libicucore.

Can somebody confirm this is what Apple did, and can somebody tell me
how I can reproduce that? (I did try downloading Apple's 10.9 source
for ICU from MacOSForge, but it built the normal ICU stuff and not
libicucore, nor did I notice any special build options.)

Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] How did Apple build libicucore.dylib?

2014-01-10 Thread Anders Carlsson

On Jan 10, 2014, at 1:45 PM, Eric Wing ewmail...@gmail.com wrote:

 (I tried webkit-help but didn't get any responses, so I thought maybe
 this list might be more appropriate for this question. Sorry for the
 duplicate if otherwise.)
 
 I am attempting to build JavaScriptCore for my own embedded
 application use. I noticed that Mac and iOS JavaScriptCore have a
 dependency on a library called libicucore.
 
 When I build ICU myself from the , I get a handful of different icu
 libraries, but nothing named core”.

Hi Eric,

the version of the source code shipped on OS X is available from 
http://www.opensource.apple.com/source/ICU/ICU-511.25/ so you can see how it’s 
done there.

Hope this helps,
- Anders

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] How did Apple build libicucore.dylib?

2014-01-10 Thread Darin Adler
While I don’t know the answer to the question you asked, 
http://userguide.icu-project.org/icufaq#TOC-How-can-I-reduce-the-size-of-the-ICU-data-library-
 answers what might be the real question. Not sure it’s important to replicate 
exactly what Apple did.

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] How did Apple build libicucore.dylib?

2014-01-10 Thread Eric Wing
On 1/10/14, Anders Carlsson ander...@apple.com wrote:

 On Jan 10, 2014, at 1:45 PM, Eric Wing ewmail...@gmail.com wrote:

 (I tried webkit-help but didn't get any responses, so I thought maybe
 this list might be more appropriate for this question. Sorry for the
 duplicate if otherwise.)

 I am attempting to build JavaScriptCore for my own embedded
 application use. I noticed that Mac and iOS JavaScriptCore have a
 dependency on a library called libicucore.

 When I build ICU myself from the , I get a handful of different icu
 libraries, but nothing named core”.

 Hi Eric,

 the version of the source code shipped on OS X is available from
 http://www.opensource.apple.com/source/ICU/ICU-511.25/ so you can see how
 it’s done there.

 Hope this helps,
 - Anders



Thank you for the response. I missed the (lower-case) makefile in
the root the first time around. (I went directly to the icuSources and
was running grep from there.) I see that this makefile contains
icucore customizations.

So I'm currently trying to figure out how to actually build it. There
is an additional dependency on http://www.iana.org/time-zones for
stuff. At every build step, I seem to be fighting something not found,
so I think I'm missing some setup detail. First, it couldn't find the
the /usr/local/share/tz directory. I created it and put
tzdata-latest.tar.gz and tzcode-latest.tar.gz in there. Then it
complained it couldn't find latest_tzdata.tar.gz (notice the file name
is flipped around) and I figured out it actually has to be a symlink
to tzdata-latest.tar.gz. Then it couldn't find yearistype.sh, so I
manually copied it to the place it was looking. Now I'm currently at
../../bin/zic: Can't open africa: No such file or directory

So I think I'm missing some setup step. Perhaps something related to
$(SDKROOTMOD)?

Anyway, if anybody has some additional info on how to build it, I
would greatly appreciate it.

Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] How did Apple build libicucore.dylib?

2014-01-10 Thread Eric Wing
On 1/10/14, Darin Adler da...@apple.com wrote:
 While I don’t know the answer to the question you asked,
 http://userguide.icu-project.org/icufaq#TOC-How-can-I-reduce-the-size-of-the-ICU-data-library-
 answers what might be the real question. Not sure it’s important to
 replicate exactly what Apple did.

 — Darin

Thanks for the valuable info. I'll start researching that too. I would
like to see if I can reproduce Apple's just so I have a baseline
reference (I've written a test262 conformance standalone app for
Mac+JSCore and am using it as my baseline comparison as I do my work
to make sure I'm not subtly breaking things).

But not needing to actually port and maintain all these customizations
would be useful to me in the end.

Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev