[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.59 and Explicit libc linking checks

From: Rafael Rivera Jr.
Subject: Re: 2.59 and Explicit libc linking checks
Date: Fri, 03 Mar 2006 14:08:30 -0500
User-agent: Thunderbird 1.5 (Windows/20051201)


Thanks for the libtool pointer. I have CCed the proper list but intend on removing address@hidden in future replies.

On SkyOS (and cross-compiling tools for SkyOS on Cygwin), libsky gets implicitly linked but because we failed this check, -lc is getting added ( archive_cmds_need_lc=yes ) which bombs in the linking stages.

Maybe I'm confused, but it looks like this code is trying to determine whether or not -lc exists. If this is the case, it looks like the logic is backwards because grep returns an error code of 1. Again, maybe I'm just confused.


Ralf Wildenhues wrote:
Hi Rafael,

* Rivera, R wrote on Sun, Feb 26, 2006 at 08:38:34PM CET:
New to this list. It seems the logic behind determining whether or not
should be explicitly linked is backwards (in a generated configure

This is a Libtool question, and as such would've fit better on one of
its mailing lists.  I understand though that this is difficult to see.

The grep command in...

(eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5

... returns a value of 1 if the string is not found. Looking a few
down, you'll find...

(exit $ac_status);

... which fails the condition test and turns on explicit linking. As
cannot assume grep has a -v option, I would think the
'archive_cmds_need_lc=no' and 'archive_cmds_need_lc=yes' statements

Does that make sense? Is this a problem with my logic or autoconf's

There is a comment a few lines above:
# Test whether the compiler implicitly links with -lc since on
      # systems, -lgcc has to come before -lc. If gcc already passes -lc
      # to ld, don't add -lc before -lgcc.

This is what the test is supposed to achieve.  First of all, the code is
not triggered at all if archive_cmds_need_lc has been set to 'no'

What system are you on?  What does archive_cmds_need_lc get set to and
what would you expect instead?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]