Re: [PATCH] link libgcj directly to libiconv to resolve symbols

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.patches
Message-ID <[email protected]>
On 07/06/2013 04:58 AM, Jack Howarth wrote:
> On Fri, Jul 05, 2013 at 05:25:47PM +0100, Andrew Haley wrote:
>> On 07/05/2013 05:10 PM, Jack Howarth wrote:
>>>    Currently the build of the libgcj shared library in libjava
>>> omits a direct linkage against the libiconv shared library to
>>> resolve the undefined _libiconv, _libiconv_close and
>>> _libiconv_open symbols in libgcj. My understanding of shared
>>> library best practices is that shared libraries should always be
>>> linked directly to the those shared libraries required to resolve
>>> their undefined symbols rather than postponing this linkage until
>>> when the shared library is used (as is currently done in
>>> libjava/libgcj.spec.in).  The attached patch achieves this by
>>> removing the @LIBMATHSPEC@ from *lib: in libjava/libgcj.spec.in
>>> and moving it as $(LDLIBICONV) onto libgcj_la_LDFLAGS in
>>> libjava/Makefile.am and libjava/Makefile.in.
>>> Bootstrap and regression tested on x86_64-apple-darwin12 for gcc
>>> trunk and gcc-4_8-branch.
>>> Okay for gcc trunk and gcc-4_8-branch?
>>
>> No.  Some systems have iconv in libc, some have it in libiconv.
> 
>    I assume you are doing this to create binary tarball
> distributions which can be deployed on various linux distros,
> correct? Isn't this rather dangerous as you are compiling libgcj
> against the headers of some unknown libiconv release and then having
> it linked against a completely different one when deployed in the
> field.

It's never broken anything before.  Why would it do so now?

> Doesn't this require a lot of assumptions about the data structures
> on libiconv calls not changing between the various releases? It
> would seem to be safier if you just added an option to statically
> link libiconv.a into libgcj if such a portable tarball release was
> required.

It'd help a lot if you explained what problem you're trying to solve.
"shared library best practices" doesn't quite do it.

Andrew.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.