Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: Geoff Keating <geoffk@geoffk.org>
Cc: Nathanael Nerode <neroden@twcny.rr.com>,
	gdb-patches@sources.redhat.com, binutils@sources.redhat.com,
	newlib@sources.redhat.com, gcc@gcc.gnu.org, autoconf@gnu.org
Subject: AC_NO_EXECUTABLES is useless for GCC
Date: Mon, 09 Dec 2002 22:05:00 -0000	[thread overview]
Message-ID: <oradjexvxi.fsf_-_@free.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: <jmisy2h3l6.fsf@desire.geoffk.org>

On Dec 10, 2002, Geoff Keating <geoffk@geoffk.org> wrote:

> Alexandre Oliva <aoliva@redhat.com> writes:
>> I don't get it.  Why does being able to link have anything to do with
>> being native?  Being able to *run* tests has to do with being native,
>> but that's not the point, and autoconf already avoids running tests
>> when cross-building.  But being able to link has to do with whether
>> the libraries that the compiler links in by default are present or
>> not.  That's the purpose of AC_NO_EXECUTABLES: to disable link tests
>> while building a library that the compiler driver would attempt to link
>> in by default, such as newlib, libstdc++ or libgcj.

> Aah, I see.  No, that's not the purpose of AC_NO_EXECUTABLES, or at
> least it's not what GCC wants out of it.  Some platforms can't link
> anything at all without special care.  For instance, you might need to
> know what board you plan to run the executable on and pass an
> appropriate flag (or supply an appropriate crt0 by hand).  For another
> example, vxworks can't and doesn't link anything, the final link takes
> place at runtime on the board, "executables" are created using 'ld
> -r', and you can refer to any symbols you like in the hope that
> they'll be available later.

I see.  Oh, well...  I was missing this bit of info when I designed
AC_NO_EXECUTABLES :-(  My apologies...

> It's assumed that in a native case, this sort of thing won't happen,
> thus the existing behaviour.  Maybe instead you could perform a
> configure-time test to see if the platform can link anything at all
> (and will fail to link with an obviously bogus symbol), and then base
> the decision of whether to run link tests on that, instead of the
> current approximation, but there'll still be some cases when linking
> is not possible, and other cases (the majority) in which link tests
> are possible and desirable.

I think we'll be better served by declarative macros such as
AC_{CC,CXX,...}_LINK_MAY_FAIL, that modify the autoconf-generated
sanity link test for AC_PROG_{CC,CXX,...} such that it does not bail
out if it fails, but rather it sets a variable indicating the result
of the test, such that we could base our decision on whether to
perform additional link tests on this variable.  Does it sound like
this would work?

Do we actually need AC_*_LINK_MAY_FAIL, or would a single
AC_LINK_MAY_FAIL macro be sufficient for libstdc++ and libgcj's needs?


Or perhaps we could make do with a configure argument that would tell
autoconf it's ok if the initial link test fails.  It could even
short-circuit all other configure link tests, such that one might be
able to configure a package containing link tests for a system that
doesn't really support linking.  The reason to not have this behavior
enabled by default is that we do want to detect situations when the
compiler is broken (the number of bogus reports caused by them used to
be huge when we didn't do it), but if a standard configure argument
disables the test, I think we're kind of ok.

Thoughts?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


  reply	other threads:[~2002-12-10  5:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-05 14:40 [RFC] Update to current automake/autoconf/libtool versions Nathanael Nerode
2002-12-05 15:19 ` Zack Weinberg
2002-12-06 10:21   ` Tom Tromey
2002-12-07 13:06   ` Alexandre Oliva
2002-12-07 16:03     ` Zack Weinberg
2002-12-09 19:16       ` Alexandre Oliva
2002-12-09 21:52         ` Geoff Keating
2002-12-09 22:05           ` Alexandre Oliva [this message]
2002-12-10  1:01             ` AC_NO_EXECUTABLES is useless for GCC Ian Lance Taylor
2002-12-08 13:11     ` [RFC] Update to current automake/autoconf/libtool versions Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=oradjexvxi.fsf_-_@free.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=autoconf@gnu.org \
    --cc=binutils@sources.redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=geoffk@geoffk.org \
    --cc=neroden@twcny.rr.com \
    --cc=newlib@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox