Bug 12784 - Add flag to request static libgcj.a when invoking gcj
Summary: Add flag to request static libgcj.a when invoking gcj
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: unknown
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-27 02:48 UTC by Jeff Sturm
Modified: 2005-09-30 05:31 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-30 05:31:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Sturm 2003-10-27 02:48:09 UTC
It's useful but inconvenient to produce gcj-compiled executables linked to a
static libgcj.a archive, but dynamic libc etc.

The typical workarounds are:

- Configure with --disable-shared
- Remove libgcj.so from $prefix/lib
- Use -static and forgo a dynamic libc

A dynamic libgcj should remain the default, as it is recommended and will become
easier to deploy as the binary compatibility ABI is inplemented and libgcj.so
becomes prepackaged on popular distributions.

One suggestion is to name this flag -static-libgcj, similar to gcc's -static-libgcc.
Comment 1 Andrew Pinski 2003-10-27 03:02:49 UTC
I would say this should also happen for libstdc++ also because it has the same issues when it 
comes to ABI as libgcj but that would be definting the perpose of shared libraries, right?
Comment 2 Jeff Sturm 2003-10-27 04:07:22 UTC
Perhaps.  libstdc++ does have a bit more ABI stability than libgcj at this time,
though.  I'd be inclined to not have a -static-libstdc flag unless there are g++
users requesting it.  I don't know if there are.