This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Avoid -lm and -lpthread in libjava on darwin
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, iains at gcc dot gnu dot org, mikestump at comcast dot net
- Date: Thu, 12 Aug 2010 14:24:30 -0400
- Subject: Re: [PATCH] Avoid -lm and -lpthread in libjava on darwin
- References: <20100812111936.GA23630@bromo.med.uc.edu> <4C643B58.email@example.com>
On Thu, Aug 12, 2010 at 11:20:08AM -0700, Richard Henderson wrote:
> On 08/12/2010 04:19 AM, Jack Howarth wrote:
> > Currently libjava built on darwin inappropriately passes -lm
> > and -lpthread to the linkage flags. These prevent libSystem from
> > properly linking last and thus interferes with the logic behind
> > libgcc_ext. The attached patch eliminates these undesired linkages
> > by not setting THREADLIBS or THREADSPEC on darwin and by replacing
> > the hardcoded assignment of '-lm' to libgcj_tools_la_LIBADD with
> > a new LIBJAVA_LDFLAGS_LIBMATH define (which is assigned with '-lm'
> > only when USING_DARWIN_CRT is undefined). Bootstrapped and regression
> > tested on x86_64-apple-darwin10. Okay for gcc trunk and gcc 4.5.2?
> Is this patch necessary with the remove-outfile patch in place?
The remove-outfile patch is necessary to make sure that the gcc
compilers don't shift libSystem forward in the linkage and
disrupt the logic behind libgcc_ext when -ldl, -lm or -lpthread
is passed to the compiler. The libjava patch covers the hardcoding
of -lpthread and -lm into the linker flags that are passed via
libtool directly to the linker. Both patches are required to have
all of the shared libraries in FSF gcc built with the libSystem