This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: SimpleDateFormat
- From: Ben Gardiner <BenGardiner at nanometrics dot ca>
- To: decuplo at yahoo dot com
- Cc: java at gcc dot gnu dot org
- Date: Fri, 20 Jun 2008 09:38:31 -0400
- Subject: Re: SimpleDateFormat
- References: <393370.20753.qm@web56913.mail.re3.yahoo.com>
- - wrote:
Ben, I thanks you if you can send me an example.
No problem.
From this problem I imagine that other resouce are not included: do you know other class similar to this?
I had this same thought. Rather than try to figure out which resources I
needed, I decided to link them all in and maybe whittle it down later.
I'm sure Tom is right about -u, but then we would need an explicit list
of resource to include. So this is kinda the lazy way.
Another comment for all: if it is a know problem why is not provided an "official" library of proprietary resource?
I didn't submit one because the sentiment I've seen previously about
-static-libgcj is that people who are using it _want_ to include only
what is necessary, so a 'whole-archive' link of all the properties in
the .spec wouldn't have made it very far into trunk. Unfortunately for
you, your platform does only -static-libgcj.
So here's your recipe:
#copy libgcj to a working dir (could be in a different location than
/usr/lib/ for you)
mkdir -p /tmp/mess_with_libgcj
cd /tmp/mess_with_libgcj
cp /usr/lib/libgcj.a .
#extract all the object from this library
ar x libgcj.a
#make a lib with only the properties objects
ar rvcs libgcj_properties.a *properties*.o
#do the (sometimes superfluous) blessing of the lib
ranlib libgcj_properties.a
#copy the lib to the system lib dir
cp libgcj_properties.a /usr/lib/
#goto your source project and this time link-in those properties objects
with --whole-archive, this forces the linker to include them even if
they aren't statically referenced
cd <your source build-tree>
gcj -o <your prog> -Wl,--whole-archive -lgcj_properties
-Wl,--no-whole-archive -static-libgcj --main=<your main>
,Ben